This is a created article in which the information may have evolved or changed.
New created with Revel creates a simple sample app and uses AB to do simple performance testing. Set the concurrency number to 1000.
The results are as follows:
Run in dev mode: 1200 Times/sec
Operating in PROD mode: 4,800 times/sec
Apps created by default can only use a single CPU, which is a waste of resources for multicore multi-CPU servers by modifying Init.go
Add the following code to it:
Runtime. Gomaxprocs (runtime. NUMCPU ())
After testing again, get the test data: 17500/per second.
Another: To do performance testing or formally deploy to the production environment do not forget to set the watch to false, the development state to open watch is very cool, modify the code does not need to restart the service, Revel found that the code changes will be automatically recompiled, return new results, but the cost is the performance of the drop. I forgot to turn this feature off. The results of the performance test are reduced from 18,000 times/per second to 600 times per second.