Results 1 to 24 of 24

Thread: Apache tweaking

  1. #1
    Join Date
    Dec 2002
    Location
    USA
    Posts
    62

    Apache tweaking

    Not sure if this is the right forum, but here is goes. I would like some help with my apache settings. 15MB per conection is quite a bit.

    Code:
    17:35:50  up  1:19,  2 users,  load average: 45.04, 34.27, 29.56
    350 processes: 318 sleeping, 29 running, 3 zombie, 0 stopped
    CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle
               total   85.3%    0.0%   12.8%   0.5%     1.2%    0.0%    0.0%
               cpu00   81.1%    0.0%   13.4%   2.1%     3.2%    0.0%    0.0%
               cpu01   86.3%    0.0%   13.3%   0.0%     0.2%    0.0%    0.0%
               cpu02   85.9%    0.0%   13.1%   0.0%     0.8%    0.0%    0.0%
               cpu03   87.9%    0.0%   11.3%   0.0%     0.7%    0.0%    0.0%
    Mem:  2055384k av, 2035400k used,   19984k free,       0k shrd,   22532k buff
                       1566560k actv,  297500k in_d,   29888k in_c
    Swap: 2040212k av, 1005964k used, 1034248k free                  135884k cached
    
      PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND
     6670 nobody    16   0 22416  20M  1088 R     4.4  1.0   0:29   3 httpd
     6545 nobody    16   0 22464  20M  1112 R     4.3  1.0   0:46   0 httpd
     7236 nobody    16   0 15444  14M  1228 R     3.5  0.7   0:06   1 httpd
     7261 nobody    15   0 12160  10M  **** S     2.9  0.5   0:04   1 httpd
     6622 nobody    16   0 73908  70M  1044 S     2.8  3.5   0:21   3 httpd
     6571 nobody    15   0 11588  10M  1300 S     2.6  0.5   0:24   0 httpd
     6569 nobody    16   0 17520  16M  1060 D     2.4  0.8   0:36   2 httpd
     6692 nobody    16   0 16296  14M  1092 S     2.2  0.7   0:41   3 httpd
     6972 nobody    16   0 17356  15M  1080 R     2.1  0.7   0:24   1 httpd
     7207 nobody    15   0 15484  14M  1116 S     2.0  0.7   0:05   0 httpd
     6973 nobody    16   0 11688  10M  1088 S     1.7  0.5   0:17   0 httpd
     7234 nobody    16   0 16100  14M  1092 R     1.7  0.7   0:06   2 httpd
     7262 nobody    16   0 14532  13M  1456 S     1.7  0.6   0:06   0 httpd
     6561 nobody    16   0 15072  13M  1092 R     1.6  0.6   0:34   3 httpd
     6634 nobody    15   0 17256  15M  1080 S     1.6  0.7   0:33   0 httpd
     7243 nobody    15   0 12132  10M  1428 S     1.6  0.5   0:04   1 httpd
     6564 nobody    17   0 26292  17M  1080 R     1.4  0.8   0:40   2 httpd
     6583 nobody    15   0 15908  14M  1076 S     1.4  0.7   0:37   1 httpd
     6671 nobody    16   0 17976  16M  1076 S     1.4  0.8   0:25   2 httpd
     7252 nobody    15   0 10348 9388  1752 S     1.4  0.4   0:03   1 httpd
     7335 nobody    16   0 18636  17M  1860 S     1.4  0.8   0:03   3 httpd
     6572 nobody    16   0 73872  23M  1064 S     1.3  1.1   0:30   0 httpd
     6993 nobody    16   0 16824  11M  1064 S     1.3  0.5   0:18   2 httpd
     7003 nobody    16   0 16432  14M  1288 S     1.3  0.7   0:17   1 httpd
     7211 nobody    15   0  8364 7416  1120 S     1.3  0.3   0:07   0 httpd
     7310 nobody    15   0 16460  15M  1672 S     1.3  0.7   0:04   2 httpd
     6705 nobody    16   0 17088  14M   900 S     1.2  0.7   0:40   0 httpd
     6663 nobody    16   0 15420  13M  1088 S     1.1  0.6   0:22   2 httpd
     7244 nobody    18   0 18064  16M  1136 R     1.1  0.8   0:05   1 httpd
     7008 nobody    15   0 16688  15M  1344 S     1.0  0.7   0:20   2 httpd
     7353 nobody    15   0 10036 9060  1844 S     0.9  0.4   0:00   3 httpd
     6974 nobody    17   0 27284  25M  1320 R     0.8  1.2   0:15   3 httpd
     7221 nobody    16   0 15884  14M  1432 S     0.8  0.7   0:04   3 httpd
     7341 nobody    15   0  9752 8784  1856 S     0.8  0.4   0:00   3 httpd
     6631 nobody    15   0 19144  17M  1036 S     0.7  0.8   0:42   0 httpd
     6668 nobody    16   0 18992  17M  1288 S     0.7  0.8   0:39   0 httpd
     6696 nobody    17   0 17472  15M  1076 R     0.7  0.7   0:27   2 httpd
     7220 nobody    17   0 16016  14M  1088 R     0.7  0.7   0:07   2 httpd
     7240 nobody    17   0 19476  18M  1112 R     0.7  0.9   0:05   3 httpd
     7269 nobody    18   0 18164  16M  1236 R     0.7  0.8   0:06   0 httpd
     6577 nobody    16   0 12976  11M  1768 R     0.6  0.5   0:24   1 httpd
     6629 nobody    15   0 18824  17M  1180 S     0.6  0.8   0:27   3 httpd
       12 root      15   0     0    0     0 SW    0.5  0.0   0:39   2 kscand
       11 root      15   0     0    0     0 SW    0.4  0.0   0:25   0 kswapd
     6557 nobody    16   0  9960 8848  1088 R     0.4  0.4   0:29   0 httpd

  2. #2
    Your using a lot of Swap there

  3. #3
    Join Date
    Nov 2004
    Location
    Miami FL
    Posts
    288
    add ram and remove un needed objects from http.conf

  4. #4
    Join Date
    Sep 2004
    Location
    Flint, Michigan
    Posts
    5,766
    =/ Adding ram is not the end all solution. I could write a simple 5 line program that could eat 4GB of ram. First try and fix the problem in your configuration, then if all else fails, add ram.

    What's your current httpd.conf settings?
    Mike from Zoodia.com
    Professional web design and development services.
    In need of a fresh hosting design? See what premade designs we have in stock!
    Web design tips, tricks, and more at MichaelPruitt.com

  5. #5
    Join Date
    Dec 2002
    Location
    USA
    Posts
    62
    RLimitMEM 151458048
    RLimitCPU 240
    Timeout 300
    KeepAlive Off
    MaxKeepAliveRequests 100
    KeepAliveTimeout 15
    MinSpareServers 10
    MaxSpareServers 20
    StartServers 5
    MaxClients 160
    MaxRequestsPerChild 15000

  6. #6
    Try to make MaxRequestsPerChild 50

  7. #7
    Join Date
    Dec 2002
    Location
    USA
    Posts
    62
    That still doesnt help much

  8. #8
    Try reducing your MaxClients to 100 if you can.

    Also try

    MinSpareServers 15
    MaxSpareServers 25
    StartServers 5


    Restart httpd

  9. #9
    Making the max to 100 people would then not allow anyone else from viewing your website, so I'm not sure you wanna do that...

    Also, your load seems very high.. What are you running and are you sure this isn't more of a DDoS?

  10. #10
    Join Date
    Dec 2002
    Location
    USA
    Posts
    62
    No its not a DDoS. I know what is making all the traffic on the server, and if I change the name of the directory the load will goto 0.20

  11. #11
    What is causing the load

  12. #12
    Join Date
    Mar 2004
    Location
    Greater Chicagoland
    Posts
    181
    If your using PHP then re-configure it enabling only the options that you are using, then re-compile it. Next re-configure Apache disabling any modules that your are not using then re-compile Apache. This can greatly reduce the size of your executable and overall load.

  13. #13
    Join Date
    Dec 2002
    Location
    USA
    Posts
    62
    only php options i have are:

    BC Math
    FTP
    Magic Quotes
    MySql module
    Discard Path
    Pear
    Track Vars
    Zlib

  14. #14
    Join Date
    Dec 2002
    Location
    USA
    Posts
    62
    Originally posted by Duport
    What is causing the load
    A busy gallery script

  15. #15
    Join Date
    Apr 2001
    Location
    FL, USA
    Posts
    949
    I often see ram issues with PHP. I am not sure if PHP leaks or if simple processes get hung. How many connections do you have stuck in TIME_WAIT?

    We save you time, money, and frustration by handling the server management tasks required to run an online business successfully.
    No prodding required. We just do it right the first time. Red Hat, MySQL, Plesk, and cPanel certified staff.

  16. #16
    Join Date
    Dec 2002
    Location
    USA
    Posts
    62
    where can I see the TIME_WAIT number?

  17. #17
    Look in the config

  18. #18
    Join Date
    Apr 2001
    Location
    FL, USA
    Posts
    949
    run
    netstat -anp|grep TIME_WAIT

    We save you time, money, and frustration by handling the server management tasks required to run an online business successfully.
    No prodding required. We just do it right the first time. Red Hat, MySQL, Plesk, and cPanel certified staff.

  19. #19
    Join Date
    Dec 2002
    Location
    USA
    Posts
    62
    I searched both httpd.conf and php.ini and there is no TIME_WAIT listing.

    netstat -anp|grep TIME_WAIT displays a very long list of IP address. I can't scroll up faw enough to view them all with PuTTY.

  20. #20
    Join Date
    Apr 2001
    Location
    FL, USA
    Posts
    949
    TIME_WAIT means that the connection is waiting for the client to send back data. I see this often on php/mysql sites. The pages are loading slowly, the client leaves the site/page and the connection hangs. This can also result from poor php coding. Lowering your timeout and disabling keepalives can help this situation but it takes a lot more digging to find and reduce/eliminate the cause. Every TIME_WAIT you see is most likely tied to an apache process, which will slow everything down.

    We save you time, money, and frustration by handling the server management tasks required to run an online business successfully.
    No prodding required. We just do it right the first time. Red Hat, MySQL, Plesk, and cPanel certified staff.

  21. #21
    Join Date
    Dec 2002
    Location
    USA
    Posts
    62
    I just changed my Timeout from 300 to 90 in httpd.conf

  22. #22
    Join Date
    Sep 2002
    Location
    Behind your monitor.
    Posts
    569
    Originally posted by jonMEGA
    I just changed my Timeout from 300 to 90 in httpd.conf
    And did that fix it or was it something else?
    GlowHost → Affordable Managed Web Hosting Since 2002.
    ۪Cloud Servers- Hot Failover + Clustered Storage
    ¬Managed Dedicated Servers - Semi-Dedicated Servers
    ۪Shared & Reseller packages - 20 Min Ticket Response - 24/7/365 Phone & Live Chat

  23. #23
    Join Date
    Jan 2005
    Posts
    2,203
    is it a good idea to disable KeepAlive ?? I saw many posts saying to disable it.

  24. #24
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    5,073
    ya, turn off keepalive, it saves a lot of headaches.

    timeouts are a waste to even have at 90, try like 15. Also install mmcache/eaccelerator

    if it's possible to make the images go off a different domain when linked, you could install something like THTTPD on another port, and have it work out of hte image folder for it.

    This would cut your loads down a LOT.

    ~Francisco
    BuyVM - OpenVZ & KVM Based VPS Servers - Chat with us
    - All popular VPN methods supported
    - Affordable offloaded MySQL & DDoS protection
    - 5GB backup space, unmetered private LAN bandwidth & native IPv6 included. All with a strong serving of pony

Posting Permissions

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