TIME_WAIT is a state of socket waiting for a certain amount of time to close.
Because of the very frequent communications between nginx and php-fpm, you will find sockets of TIME_WAIT accumulating a lot over 30,000. It looks uncomfortable.
The solution is to use a unix domain socket.
1. php-fpm.con
2. nginx.conf
fastcgi_pass unix:/tmp/fastcgi.sock;
you will find a great reduction in the number of sockets of TIME_WAIT.
However, from my test the performance is worse than TCP socket.
I don't know why...
Anyway, the result from my benchmark test, nginx was able to process 4~5 times more requests(10,000 units per sec) as Apache did. it's awesome.
0 comments:
Post a Comment