Jump to content

Board slow when I have many members and Apache


Recommended Posts

Posted

Hello ! :-)

I've noticed that my board is very slow when I have about 900 users online and the server load is about 4 (sometimes it's about 2, sometimes it's about 6).
How far is Apache responsible for this ?
Is there something which can be done, regarding Apache, to make the board faster ?
What are the settings which can be tweaked in Apache to make the board faster ?

Here are the settings I use in httpd.conf :

ServerSignature off
ServerTokens Full
FileEtag All
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 25000
MaxKeepAliveRequests 50
KeepAliveTimeout 10

Thank you ! :-)

Posted

Hello ! :)

My server is a 64 bit Bi Xeon Quad 8x 2.33+ with 16GB RAM and two 1TB HDD (RAID), with :
Apache 2.0.63
PHP 5.2.9
MySQL 5.0.89
EAccelerator
Sphinx as the search engine.

  • 2 weeks later...
Posted

Increase:

MinSpareServers 20
MaxSpareServers 50

You can also switch Apache to a lightweight webserver, like litespeed.

  • 2 weeks later...
Posted

Increase:



MinSpareServers 20


MaxSpareServers 50



Hello ! :)

It seems like this didn't change anything... I still had to wait for 20 or more seconds to show a new page on my board.

Then, I modified KeepAliveTimeout and set it to 3. Now my site is running much faster...

What do you think of it ?

Thank you ! :)
Posted

Why don't you place nginx in front of apache to serve static content and proxy only dinamic content (php files)?

With this setup you can lower MaxClients and turn off keepalive.

You should also check you mysql comfiguration with mysqltunner.

Yahoo have some good articles that can help:
http://developer.yahoo.com/performance/rules.html

Posted

You should ask a sysadmin to do it.
Your community will see a great improvement with this settings without any investment in hardware ... just tweaking some configurations files.
The big difference of using this architecture is that your apache just serves php files to nginx and don't need to wait for the client.
For serving images and static files, its a huge waste of resources if you use apache because each process eats ~20/30 MB of memory.
I have a small board (10.000 page view per day) in a VPS with 360RAM with 250/300 members online.

Posted

If you use KeepAlive On the timeout should be set to 1 or 2 - Any higher and you will see a huge speed loss.

Also you said 900 users so why is your MaxClients set that low ?

MaxClients 500
MaxRequestsPerChild 10000
KeepAlive 1
MinSpareServers 5
MaxSpareServers 15

Posted

Hello ! :-)

I'm trying these settings. I get this message regarding MaxClients :

Value (500) is over the limit (256), using previously saved value (if any) or default (150)



According to what I've read, I also need to raise ServerLimit to 500 too ?

Edit : I've used WHM, Apache Configuration, Include Editor and wrote at the beginning : ServerLimit 500

Thank you ! :)
Posted

Well... In httpd.conf, I found this :

<IfModule prefork.c>


ServerLimit 2000


</IfModule>



I'm using WHM/CPanel and I need to make the edits in WHM to make sure they will be kept when WHM is upgraded...

As for the modifications, I put them in the post_virtualhost_global.conf file using the WHM Include Editor. The post_virtualhost_global.conf values are the one which will be used.
Posted

Based on your stats I would put it to:

<IfModule prefork.c>
StartServers 5
MinSpareServers 5
MaxSpareServers 15
MaxClients 150
MaxRequestsPerChild 1000
</IfModule>

What apache are you using ?
Also what modules are added on the apache.

Posted

Hello ! :)

Here is what I have :

HG09 BestOf Bi Xeon Quad 8x 2.33+ with16GB RAM
Apache 2.0.63
PHP 5.2.9
MySQL 5.0.89

With the settings you gave me :

MaxClients 500


MaxRequestsPerChild 10000


KeepAlive 1


MinSpareServers 5


MaxSpareServers 15



The server is doing much much better :
- it's fast (used to be very slow)
- the server load is lower (sometimes I have it being higher than it is usually).
- it seems like MySQL is no longer reaching high CPU usage figures ( I published a topic about it here http://community.invisionpower.com/topic/311629-problems-with-mysql-with-more-than-900-users-online ).

Anyway I got a high server load tonight (which was the reason why I got interested in Apache because problems happened after mod_ssl was installed) and PRM restarted httpd :

Time: Fri Jun 11 20:51:26 2010 +0200



1 Min Load Avg: 15.20



5 Min Load Avg: 6.70



15 Min Load Avg: 3.67



Running/Total Processes: 4/630






I published Information about the problem which occured here : http://www.andrejorg.../divers/server/

So something is still wrong.

Here is the modules list :

core mod_access mod_auth mod_include mod_log_config mod_logio mod_env mod_expires mod_headers mod_setenvif mod_proxy proxy_connect proxy_ftp proxy_http mod_ssl prefork http_core mod_mime mod_status mod_autoindex mod_asis mod_info mod_suexec mod_cgi mod_negotiation mod_dir mod_imap mod_actions mod_userdir mod_alias mod_rewrite mod_so mod_auth_passthrough mod_bwlimited mod_fpcgid mod_php5



Thank you very much. :)
Posted

What apache are you using ?

If you say, Im on FastCGI - with Mod_FCGI module enabled then to me it seems like the spawns are not killing fast enough, As those settings I gave DID proove to be quicker and affective but something is staying open.

Please check the apache so we know what your dealing with.

Posted

My server crashed again today. I simply notice that the number of tasks is higher than usually (between 450 and 500) the server load rises and it ends with httpd being stopped by PRM.
In fact, this happens each time I set Maxclients to a high figure. It was 500, so I set it now at 250...

Posted

I had a similar problem.

It had to do with the fact that Eaccelerator does not work well with some servers/configurations combined with IPB.

I changed it to Xcache and - Voila - all is working perfectly.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...