Is Litespeed best for high-traffic file hosting sites?

Discussion in 'General' started by pythod, May 12, 2010.

  1. pythod

    pythod Member

    Hello :)

    I recently took over a file hosting site (similar to rapidshare, megaupload hotfile etc.) that receives ~ 80k visitors a day. Currently files are being served from multiple 100 Mbps uplink dedicated servers, which will be consolidated into single servers later after the system upgrade. Our entire application is custom written in PHP 5.2.11 and we use php to throttle bandwidth, support resume support etc. Currently, we are in the process of replacing the legacy code et al with our our custom developed php app and have been seriously considering upgrading our web servers to support our infrastructure. On the existing setup, apache 1.3 handles file uploads and lighttpd user downloads. I scoured over the Internet to file benchmarks for large file uploads, but haven't been able to. Many-a-times, lighttpd dies and both apache and lighttpd have to be restarted. This is annoying. We don't want this from the web server we install.

    Please note that in our case Litespeed isn't actually handling file downloads (from user's perspective/upload from web server), but our php app is because we need to see whether user is paid member or not and whether to throttle the speed, provide resume support, track bandwidth usage etc.

    I was wondering if experts could comment on my questions:

    1. We did some internal tests by uploading multiple 300MB+ files on Litespeed and 'top' (on ubuntu) keeps increasing the 'memory used' value rather than "dumping" the memory after the upload is complete:

    Mem: 4015996k total, 1206036k used, 2809960k free, 114984k buffers

    I suspect that maxing out the available memory could be the reason why lighttpd or apache are dying and need to be reset. I am certainly surprised to see this happen with Litespeed. Is there a way to "dump" the non-needed memory buffer?

    2. Is litespeed capable of handling upto 10,000 concurrent downloads from a single server with 1 Gbps uplink (24 x 1.5 TB) flawlessly? Why not lighttpd or nginx as the competition uses them?

    Last edited: May 12, 2010
  2. NiteWave

    NiteWave Administrator

    I guess the used memory included cache too? i.e.,
    #free -m
                 total       used       free     shared    buffers     cached
    Mem:         11976      11909         67          0       1219       8445
    -/+ buffers/cache:       2244       9732
    Swap:        24003          0      24003
    the figures come from line 1, not line 2(start with -/+ buffers/cache)

    and how about your kernel's current settings regarding
    #cat /proc/sys/vm/dirty_background_ratio
    #cat /proc/sys/vm/dirty_ratio
  3. pythod

    pythod Member

    Below are the kernel settings:

    cat /proc/sys/vm/dirty_background_ratio

    cat /proc/sys/vm/dirty_ratio

    However, I figured out that it was the "Cached Memory" that needed to be freed up, so I ran this and the memory usage came down to 100k+

    echo 3 > /proc/sys/vm/drop_caches
    What other optimizations do I need to perform?
  4. NiteWave

    NiteWave Administrator

    here's one I can think of:
    "Virtual memory, disk swapping, is used to store big request bodies and dynamically generated responses. The swapping directory should be placed on a disk with enough space."

    "Place the swapping directory on a separate disk or increase Max I/O Buffer Size to eliminate swapping."

    the default swap dir is /tmp/swap.
  5. pythod

    pythod Member

    Right, I'm already doing that. Thanks for the tip!

Share This Page