Results 1 to 12 of 12
  1. #1
    Join Date
    Apr 2004
    Location
    Atlanta, GA
    Posts
    541

    Apache httpd.conf optimization?

    Is there a script that will check the httpd.conf and give optimization suggestions?

    Dedicated server with a large community site and a few small smile site., lots of videos and images. Mysql has been optimized with tuning-primer.sh

    REDHAT Enterprise 5.4 i686
    Server Version: Apache/2.2.13 (Unix)
    Xeon 3360 4gb ram 2 x 300gb 10k SAS hdd

  2. #2
    Join Date
    Aug 2000
    Posts
    2,750
    What is your current apache config like ?

  3. #3
    Join Date
    Aug 2009
    Location
    Essex, UK
    Posts
    30
    If performance is a big concern and you don't use the advanced features of apache, it can also be worth switching to another http server, I use lighttpd on some of my machines, still supports all the usual stuff 99.5% of us need. nginx is another, I haven't used it myself but it manages some of the busiest sites sites on the web.

  4. #4
    Join Date
    Apr 2004
    Location
    Atlanta, GA
    Posts
    541
    Quote Originally Posted by GeekSRV View Post
    What is your current apache config like ?
    this is my current settings. i have a lot of proccess for /usr/local/apache/bin/httpd -k start -DSSL

    should i lower my timeout?

    <IfModule mpm_prefork_module>
    StartServers 5
    MinSpareServers 5
    MaxSpareServers 10
    MaxClients 150
    MaxRequestsPerChild 0
    </IfModule>
    Timeout 150
    KeepAlive Off
    MaxKeepAliveRequests 100
    KeepAliveTimeout 5
    UseCanonicalName Off
    ServerTokens Minimal
    ServerSignature Off
    HostnameLookups Off

  5. #5
    Optimization for what would you want?
    - Save server memory?
    - Need faster response speed?
    - Reduce CPU load?
    Point Red from IIJ America- pointred.us -
    Reliable/High Quality and Performance Xen VPS/Hybrid Hosting
    Reliable ISP Networks experts are monitoring 24/7
    VPS/Hybrid/Shared/Dedicated Available

  6. #6
    Join Date
    Apr 2004
    Location
    Atlanta, GA
    Posts
    541
    Quote Originally Posted by Point Red View Post
    Optimization for what would you want?
    - Save server memory?
    - Need faster response speed?
    - Reduce CPU load?
    all my sites are optimized for speed, so right now CPU speed... I need to lower the Load Average right now. it's a 2.90 after restarting Apache but prior I was at 150+ which resulted in no sites load/loading slow.

  7. #7
    Join Date
    Aug 2009
    Location
    Essex, UK
    Posts
    30
    You need to see whats causing that high load average, have a look using top. The 3rd line down beginning Cpu(s) has various metrics to indicate whats going on, the the %us and %sys values will give an idea of how busy the cpu is with running user and system tasks, the %wa gives an indication of the disk load, which could well be high. You could try enabling keep alive to keep the spare server processes apache has running (saves it having to start new ones after a connection arrive, reducing a delay) but if you're busy enough, most probably wont get many chances to die anyway. If on the other hand the disk load is the issue, then things such as caching will give the biggest improvement.

  8. #8
    150?
    Which are you talking about "MaxClients 150" or "Timeout 150" ?

    If you decrease Timeout value, I think you'll get more high load-ave.
    But if you want to reduce memory usage.
    And you also can reduce child processes of the apache.

    If you decrease MaxClients value, your apache will use more memory
    but maybe you can reduce CPU load.
    Last edited by Point Red; 10-08-2009 at 02:05 PM. Reason: tyPo
    Point Red from IIJ America- pointred.us -
    Reliable/High Quality and Performance Xen VPS/Hybrid Hosting
    Reliable ISP Networks experts are monitoring 24/7
    VPS/Hybrid/Shared/Dedicated Available

  9. #9
    a little correction...

    If you decrease MaxClients value, your apache will use more memory
    but maybe you can reduce CPU load.
    But if you're using heavy CGI/PHP script, it will not help reducing CPU Load...
    Point Red from IIJ America- pointred.us -
    Reliable/High Quality and Performance Xen VPS/Hybrid Hosting
    Reliable ISP Networks experts are monitoring 24/7
    VPS/Hybrid/Shared/Dedicated Available

  10. #10
    Join Date
    Apr 2004
    Location
    Atlanta, GA
    Posts
    541
    Quote Originally Posted by phillu View Post
    You need to see whats causing that high load average, have a look using top. The 3rd line down beginning Cpu(s) has various metrics to indicate whats going on, the the %us and %sys values will give an idea of how busy the cpu is with running user and system tasks, the %wa gives an indication of the disk load, which could well be high. You could try enabling keep alive to keep the spare server processes apache has running (saves it having to start new ones after a connection arrive, reducing a delay) but if you're busy enough, most probably wont get many chances to die anyway. If on the other hand the disk load is the issue, then things such as caching will give the biggest improvement.
    this is what my stats look like right now.
    http://i34.tinypic.com/j17uo0.jpg

  11. #11
    Join Date
    Aug 2009
    Location
    Essex, UK
    Posts
    30
    Curious that the si value is so high, something is generating a lot of interrupt requests, having just checked a few of my machines, some under heavy load, others quite bored, none are that high. Have you checked your apache logs to see whats going on and ensuring there are no faults occuring? likely in either /var/log/httpd or /var/log/apache depending on your distro. Might also be worth logging into mysql and issuing a show processlist a few times see if there are any ugly queries lasting forever. There is also the mysql slow query log, but as is often the case when suffering with performance, the last thing you can afford to do is enable more logging, but then you can't really afford not to either.

  12. #12
    Join Date
    Oct 2007
    Location
    India
    Posts
    67
    Hello ,

    See the PID 24434 is taking 99 % CPU Also Mysql is loaded . So basically load issue on your server will be due to this particular site . See if this entry is due to the large website you mentioned . you can find it out by going to

    cd /proc/PID and do and ls -la and see which is the user ( site ) causing load ..
    if no info is found go to the cwd idrectory in it and do a ls -la and see if that helps . if it is some other website rather than the main site check the apache error log to see what is the issue with that site .

    a simultaneos mysqadmin proc command on another terminal will help to understand the issue better ..
    Last edited by alanzkorner; 10-08-2009 at 03:22 PM. Reason: pid num mistake
    Regards,
    Alan John

Similar Threads

  1. apache 2 - httpd.conf
    By tomazo in forum Dedicated Server
    Replies: 12
    Last Post: 09-15-2008, 08:56 PM
  2. Apache 2.2 and httpd.conf
    By azn_romeo_4u in forum Hosting Security and Technology
    Replies: 2
    Last Post: 03-06-2008, 07:37 AM
  3. Need help with Apache httpd.conf
    By realrena in forum Hosting Security and Technology
    Replies: 4
    Last Post: 11-10-2007, 04:29 PM
  4. apache 2 host.conf optimization
    By jagsinc in forum Hosting Security and Technology
    Replies: 5
    Last Post: 01-31-2005, 12:41 AM
  5. editing the /apache/conf/httpd.conf in Cpanel by any user?
    By Ironlung in forum Web Hosting Lounge
    Replies: 0
    Last Post: 11-09-2001, 02:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •