HTTP performance Comparison of Golang and Java

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Company to restructure a statistical project, statistics section to provide a web interface, because the statistical system of log volume is very large, so the performance requirements of the Web service is very strict, in the context of technology selection to do the Golang and Java performance comparison.

    • Test environment:

Mac Pro 13.4.0

golang:go version go1.3.1 darwin/amd64

Java:1.7.0_71, based on the Tomcat container


    • Test tools

Apache AB Tool: Http://httpd.apache.org/docs/2.2/programs/ab.html


    • Testing process

      • Golang using the source Net/http service to build HTTP projects, interface output Hello World

      • Java uses Servlets to build Web projects, and the interface outputs Hello World

      • The AB tool uses Ab-c 100-n http://127.0.0.1/track_proxy to simulate 100 clients concurrently sending a total of 1000 requests


    • Test results

      Gomaxprocs=1 (gomaxprocs=4 in parentheses)


From the test results, Gomaxprocs = 1 o'clock, Golang http performance than Java slightly some advantages, Gomaxprocs = 4 o'clock, Golang HTTP performance slightly improved, overall Golang performance wins, or go with it ~ ~

Related Article

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.