any suggestions on a configuration Optimized for speed

Discussion in 'Install/Configuration' started by nathanc, Jun 14, 2007.

  1. nathanc

    nathanc New Member

    Hello guys,
    I was hoping to get some suggestions out of this thread.
    We host several Rails apps using an Apache/Haproxy/Mongrel stack.
    I have been checking to see if litespeed is a good replacement for our rails hosting needs. So far I have been impressed with the ease and administration of LSWS. It seems that if this works out we can completely the entire stack with LSWS.
    However, I am finding it a roughly a third slower then my apache/H/M stack. I figured it would have something to do with my configuration.

    Any advice would be much appreciated
    Cheers,
    Nathan C

    For my environment, I have:
    -------------------------------
    HARDWARE
    -------------------------------
    2 servers with:
    model name : Dual-Core AMD Opteron(tm) Processor
    cpu MHz : 2.4
    memory : 1gig

    -------------------------------
    GENERAL -> Ruby on Rails
    -------------------------------
    Rails Environment: Production
    Max Connections: 100
    Environment: LSAPI_MAX_REQS=1000
    LSAPI_MAX_IDLE=60
    Connection Keepalive Timeout: 60
    Response Buffering: No
    Back Log: 50
    Run On Start Up: Yes
    Max Idle Time: 300
    Priority: 3
    Memory Soft Limit (bytes): 350M
    Memory Hard Limit (bytes): 400M
    Process Soft Limit: 300
    Process Hard Limit: 400

    -------------------------------
    GENERAL -> Tuning
    -------------------------------
    -- Connection --
    Max Connections: 2000
    Connection Timeout (secs): 300
    Max Keep-Alive Requests: 1000
    Smart Keep-Alive: No
    Keep-Alive Timeout (secs): 5
    Send Buffer Size (bytes): 0
    Receive Buffer Size (bytes): 0
    I/O Event Dispatcher: best (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
    -- Request/Response --
    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
  2. mistwang

    mistwang LiteSpeed Staff

    Since LiteSpeed does dynamic spawn for Rails Application, and cost of Rails framework initialization is very high, and your configuration make LiteSpeed to initialize it again and again. That's why you feel litespeed is slower.

    Reduce "Max Connections" to match the number of Mongrels you run for each Rails Application. Set "Max Idle Time" to "not set" or "0" to keep the parent Rails process running, this will avoid repeating Rails initialization.
    Turn on sendfile() if Rails page cache is used.
  3. nathanc

    nathanc New Member

    Thanks mistwang for the quick reply! I will try that.

Share This Page