[solved] Website loading become slow when at busy time

Discussion in 'General' started by ericknichos, Sep 16, 2011.

  1. ericknichos

    ericknichos New Member

    can anyone help me
    I use LiteSpeed ​​for my web
    when at busy time, load time become very slow, much slower than apache
    Code:
    VH Name             Req in Processing         Req / Sec          Total Req T
    vhost1                      37               4.0                    8.182
    
    if req in processing over 60, one of my virtual host will be very slow to open,
    and for information, my visitors a day around 5000, and I use the LiteSpeed ​​Enterprise 15 day trial

    whether there is something wrong with my settings ?
    Code:
    [CENTER]max con = 2000
    max ssl con = 200
    conection timeout = 200
    max keep alive = 1000
    [/CENTER]
    and the other settings is the default :(
    Last edited by a moderator: Sep 20, 2011
  2. NiteWave

    NiteWave Administrator

    php suExec enabled or not ?
  3. ericknichos

    ericknichos New Member

    dis you mean in server >> general >> Using Apache Configuration File
    PHP suEXEC > not set

    FYI, i make fresh install litespeed, not import setting from apache
    i have 5 IP virtual host with 5 listeners
    i create virtual host from virtual host template > PHP_SuEXEC
    is there something wrong or did I miss?:confused:
    Last edited: Sep 17, 2011
  4. NiteWave

    NiteWave Administrator

    ok. then check what user litespeed and lsphp processes as:
    #ps -ef|grep litespeed
    #ps -ef|grep lsphp
  5. ericknichos

    ericknichos New Member

    Code:
    [root@localhost ~]# ps -ef|grep lsphp
    nobody     317 30323  0 00:42 ?        00:00:00 lsphp5:usr/local/lsws/DEFAULT/html/web2/browse.php
    nobody     457 30322  0 00:42 ?        00:00:00 lsphp5
    nobody     484 30323  0 00:42 ?        00:00:00 lsphp5:usr/local/lsws/DEFAULT/html/web2/browse.php
    nobody     763 30323  1 00:43 ?        00:00:00 lsphp5:/usr/local/lsws/DEFAULT/html/web1/browse.php
    nobody    1319 30322  0 00:43 ?        00:00:00 lsphp5
    root      1489 29339  0 00:44 pts/0    00:00:00 grep lsphp
    nobody    8183 30322  0 00:01 ?        00:00:08 lsphp5
    nobody   22633 30322  0 00:25 ?        00:00:02 lsphp5
    nobody   22708 30322  0 00:25 ?        00:00:04 lsphp5:/usr/local/lsws/DEFAULT/html/web1/browse.php
    nobody   22735 30323  0 00:25 ?        00:00:05 lsphp5:usr/local/lsws/DEFAULT/html/web3/browse.php
    nobody   23131 30323  0 00:26 ?        00:00:05 lsphp5:/usr/local/lsws/DEFAULT/html/web1/browse.php
    nobody   23209 30322  0 00:26 ?        00:00:03 lsphp5:/usr/local/lsws/DEFAULT/html/web1/browse.php
    nobody   23618 30322  0 00:27 ?        00:00:02 lsphp5
    nobody   23965 30323  0 00:27 ?        00:00:07 lsphp5:/usr/local/lsws/DEFAULT/html/web1/browse.php
    nobody   24795 30322  0 00:29 ?        00:00:01 lsphp5
    nobody   25541 30322  0 00:30 ?        00:00:03 lsphp5:/usr/local/lsws/DEFAULT/html/web1/browse.php
    nobody   25542 30322  0 00:30 ?        00:00:03 lsphp5:/usr/local/lsws/DEFAULT/html/web1/browse.php
    nobody   25698 30322  0 00:30 ?        00:00:02 lsphp5:usr/local/lsws/DEFAULT/html/web2/browse.php
    nobody   25899 30323  0 00:31 ?        00:00:03 lsphp5:usr/local/lsws/DEFAULT/html/web3/browse.php
    nobody   26115 30323  0 00:31 ?        00:00:04 lsphp5:/usr/local/lsws/DEFAULT/html/web4/browse.php
    nobody   26116 30323  0 00:31 ?        00:00:03 lsphp5:/usr/local/lsws/DEFAULT/html/web4/browse.php
    nobody   26965 30323  0 00:32 ?        00:00:03 lsphp5:/usr/local/lsws/DEFAULT/html/web4/browse.php
    nobody   27449 30323  0 00:33 ?        00:00:02 lsphp5
    nobody   27450 30323  0 00:33 ?        00:00:02 lsphp5
    nobody   27917 30323  0 00:34 ?        00:00:02 lsphp5:usr/local/lsws/DEFAULT/html/web11/browse.php
    nobody   27918 30323  0 00:34 ?        00:00:02 lsphp5
    nobody   27941 30322  0 00:34 ?        00:00:01 lsphp5
    nobody   27970 30322  0 00:34 ?        00:00:02 lsphp5:/usr/local/lsws/DEFAULT/html/web1/browse.php
    nobody   28993 30322  0 00:36 ?        00:00:00 lsphp5
    nobody   30161 30323  1 00:38 ?        00:00:03 lsphp5:/usr/local/lsws/DEFAULT/html/web1/browse.php
    nobody   30170 30323  0 00:38 ?        00:00:02 lsphp5:/usr/local/lsws/DEFAULT/html/web1/browse.php
    nobody   30179 30323  0 00:38 ?        00:00:01 lsphp5:usr/local/lsws/DEFAULT/html/web3/browse.php
    nobody   30188 30323  0 00:38 ?        00:00:01 lsphp5:usr/local/lsws/DEFAULT/html/web3/browse.php
    nobody   30398 30322  0 00:39 ?        00:00:01 lsphp5:/usr/local/lsws/DEFAULT/html/web4/browse.php
    nobody   30408 30322  0 00:39 ?        00:00:01 lsphp5:/usr/local/lsws/DEFAULT/html/web4/browse.php
    nobody   30446 30322  0 00:39 ?        00:00:00 lsphp5:usr/local/lsws/DEFAULT/html/web2/browse.php
    nobody   30485 30322  0 00:39 ?        00:00:00 lsphp5
    nobody   30568 30323  0 00:39 ?        00:00:02 lsphp5:/usr/local/lsws/DEFAULT/html/web4/browse.php
    nobody   30613 30323  0 00:39 ?        00:00:02 lsphp5:/usr/local/lsws/DEFAULT/html/web4/browse.php
    nobody   30666 30323  0 00:39 ?        00:00:00 lsphp5:usr/local/lsws/DEFAULT/html/web2/browse.php
    nobody   30811 30323  0 00:39 ?        00:00:01 lsphp5:usr/local/lsws/DEFAULT/html/web11/browse.php
    nobody   31106 30322  0 00:40 ?        00:00:00 lsphp5
    nobody   31113 30322  0 00:40 ?        00:00:00 lsphp5
    nobody   31647 30323  0 00:41 ?        00:00:01 lsphp5:usr/local/lsws/DEFAULT/html/web2/browse.php
    nobody   31750 30323  0 00:41 ?        00:00:00 lsphp5:usr/local/lsws/DEFAULT/html/web2/browse.php
    nobody   32032 30322  0 00:41 ?        00:00:00 lsphp5:/usr/local/lsws/DEFAULT/html/web4/browse.php
    nobody   32084 30323  0 00:41 ?        00:00:00 lsphp5:usr/local/lsws/DEFAULT/html/web3/browse.php
    nobody   32369 30322  0 00:42 ?        00:00:00 lsphp5
    nobody   32431 30322  0 00:42 ?        00:00:00 lsphp5
    nobody   32460 30322  0 00:42 ?        00:00:00 lsphp5

    Code:
    [root@localhost ~]# ps -ef|grep litespeed
    root      1512 29339  0 00:44 pts/0    00:00:00 grep litespeed
    root     30320     1  0 Sep16 ?        00:00:00 litespeed (lshttpd)
    nobody   30322 30320  0 Sep16 ?        00:00:11 litespeed (lshttpd)
    nobody   30323 30320  0 Sep16 ?        00:00:19 litespeed (lshttpd)
    
    like this...
  6. NiteWave

    NiteWave Administrator

    got it -- so php not in suExec mode, but in Self Managed Mode.

    please increase max connections of lsphp5(default is 35), especially when you have a lot of memory. see if any improvement.

    Server->External App->lsphp5
    Max Connections: 35 --> 100 (for example)
    Environment: PHP_LSAPI_CHILDREN=35 -> 100
    note: above 2 values should match.

    refer: http://www.litespeedtech.com/php-litespeed-sapi.html
    'To start PHP in Self Managed Mode, "Instances" should be set to "1", while "LSAPI_CHILDREN" environment variable should be set to match the value of "Max Connections" and >1'
  7. ericknichos

    ericknichos New Member

    I've followed your advice

    Code:
    Max Connections 100
    PHP_LSAPI_MAX_REQUESTS=500
    PHP_LSAPI_CHILDREN=100
    but I do not see any improvement,...if "Req in Processing" enlarged, IP in the vhost will be very slow in opening, I even tried to check my ip with website uptime checker and sometimes it failed, but when "req in processing" is reduced, website load time back to normal, the problem if at the time busy.....
  8. NiteWave

    NiteWave Administrator

  9. ericknichos

    ericknichos New Member

    i think that's not the problem, as I said, before I install LiteSpeed ​​I use apache, and I use 10 Mbps unmetered dedicated servers...

    is there a way out of this, do I have to install apache first to import config to litespeed or what...any idea?

    thanks
  10. NiteWave

    NiteWave Administrator

    may be no difference. but you can have a try, so that you can switch to apache easily to compare with litespeed.
  11. ericknichos

    ericknichos New Member

    yeach your right :(
    i try to import config from cpanel, but still same
    refer to : http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:apache:cpanel#steps_to_replace_apache_with_lsws

    but if request in procesing higher, web is slow responding, sometimes 500 internal server error....
    in setting above, PHP suEXEC is "yes"
    is there something I need to change?
    hopefully you can help me, because I am interested in using LiteSpeed ​​for long term...
    thanks

    ps : my DS dual xeon with 4gb ram
  12. NiteWave

    NiteWave Administrator

    if PHP suEXEC is "yes", increase "PHP suEXEC Max Conn" may help.

    please give a screenshot of real-stat when slow-responding.

    and what's the problem when run apache ?
  13. ericknichos

    ericknichos New Member

    like this, for VHname "liz" if "req in procesing" in high numbers ( 82 ), the web will be very slow load / open
  14. NiteWave

    NiteWave Administrator

    can't view the image.
  15. ericknichos

    ericknichos New Member

    [​IMG]

    like this, for VHname "liz" if "req in procesing" in high numbers ( 82 ), the web will be very slow load / open
  16. NiteWave

    NiteWave Administrator

    yes, please note WaitQ=71 of liz.
    that's why the site is slow.
    what's your current "PHP suEXEC Max Conn"?
  17. ericknichos

    ericknichos New Member

    Thanks' for your reply NiteWave
    The previous realtime screen shoot, I have disabled the php suexec, and create 5 virtual hosts with five listener without import config from apache
    and it seems right, maybe the problem is due to EAProc WaitQ, then what should I do ?
    I give screnshoot image abut my setting, also i try to increase php memory limit to 128 in php.ini

    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    Last edited: Sep 19, 2011
  18. NiteWave

    NiteWave Administrator

    in above settings(not php suExec), please adjust lsphp5 external app settings:
    Process Soft/Hard Limit: 200 --> 300

    then paste real-stat as before, to monitor the value of "EAProc WaitQ".

    what webproxy are you running?

    since 4.1.3, if php script stream video from youtube etc, the whole video file(which usually has large size) is not saved on server, so need much less free space of hard disk when proxy many concurrent streaming requests, but need increase max children of lsphp processes.
  19. ericknichos

    ericknichos New Member

    Awesome and solved !!!

    Really thanks NiteWave
    after set max connection to 150 , children 150 and last Process Soft/Hard Limit: 200 --> 300 and all clear !!!

    [​IMG]

    and for this time i feel litespeed is very fast....once again thanks NiteWave , after this trial expired I'll buy a license LiteSpeed

    but sometimes EAProc WaitQ appears again but with a small nominal,not too annoying, but if the process increase again more and more, and visitors also increase, to anticipate these things do I have to raise the max connection and lsapi_children again?

    and did you think i need to set Max Keep-Alive Requests and smart keep alive?
    Last edited: Sep 19, 2011
  20. NiteWave

    NiteWave Administrator

    probably. need find out the bottleneck when you reach that traffic. please note "Http Out: 562KB", plus "Http In 101KB", I think you have used up about 8M bandwidth? when your traffic increase, next bottleneck may be at network.
    also "top -c" can help you to identify the bottleneck: mysql? iowait? php ?

    as long as your site works fine, don't touch them. the default settings are optimal for most cases.

Share This Page