Urgent Help Needed, getting DUgg and Slashdotted

Discussion in 'Install/Configuration' started by piper, May 21, 2007.

  1. piper

    piper New Member

    I'm getting around 10000 unique/hour at this moment and my server is hardly responding. I'm using Wordpress 2.2

    Here is my setting :

    Max Connections 1400
    Max SSL Connections 200
    Connection Timeout (secs) 150
    Max Keep-Alive Requests 700
    Smart Keep-Alive Yes
    Keep-Alive Timeout (secs) 5
    Send Buffer Size (bytes) 0
    Receive Buffer Size (bytes) 0
    I/O Event Dispatcher poll (All platforms)
    Max Cached Small File Size (bytes) 4096
    Total Small File Cache Size (bytes) 20M
    Max MMAP File Size (bytes) 256K
    Total MMAP Cache Size (bytes) 40M
    Use sendfile() Not Set
    SSL Hardware Accelerator (built-in) OpenSSL internal engine
    Request/Response Edit
    Max Request URL Length (bytes) 8192
    Max Request Header Size (bytes) 16380
    Max Request Body Size (bytes) 10M
    Max Dynamic Response Header Size (bytes) 4K
    Max Dynamic Response Body Size (bytes) 10M


    when i run top -i

    9438 gear 18 0 58456 25m 13m R 26 1.2 0:01.40 lsphp
    9463 gear 19 0 51872 12m 7560 R 22 0.6 0:00.40 lsphp
    9415 gear 19 0 51140 17m 13m R 21 0.9 0:01.80 lsphp
    9442 gear 25 0 56996 21m 12m R 16 1.1 0:00.93 lsphp
    9449 gear 23 0 54928 17m 9.9m R 16 0.9 0:00.68 lsphp
    9464 gear 19 0 51352 10m 6592 R 16 0.5 0:00.30 lsphp
    9439 gear 25 0 57540 23m 13m R 15 1.2 0:01.07 lsphp
    9417 gear 17 0 50864 17m 13m R 14 0.9 0:01.38 lsphp
    9420 gear 17 0 50864 17m 13m R 14 0.9 0:01.46 lsphp
    9426 gear 17 0 50864 17m 13m R 14 0.9 0:01.44 lsphp
    9459 gear 22 0 51092 9292 5740 R 12 0.4 0:00.22 lsphp
    9450 gear 23 0 54928 18m 10m R 11 0.9 0:00.73 lsphp
    9440 gear 22 0 16192 6144 4124 R 8 0.3 0:00.75 lsphp
    9445 gear 23 0 55960 19m 10m R 6 1.0 0:00.78 lsphp
    9447 gear 21 0 53040 14m 8724 R 6 0.7 0:00.50 lsphp
    9428 gear 20 0 58456 25m 13m R 5 1.2 0:01.40 lsphp
    9441 gear 23 0 54080 16m 9316 R 5 0.8 0:00.57 lsphp
    9443 gear 21 0 53040 14m 8604 R 5 0.7 0:00.50 lsphp
    9448 gear 25 0 51352 11m 6828 R 5 0.5 0:00.30 lsphp
    9422 gear 16 0 50084 16m 13m R 4 0.8 0:01.26 lsphp
    9467 slashp 21 0 48596 5116 3516 R 2 0.2 0:00.04 lsphp
    9411 nobody 22 0 8004 4856 1796 R 1 0.2 0:00.21 lshttpd
    9456 root 16 0 1972 1000 764 R 1 0.0 0:00.04 top
    4531 nobody 18 3 26364 22m 11m R 1 1.1 10:11.30 lshttpd
    9432 gear 25 0 57516 23m 13m R 1 1.2 0:01.03 lsphp
    9427 gear 25 0 57256 22m 12m R 0 1.1 0:00.99 lsphp
    9446 nobody 28 3 26364 11m 148 R 0 0.5 0:00.00 lshttpd
    9451 nobody 28 3 26364 11m 148 R 0 0.5 0:00.00 lshttpd
    9452 nobody 28 3 26364 11m 148 R 0 0.5 0:00.00 lshttpd

    Server COnfig

    Dual Xeon 3.0Ghz
    4GB DDR RAm
    2 X 74GB 10k RPM SCSI
    RHEL 4
    Using Litespeed 3.11 Enterprise
    PHP 5.22/APC (latest)
    and LSAPI 4.0

    Please assist , thanks in advanced
  2. mistwang

    mistwang LiteSpeed Staff

    You should use "epoll" instead of "poll" and turn on "sendfile" if you server also serve static files.
    Consider to install wp-cache to avoid generating the page again and agin.
    What is the "max connection" for lsphp? do not set it too large to have your server start to use swap.
  3. piper

    piper New Member

    WP-cache does not work with 2.2, it generates cache but wont serve it

    here is my setting for lsphp

    Max Connections 20
    Environment PHP_LSAPI_MAX_REQUESTS=500
    Initial Request Timeout (secs) 60
    Retry Timeout (secs) 0
    Persistent Connection Not Set
    Connection Keepalive Timeout Not Set
    Response Buffering No
    Auto Start Yes
    Command $SERVER_ROOT/fcgi-bin/lsphp -c /opt/phpconf
    Back Log 100
    Instances 20
    Run On Start Up Not Set
    Max Idle Time Not Set
    Priority 0
    Memory Soft Limit (bytes) 80M
    Memory Hard Limit (bytes) 100M
    Process Soft Limit 250
    Process Hard Limit 250


    Thanks
  4. mistwang

    mistwang LiteSpeed Staff

    Have you tried memcached to cache some part of your page to avoid querying the DB again and again?
    What is your current memory usage as shown in "top" ouput?
    From the real time report of LiteSpeed web console, what's requests/s of your server and lsphp application? Please post the statistic information of lsphp.
  5. piper

    piper New Member

    memory is 3.9GB out of 4Gb being used

    I used APC, can i use them with memcache?

    as for litespeed it's
    Server Load RAM Usage CPU Usage Requests/Sec Traffic In/Sec Traffic Out/Sec
    7.71 31.0MB 3.0% 69 24KB 960KB
  6. mistwang

    mistwang LiteSpeed Staff

    You need to exclue the cache and buffer memory from used memory.
    Do you mean that you use APC as an object cache inaddition to opcode cache?
    If your PHP was built with memcache extension, you should be able to use it.

    I need the lsphp application statistics at the bottom of the report page.
  7. piper

    piper New Member

    APVH_www.xxx.com LSAPI APVH_www.xxx.comSuphp: 10 10 10 10 0 3 14

    Request/second
    99
  8. mistwang

    mistwang LiteSpeed Staff

    You need to increase the "PHP suEXEC max conn" to "20".
  9. mistwang

    mistwang LiteSpeed Staff

    Maybe use "10" for "PHP suEXEC max conn" first, if "WaitQ" is higher than 0 consistently, incarease it to "15" or "20".
  10. piper

    piper New Member

    Thanks fouind it
  11. piper

    piper New Member

    ops, it's worse if i use 15 or 20 :p
  12. mistwang

    mistwang LiteSpeed Staff

    The current value should be "10" already, so try "20", the rule of thumb is to keep "WaitQ" at "0" for the most of the time.
  13. piper

    piper New Member

    okay thanks, now hourly unique becomes 19200, almost doubled from previous and server load is 10.1 but still loadable
  14. mistwang

    mistwang LiteSpeed Staff

    Increased load does not matter much, and it is normal to get higher load when you increase it. There is a sweet spot somewhere. Just do not overtune it.
    That's pretty much what can be done from litespeed side, you can continue to improve your PHP script in order to get better performance out of it. :)
  15. piper

    piper New Member

    Thanks for the help, i really appriciate it :)

Share This Page