Apache restart causing problems

huan

Verified User
Joined
Mar 7, 2005
Messages
30
Location
Poland
Every now and then when Directadmin restarts Apache in order to update httpd.conf the server is unavailable for a few minutes. The same is when I use 'service httpd restart'. The server needs few minutes for loading all users httpd.conf files (almost 300 files). This is getting very irritating for my customers. Is there any possibility to speed up the restart process.

I remember that in CPanel where all data are in one httpd.conf file the restart was taking only few seconds with similar load and similar number of sites.

The server is Dual Xeon, 4GB RAM and CentOS 4
 
I've the same problem on FreeBSD.

I discovered that it's releated to my FreeBSD=>5.3 versions upgrade. I remember it was OK on the earlier FreeBSD versions (like FreeBSD 5.2). Maybe file handling performance was better in older versions.

I've removed /usr/local/etc/rc.d/httpd script and now I am restarting apache within my own script once a day in the night.

It will be nice to speedup Apache restart and come back to live reloads. Anyone with ideas?
 
Hello,

When you restart apache by hand via ssh.. what do you see and how long does it last?

The httpd restart scripts have a "counter" that checks to make sure all httpd processes have stopped before trying to restart it. If not, it waits 1 second, recounts and checks again.

Try running the restart manually to see if it's maybe stucking waiting for a child process that isn't quitting.

John
 
Hello,

I'm sure what I mean. It's not caused by counter. For example "apachectl configtest" is as slow as start.

There is performance problem when you have a lot of virtualhosts - Apache start is very slow, because it needs to include all user httpd.conf files. Scanning these all files is very very slow when there are hundreds users on server.

I don't know how to resolve it. I guess DirectAdmin should be rewritten to keep one httpd.conf file. This seems to be OS-independend. I've this issue on FreeBSD, Przemek on CentOS.

sysadm
 
Your suggestion has it's own set of problems because a huge monolithic file would have to be completely rebuilt every time a domain was added, deleted, or changed.

Jeff
 
Back
Top