php - Connections not closing with Apache's worker MPM and mod_php -


first off, know questionable setup, performance of fastcgi or fcgid force me give shot. problem load testing never completes due connections not closing. when push 40 concurrent connections, things go south - connections sit in established state several minutes:

netstat -an|awk '/tcp/ {print $6}'|sort|uniq -c       1 close_wait      72 established       8 listen 

then after several minutes, split mix of close_wait , established:

netstat -an|awk '/tcp/ {print $6}'|sort|uniq -c      41 close_wait      32 established       8 listen 

and after 10 more minutes, has not changed. these combo of client web server, , web server mysql server. if test against php page not make mysql connection, works normally.

i custom-compiled php (configure below), , installed apache-mpm-worker via apt-get (ubuntu 10.04). i've tried compiling php both msyql_config , mysqlnd mysql, mysqli , pdo modules. non-thread safe library rearing it's ugly head?

./configure --prefix=/usr/local --with-apxs2=/usr/bin/apxs2 --disable-cgi --with-layout=gnu --with-config-file-path=/etc/php5/apache2 --with-config-file-scan-dir=/etc/php5/apache2/conf.d --disable-ipv6 --without-kerberos --with-pcre-regex=/usr --with-zlib --with-zlib-dir=/usr --enable-bcmath --with-bz2 --enable-calendar --enable-ctype --with-curl=shared,/usr --without-qdbm --without-gdbm --with-db4 --with-libxml-dir=/usr --enable-exif --disable-ftp --with-gd=shared,/usr --enable-gd-native-ttf --with-gmp=shared,/usr --with-jpeg-dir=shared,/usr --with-xpm-dir=shared,/usr/x11r6 --with-png-dir=shared,/usr --with-freetype-dir=shared,/usr --with-gettext --with-mhash=shared,/usr --with-ldap=shared,/usr --with-ldap-sasl=/usr --with-mcrypt=shared,/usr --enable-mbstring --without-msql --without-mssql --with-pspell=shared,/usr --without-mm --disable-shmop --enable-soap --enable-sockets --with-regex=php --disable-sysvshm --disable-wddx --with-xmlrpc=shared --with-iconv --with-xsl=shared,/usr --enable-zip --with-pear=/usr/share/php --with-tsrm-pthreads --enable-maintainer-zts --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=myslqnd --with-libdir=lib64

one solution worked me add following flag apache setup (i dont use repo's):

export cflags=-dno_lingclose ./configure ... 

this forced apache close socket when fin packet received peer.

by default, apache put socket close_wait after peer sends fin. @ time, socket considered half closed awaiting fin local peer, done ending application. apache default allows time out, 2-5 minutes depending on setup.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -