Because the company needs to be on-line HTTPS, so for HTTPS need to do stress testing, using the same encryption strength of the certificate, respectively, Haproxy and nginx to do stress testing, and then CPU usage comparison:
The following are 1000 request stress tests for the same URL and background server:
First time Haproxy 1000 times HTTPS pressure test
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/77/97/wKiom1ZqI1yCW8a1AAICFEr2anI819.jpg "title=" Haprooxy 1000.jpg "alt=" Wkiom1zqi1ycw8a1aaicfer2ani819.jpg "/>
Second Haproxy http voltage test
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/77/97/wKiom1ZqJC2A5X0fAAHPW3e3C_c177.jpg "title=" Haproxy http.jpg "alt=" Wkiom1zqjc2a5x0faahpw3e3c_c177.jpg "/> Third nginx HTTPS, default DH encryption algorithm pressure measurement
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/77/98/wKiom1ZqJavQ4asaAAEEU5eUWTE088.jpg "title=" Nginx Https.jpg "alt=" Wkiom1zqjavq4asaaaeeu5euwte088.jpg "/>
The fourth time Nginx does not use the DH encryption algorithm
650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M02/77/96/wKioL1ZqJu2AK51eAAH8XzDZi7U406.jpg "title=" Nginx HTTPS rc4.jpg "alt=" Wkiol1zqju2ak51eaah8xzdzi7u406.jpg "/>
Now compare the idle load of the 4-time system
650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/77/96/wKioL1ZqKBOj0xrtAABjMM0pcjg751.jpg "title=" 967. JPG "alt=" wkiol1zqkboj0xrtaabjmm0pcjg751.jpg "/>
Can see we do 4 pressure test, where haproxy on the CPU pressure, nginx default use DH encryption algorithm of the CPU pressure to less than half haproxy, and then do not use the DH encryption algorithm on the CPU pressure is less than the CPU pressure using DH
Item (1000 times) |
Time Required (seconds) |
Number of requests without seconds (times) |
Haproxy HTTPS |
139.9 |
7.15 |
Haproxy HTTP |
3.5 |
285.57 |
Nginx HTTPS (DH) |
32.6 |
30.60 |
Nginx HTTPS (RC) |
15.5 |
64.14 |
It can be seen that although the Haproxy support HTTPS but for the performance of HTTPS processing is relatively weak, compared to Nginx, the same encryption algorithm can be 4 times times higher. But for HTTP, processing speed is less than 10 times times, so now many sites do not use HTTPS heavily, but also for the cost of consideration
For Haproxy and Nginx configuration HTTPS can be consulted
http://fengwan.blog.51cto.com/508652/1719863 (Haproxy HTTPS)
http://fengwan.blog.51cto.com/508652/1719708 (Nginx HTTPS)
This article is from "Maple Night" blog, please be sure to keep this source http://fengwan.blog.51cto.com/508652/1721907
Haproxy HTTPS VS Nginx HTTPS