HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   ISPConfig 3.0.1.4 causes Apache to have too many open files (http://www.howtoforge.com/forums/showthread.php?t=39851)

gkovacs 3rd October 2009 23:34

ISPConfig 3.0.1.4 causes Apache to have too many open files
 
We have encountered a very weird error after installing ISPConfig 3.0.1.4.
Basically it causes Apache/mod_php to create thousands of open files (actually FIFO pipes), and they are staying open until the system runs out.

REFERENCE
On our production servers running ISPConfig 3.0.1.3, lsof |wc-l shows 2-5000 open files, and if traffic is declining this number decreases fast, no problem there.
On newly installed servers with 3.0.1.3, there is no problem.

ERROR
Ou our newly installed server with 3.0.1.4, after clicking through the web interface a couple of times (and maybe some PHPMyAdmin pages as well, to increase load a bit), lsof shows a growth to 10-20000 open files in a minute, and they never close.
After a couple of minutes, the web server slows to a halt and PHP pages do not load anymore.

ENVIRONMENT
We have tested this on several different (freshly installed) servers:

- Ubuntu 8.04 with perfect server setup (OpenVZ)
Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.7

- Debian 5 with perfect server setup (OpenVZ)
Apache/2.2.9 (Debian) PHP/5.2.6-1

The only difference is that on Debian, restarting apache actually closes the open files, while on Ubuntu they are kept open even then.

damir 4th October 2009 15:00

This could be related to OpenVZ, beacuse i can't reproduce it on non vps server and on esxi vps. I'm running multi server setup (ispconfig 3.0.1.4) on debian 5.0.3.

till 5th October 2009 11:45

I'am also not able to reproduce this on my servers. Also the ispconfig interface is basically a normal php script, it is not able to keep files open.

Maybe you use fcgi and have a high number of fcgi children configured. Check the server settings and set fcgi children to 1. You will have to open the settings of your website(s), cahnge a value and and save it to update this setting for a site.

gkovacs 5th October 2009 13:27

First of all, I'm not using FCGI (it's not even installed).
Second, there are no sites, only one that has PHPMyAdmin installed under it for the testing.
Third, the problem does not manifest itself until ISPConfig 3.0.1.4 has been installed.

Basically, the ONLY DIFFERENCE between the working and the problematic server is the version of ISPConfig installed.

This is what I do for every VPS on the host (needed for Pure-FTPD):
Code:

cat >vpscap.sh
VPSID=XXX
for CAP in CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE
do
  vzctl set $VPSID --capability ${CAP}:on --save
done

chmod +x vpscap.sh
./vpscap.sh

And here is what I do before installing ISPConfig:
Code:

apt-get update
apt-get dist-upgrade
apt-get install mc psmisc wget man ftp lsof

apt-get install mysql-client openssl apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap php5-cli
a2enmod suexec rewrite ssl include actions
/etc/init.d/apache2 restart

modprobe capability
echo 'capability' >> /etc/modules
apt-get install pure-ftpd-common pure-ftpd-mysql quota quotatool
echo 'yes' > /etc/pure-ftpd/conf/DontResolve
echo '50000 10' > /etc/pure-ftpd/conf/LimitRecursion

apt-get install vlogger webalizer cron

Are there any Apache or vhost configuration differences between 3.0.1.3 and 3.0.1.4?

till 6th October 2009 11:30

Quote:

Are there any Apache or vhost configuration differences between 3.0.1.3 and 3.0.1.4?
No, nothing has changed in this area.

Please run:

ps aux

and check if you have a high number of php processes.

ezhandossov 7th October 2009 04:37

Quote:

Originally Posted by damir (Post 206425)
This could be related to OpenVZ, beacuse i can't reproduce it on non vps server and on esxi vps. I'm running multi server setup (ispconfig 3.0.1.4) on debian 5.0.3.

Hi! I think I have same problem, but on real server - single server setup (ISPConfig 3.0.1.4) on Debian Lenny.

Problem occurs after some time of working in control panel (if i don't use it everything works fine).

Problem is php get error "Failed to open stream. Too many open files..." while file-nr is about 1000 times smaller than file-max.

damir 7th October 2009 08:19

Are you both running single server or multi server setups?

I'm running multi server setup, with the interface on a signle server and lsof | wc -l stays between 2100 - 2500. I will keep my eye on it during the day to see if it grows.

ezhandossov 7th October 2009 14:21

Quote:

Originally Posted by damir (Post 206665)
Are you both running single server or multi server setups?

I'am new to ISPconfig so I don't clearly undestand this question. If you mean that all SW servers (apache, mysql etc.) runing on the same HW server (PC) than YES I running single server setup. If you mean something different, please explain.

P.S. sorry for my english

till 8th October 2009 10:46

Please post the output of:

ps aux | grep php

ezhandossov 10th October 2009 14:20

Quote:

Originally Posted by till (Post 206793)
Please post the output of:

ps aux | grep php

There is nothing except GREP itself


All times are GMT +2. The time now is 20:25.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.