logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache slows down when reaching 600 connections
Author
sawo



Joined: 15 May 2008
Posts: 36

PostPosted: Tue 13 Jan '09 13:57    Post subject: Apache slows down when reaching 600 connections Reply with quote

Hi everyone, im looking for help again Smile

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

PostPosted: Tue 13 Jan '09 16:37    Post subject: Reply with quote

You can adjust this with ThreadsPerChild

So you maybe use
Code:

ThreadsPerChild 1000


for 1000 Connections


http://httpd.apache.org/docs/2.2/mod/mpm_common.html#threadsperchild
Back to top
sawo



Joined: 15 May 2008
Posts: 36

PostPosted: Tue 13 Jan '09 18:51    Post subject: Reply with quote

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

PostPosted: Tue 13 Jan '09 19:11    Post subject: Reply with quote

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

PostPosted: Tue 13 Jan '09 19:15    Post subject: Reply with quote

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

PostPosted: Tue 13 Jan '09 19:51    Post subject: Reply with quote

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

PostPosted: Wed 14 Jan '09 14:56    Post subject: Reply with quote

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 Smile
I will consider using php over cgi to save up some memory..
Back to top
AMailer



Joined: 25 Sep 2006
Posts: 45
Location: Canada

PostPosted: Sat 17 Jan '09 20:28    Post subject: Reply with quote

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


Reply to topic   Topic: Apache slows down when reaching 600 connections View previous topic :: View next topic
Post new topic   Forum Index -> Apache