LiteSpeed and CloudLinux

Discussion in 'Install/Configuration' started by OmegaPrime, Nov 11, 2012.

  1. OmegaPrime

    OmegaPrime New Member

    HI,

    I have a server running LiteSpeed and it has replaced Apache, but I am not convinced that it's as fast as it could be.

    I believe everything is up to date. What settings or config should I be looking for?

    When I go into LiteSpeed'd control panel, it shows the cache as zero. Here are some details below that might be helpful.


    LiteSpeed Port Offset is 0.

    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql

    max_connections = 400
    key_buffer = 32M
    myisam_sort_buffer_size = 32M
    join_buffer_size = 1M
    read_buffer_size = 1M
    sort_buffer_size = 2M
    table_cache = 1024
    thread_cache_size = 286
    interactive_timeout = 25
    wait_timeout = 1000
    connect_timeout = 10
    max_allowed_packet = 16M
    max_connect_errors = 10
    query_cache_limit = 1M
    query_cache_size = 16M
    query_cache_type = 1
    tmp_table_size = 16M

    [mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid
    open_files_limit = 8192

    [mysqldump]
    quick
    max_allowed_packet = 16M

    [myisamchk]
    key_buffer = 64M
    sort_buffer = 64M
    read_buffer = 16M
    write_buffer = 16M


    From httpd.conf

    Timeout 5
    TraceEnable Off
    ServerSignature Off
    ServerTokens ProductOnly
    FileETag None
    StartServers 5
    <IfModule prefork.c>
    MinSpareServers 5
    MaxSpareServers 10
    </IfModule>
    ServerLimit 256
    MaxClients 150
    MaxRequestsPerChild 4000
    KeepAlive Off
    KeepAliveTimeout 3
    MaxKeepAliveRequests 200

    Within LiteSpeed's panel

    Total Req 496,179 Total Cache Hits 0
    Cache Hit Rate 0% Cache Hits/Sec 0.0


    Any suggestions that anyone could think of?


    Thanks in advance.
  2. webizen

    webizen New Member

  3. OmegaPrime

    OmegaPrime New Member

    Thanks. I was hoping a more direct answer, but any help is good help :)


    I will go through everything again and look through these notes and see if I can improve things.

    I am still concerned that the cache is hitting 0. I know with Varnish for instance it will show what's hitting the cache.


    If I run into any roadblocks or get the same results I will reply tomorrow.
  4. webizen

    webizen New Member

    pls note that Litespeed cache is page cache for dynamic page like PHP and only available for 2-CPU license or above. The link posted gives you the general guideline on the setup. It is not enabled by default just by switching from Apache to LSWS.
  5. OmegaPrime

    OmegaPrime New Member

    Ok here is where I am. I upgraded to 2-CPU's, re-installled LiteSpeed, setuo the cache page option, did some more research and made adjustments that would match my hardware, but overall I'm not seeing any improvement and a few php sites (wordpress and a forum) are loading a lot slower. Html sites are super fast, but that was by default.

    What other steps should I be looking at? I can included screen shots of the settings as I have seen others do on here.
  6. webizen

    webizen New Member

    Usually, lsws out of box settings should be OK.

    General guideline is:
    1. make sure to build matching php if lsws reads apache httpd.conf.
    2. check WaitQ column in real-time stats. If it is zero all the time, then no system delay on php process (good thing). If stays non-zero, you need to increase PHP suEXEC max connections.
    3. follow guide to enable LSWS cache (for dynamic page like PHP) as point out earlier. you should see cache hit rate in real-time stats if working.
    4. run 'top -c' see which process consume most cpu cycle.
  7. OmegaPrime

    OmegaPrime New Member

    Hmm, I think I might be stuck somewhere or something is still wrong.

    1. Done
    2. Nothing shows up in the column. No numbers, no stats, nothing. I attached how it look.
    3. done
    4. it tends to change. There isn't any one process that holds for a long time or takes up a lot of resources. Most of it is when a visitor comes to the site.

    Attached Files:

  8. OmegaPrime

    OmegaPrime New Member

    Were you referring to the Wait Q in the Virtual Host section where I crossed out the active hosts, or the bottom section of External Applications?

Share This Page