Performance Tuning

Discussion in 'General' started by zoom, Nov 6, 2008.

  1. zoom

    zoom Member

    I'm trying to determine what would be a good configuration for a site getting on avg 12000 hits per day. I'm running on a VPS with 2GB memory with the LiteSpeed Enterprise version. Are the settings below acceptable?

    Max Connections: 500
    PHP_LSAPI_MAX_REQUESTS=500
    PHP_LSAPI_CHILDREN=50

    Memory Soft Limit: 500M
    Memory Hard Limit: 550M
    Process Soft Limit: 500
    Process Hard Limit: 550

    DDOS Settings:

    Per Client Static Reqs/sec: 200
    Per Client Dyn Reqs/sec: 200
  2. mistwang

    mistwang LiteSpeed Staff

    change "Max connections" to "50", it must not be higher than "PHP_LSAPI_CHILDREN"

    Your DDoS setting does not protect you from request flood at all, start from

    Per Client Static Reqs/sec: 20
    Per Client Dyn Reqs/sec: 1 or 2
  3. anewday

    anewday Moderator

    What is the soft and hard limits under the Security tab?
  4. zoom

    zoom Member

    anewday,

    The Server Level settings for "External Application Resource" are as follows.

    CPU Soft Limit (sec): 300
    CPU Hard Limit (sec): 600
    Memory Soft Limit (bytes): 250M
    Memory Hard Limit (bytes): 300M
    Process Soft Limit: 400
    Process Hard Limit: 450

    I'm not sure if these values come into play since I'm setting the External Application resources at the vhost level.
  5. anewday

    anewday Moderator

    CPU Soft Limit (sec): 300
    CPU Hard Limit (sec): 600

    There is no global setting for these. :eek:
  6. zoom

    zoom Member

    Yes there is a global setting at the Server level for the CPU Limits. However, the global settings (below) seem to be acceptable.

    CPU Soft Limit (sec): 300
    CPU Hard Limit (sec): 600

    Using a soft limit of 300 seconds of CPU time for an external application should be okay in my situation.
  7. anewday

    anewday Moderator

    I don't see the global settings for those under External Apps for lsphp4 or lsphp5.

    What are your soft and hard limits for connections under the DDOS settings?
    Last edited: Nov 7, 2008
  8. hadyabed

    hadyabed New Member

    I recommend putting 20 for connection soft limit and 30 for connection hard limit, and set the grace period to 15 seconds and banned period to 2500 seconds.
    -Hady Abed
  9. anewday

    anewday Moderator

    You'll have many banned ips with those settings.
  10. hadyabed

    hadyabed New Member

    I've never had a problem with those settings. Pretty sure they're the same settings mistwang recommended in one of his posts a while back.
    -Hady Abed
  11. anewday

    anewday Moderator

    Most web browsers open 30 or more connections to download a page and not to mention 15 seconds may not be enough time to load a page completely on a dialup connection. ;)

    What kind of sites do you have? For forums with many js, css, php, images, there should be many banned IPs.
  12. mistwang

    mistwang LiteSpeed Staff

    It depends on the number of images linked from that page.
    FireFox 3 is more aggressive on open new connections.
    You should add "Expires header" to those static files, so the client only need to load them once for a while.

    Remember, only count connections in ESTABLISHED state.
  13. anewday

    anewday Moderator

    I set the Hard Limit to 100 today and so far, there is one banned IP. :eek: The person was using Opera to browse the coppermine gallery. I don't know if their connection is slow or what. :confused:

    George, maybe there should be a grace period for Hard Limit too. I can't seem to find a good value. :(
  14. anewday

    anewday Moderator

    I set expires headers for images, css, and javascript to 12 hours now. But, that will have no effect on new visitors loading the content for the first time.
  15. anewday

    anewday Moderator

    I just noticed that litespeed admin panel shows the followiing under Expires Settings in General tab.

    Code:
    image/*=A604800, text/css=A604800, application/x-javascript=A604800
    (these are default, I believe)

    But, I have the following in /usr/local/apache/conf/httpd.conf

    Code:
    <IfModule mod_expires.c>
    ExpiresActive On  
    ExpiresByType image/gif A43200
    ExpiresByType image/png A43200
    ExpiresByType image/jpg A43200
    ExpiresByType image/jpeg A43200
    ExpiresByType text/css A43200
    ExpiresByType text/javascript A43200
    </IfModule>
    What should I do now?

    Can I write ExpiresByType image/* A43200 instead of listing each image type above? And, which is correct? text/javascript or application/javascript ?
    Last edited: Nov 14, 2008
  16. mistwang

    mistwang LiteSpeed Staff

    The configuration in httpd.conf will be used for Apache vhosts. Yes, you can use image/*, if the MIME type does not exist, you have set it explicitly.
    You need to find out what MIME is used for ".js" and set expiring configuration accordingly.
  17. anewday

    anewday Moderator

    If I import Apache vhosts, the /usr/local/apache/conf/mime.types file will be used? And the LS admin panel (/config/confMgr.php?m=serv&p=general&)t=SERV_MIME_TOP edits that file, right?
  18. miracle

    miracle New Member

    The same is happening on my forums on topics with many images/attachments. If there is a grace period for hard limit, it would eliminate many banned IPs of legitimate users. Most of the IPs are using Opera, it seems to open many connections to download the files on a page.

Share This Page