Author |
|
sawo
Joined: 15 May 2008 Posts: 36
|
Posted: Tue 13 Jan '09 13:57 Post subject: Apache slows down when reaching 600 connections |
|
|
Hi everyone, im looking for help again
Ok first here is my setup:
Software:
Win Server 2008 64bit
Apache 2.2.8
#No Antivirus software, just the windows firewall enabled (disabled doesnt help also).
Hardware:
C2 Quad 3,4GHz
4Gb DDR2 1066
100Mb link
I have the following problem:
When many clients start downloading from the server (10-20mbit network load) the apache server starts responding very slow (over 30-60s load times)
I tried several things to locate the problem:
First i tried to connect from the loopback connection (127.0.0.1) to eliminate the network element and i was still unable to open the website.
I tried to increase the maxthreadsperchild to alot more than is needed and i ended up with httpd.exe using almost 500mb RAM, but the website was still down.
Then i turned ExtendedStatus to on and i saw that every time i check the connected clients they are exactly 600 - no more or less. All of them download files from a folder with large files so the problem cant be in some scripts or something like that.
No matter what i try, i cant get apache to accept more than 600 connections.
This is what i see in the server status:
Code: | Parent Server Generation: 0
Server uptime: 13 hours 23 minutes 14 seconds
Total accesses: 1072332 - Total Traffic: 597953.1 GB
22.3 requests/sec - 417.0 MB/second - 0.6 GB/request
189 requests currently being processed, 411 idle workers |
The machine itself is not loaded at all - 0-5% cpu usage, 1-2MB disk usage, 10-20mbit network usage, 100-200 hard faults |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
|
Back to top |
|
sawo
Joined: 15 May 2008 Posts: 36
|
Posted: Tue 13 Jan '09 18:51 Post subject: |
|
|
I adjuisted the value to a higher number, but apache crashes when reaching 512MB memory usage. Right now i have almost 500MB usage with 600 threads (i just got back to home and checked the config) Is there any reason why apache crashes? I have almost 2Gb free memory.
edit: actually httpd.exe crashes at around 531mb, but its about the same |
|
Back to top |
|
sawo
Joined: 15 May 2008 Posts: 36
|
Posted: Tue 13 Jan '09 19:11 Post subject: |
|
|
I just checked the error log and when apache reaches ~536MB of memory usage i got this error:
Code: | (a bunch of garbage text, displayed as [null] in notepad++)Cannot initialize zend_mm storage [win32]
[Tue Jan 13 19:04:12 2009] [notice] Parent: child process exited with status 255 -- Restarting.
PHP Warning: PHP Startup: Unable to load dynamic library 'D:/AppServ\\php5\\ext\\php_exif.dll' - The specified module could not be found.\r\n in Unknown on line 0
[Tue Jan 13 19:04:12 2009] [notice] Apache/2.2.11 (Win32) PHP/5.2.6 configured -- resuming normal operations
[Tue Jan 13 19:04:12 2009] [notice] Server built: Dec 10 2008 00:10:06
[Tue Jan 13 19:04:12 2009] [notice] Parent: Created child process 4452
[Tue Jan 13 19:04:12 2009] [notice] Disabled use of AcceptEx() WinSock2 API
PHP Warning: PHP Startup: Unable to load dynamic library '...\\php5\\ext\\php_exif.dll' - The specified module could not be found.\r\n in Unknown on line 0
[Tue Jan 13 19:04:12 2009] [notice] Child 4452: Child process is running
[Tue Jan 13 19:04:12 2009] [notice] Child 4452: Acquired the start mutex.
[Tue Jan 13 19:04:12 2009] [notice] Child 4452: Starting 1000 worker threads.
[Tue Jan 13 19:04:12 2009] [notice] Child 4452: Listening on port 80. |
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Tue 13 Jan '09 19:15 Post subject: |
|
|
ok You should comment out the php_exif.dll in php.ini cause is does not run.
I think the most memory usage is from PHP. Do you use PHP software? If yes you should think about using PHP over fcgi and not as module.
Did you have problem with your socket or why are you using Win32DisableAcceptEx ? |
|
Back to top |
|
sawo
Joined: 15 May 2008 Posts: 36
|
Posted: Tue 13 Jan '09 19:51 Post subject: |
|
|
the exif error is from long time ago and i dont think it causes problems except for this message. Im using php for simple welcome page, nothing big and there is almost no traffic from the front page - everything comes directly from downloading from an apache directory.
Im using disableacceptex because sometimes i get errors in the log, on almost all OS'es i've been using - from xp to server 2003 and now 2008. I just keep this command to be sure as apache suggests. Ofcourse i tried to disable this option, but its still the same. |
|
Back to top |
|
sawo
Joined: 15 May 2008 Posts: 36
|
Posted: Wed 14 Jan '09 14:56 Post subject: |
|
|
Well i was unable to resolve this problem using the 32bit version of apache. I decided to install 64bit apache + 64bit php & mysql. Now my server can easily handle 1000 and more connections
I will consider using php over cgi to save up some memory.. |
|
Back to top |
|
AMailer
Joined: 25 Sep 2006 Posts: 45 Location: Canada
|
Posted: Sat 17 Jan '09 20:28 Post subject: |
|
|
I'm having load issues with Apache going over 1,000 + connections as well. However, I cannot use 64bit apache because of the MSSQL library (can't use ODBC).
What does your config look like? |
|
Back to top |
|