Hello !

Using cherokee 1.0.1 with php 5.3.0 with php-fpm using mysql through
php-mysql/mysqlnd.
After moving cherokee from UNIX-sockets to TCP port 9000, seeing
cherokee creating lots and lots (to the amount of total requests) of
connections to php-fpm port 9000 when doing benchmarking.
Is that the FastCGI spec ?
The php that is served only does mysqli_connect("p:dbname",u,p,db)/
benchmarking with weighttp gives ~2000req/s when doing 300 concurrent
connections, but looking at netstat, you can see that the connections
are being backlogged (number of connections grows nearly to the number
of total requests done). Benchmarking with more concurrent connections
fills up the backlog faster and completely stalls the server and
execution, since the server has to deal with lots of TIME_WAIT
connections. Also, it seems that the file-descriptor limit set in
cherokee.conf is being imposed here, thus, cherokee having ~1000
client connections and additional ~39000 php-fpm connections brings
the total to 40000 which is the limit in the local config here.

Is this a known behavior ?
This might also be the problem with the UNIX sockets - if cherokee
tries to open 40000 connections to UNIX sockets stuff will go bad...

Benchmark cmdline:
weighttp -k -c 2000 -n 16000 <url>

...at some point about 4 seconds into the benchmark..
r...@solid:~# netstat -an|wc -l
16288

p.s. Behavior with UNIX sockets is a bit better, until it goes to
200%. The benefit of UNIX sockets here is that they don't have
TIME_WAIT state which takes up from the fd limit and might affect
epoll_wait performance of cherokee.
Setting tcp_tw_reuse doesn't help. Setting tcp_tw_recycle helps
immediately but eventually over 60% of the connections get dropped.

References:

Weighttp = http://redmine.lighttpd.net/projects/weighttp/wiki

php file (doesn't have error checking as the error was checked for before):
<?php
$link = mysqli_connect('p:localhost','user','pass','tests');
//printf("Host info: %s\n", mysqli_get_host_info($link));
echo test_echo;
?>
_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to