Nginx's http20 performance is too backward, and HTTPS website performance is optimized

Source: Internet
Author: User
Tags website performance
: This article mainly introduces nginx's http20 performance is too backward, and HTTPS website performance is optimized. if you are interested in PHP tutorials, please refer to it. Background

On the layer-7 load layer, five physical machine branches with 24 U + 64G memory are used for https encryption and decryption and proxy_pass. During the daily work hours, the CPU of the five machines is about 50%, which is a computing type.
Optimization Methods: keepalive and TLS1.2 encryption algorithm optimization (refer to: 1, 2), etc., with little effect.
The keepalive option is very concise. no matter how the server supports it, the key is that the client does not keep with you.

Test process

  • Hardware: 24 U + 64G physical Machine 2, 1 with test, 1 running ngx; 1 GB Nic in the same LAN.
  • Nginx-V:

    Version: openresty/1.9.7.3
    Built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
    Built with OpenSSL 1.0.1e-fips 11 Feb 2013
    Tls sni support enabled
    With-http_v2_module

  • Apache AB stress testing tool: yum installation

  • Boom is a stress testing tool for simulation of AB golang: https://github.com/rakyll/boo.
  • Nghttp2 h2load pressure test tool: https://github.com/tatsuhiro-t/nghttp2
  • CentOS-7 64-bit
  • Test file size: 5 k, 10 k images for https testing of static files.
  • Test Procedure:-c = 100 ~ 3000,-n = 1k ~ 10kw combination,-m = 1 ~ when h2load is used ~ The value range of-m is smaller than 1000, which has little impact on http2 results.

Figure:

Put the traffic diagram to understand:

When AB and boom are used:

At this time, both AB and boom use-k. In any case, the measurement and time are generally at this level.
For example, the following command takes about half an hour:

Boom-c 1000-n 1000000-allow-insecure https: // 172.16.9.234/5k.jpg
AB-c 1000-n 1000000-khttps: // 172.16.9.234/5k.jpg

When the parameter is changed to http2:

H2load-c 1000-n 1000000-m1 https: // 172.16.9.234/5k.jpg

The h2load running result is as follows:

When testing http2 for h2load:

Gigabit Nic, full outbound traffic.

Conclusion

The following conclusions have been repeatedly tested and only represent my opinion. For more information, see from: toontong.

  1. At the same concurrency, http2.0 only took 43 seconds to transmit 4.3G data, while http1.1 took more than 40 minutes.
  2. The single-argument transmission performance is improved by more than 10 times, which is very effective for our key https CPU usage.
  3. Of course, the overall performance of the web service is not improved by 10 times. The reason is that the connection is established at the required time. more reasons are required to study the http2 principle.
  4. Go1.6 is available only after http2-client library support, lower version go feel can use https://github.com/tatsuhiro-t/go-nghttp2
  5. If we really popularize http2.0, it would be a great boon for Internet traffic and machine saving by Internet companies.

'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
  • '). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script

    The above introduces the nginx http20 performance is too backward, HTTPS website performance optimization, including content, hope to be helpful to friends interested in PHP tutorials.

    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.