Go Revel Simple performance test

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.