HAProxy performance in high concurrency
After the xunqi message gateway server is migrated from Beijing to the Wuxi data center, after a text message is sent, only about 60% of the text message status reports are received.
After understanding the business logic, you can view the statistical status on the stats page of haproxy as follows:
In the red circle, we can see that the maximum number of sessions has reached 4096, while maxconn in my haproxy. cfg file is 2000. Of course, the number of connections is not enough. In fact, the back-end SMS Server Always reports an error, and the front-end Page Server also reports an error, but you have not communicated on this issue. It took nearly a month to solve the problem.
So we changed it to 5000. Re-load the configuration and the number of connections went up. However, the reset connections in the resp continue to rise. Why?
Use ulimit-n to check whether the default value of open files is 1024. Change it to 50000. Observe for a while and find that although the resp growth speed is reduced, there is still. Then adjust the parameters:
Net. ipv4.tcp _ fin_timeout = 5
Net. ipv4.tcp _ tw_reuse = 1
Net. ipv4.tcp _ tw_recycle = 1
Net. ipv4.ip _ local_port_range = 10240 61000
After the modification is complete, observe for a while and find that it is finally quiet. Resp is always kept as 0.
Of course, this intermediate process took two days to solve.
Haproxy + Keepalived build Weblogic high-availability server Load balancer Cluster
Keepalived + HAProxy configure high-availability Load Balancing
Haproxy + Keepalived + Apache configuration notes in CentOS 6.3
Haproxy + KeepAlived WEB Cluster on CentOS 6
Haproxy + Keepalived build high-availability Load Balancing
Configure an HTTP Load balancer using HAProxy
For details about HAproxy, click here
HAproxy: click here
This article permanently updates the link address: