Speed problem downloading large file

Discussion in 'Install/Configuration' started by user3, Feb 21, 2006.

  1. user3

    user3 New Member

    Hello,

    I have tested the speed of the web server using ab.
    Really, litespeed is faster than apache as my ab test.
    But the result was not good against large file download.

    At this site(http://www.litespeedtech.com/benchmark.html),
    Just tested small size file.

    Anyone who have tested larger file(over 1M) download speed test?
    The result was like below.

    Apache 2.2 is 2~3 times faster than litespeed.

    -> there is no limit(bandwidth, conneciton..) at configuration file.
    and I have tested at a server which have different port number.
    from local and remote, but the result was same.

    apache 2.2 : 80
    litespeed : 8080

    # ab -c 10 http://test.server:80/largee_file

    Server Software: Apache/2.2.0
    Server Hostname: test.server
    Server Port: 80

    Document Path: large_file
    Document Length: 300260 bytes

    Concurrency Level: 10
    Time taken for tests: 0.052 seconds
    Complete requests: 1
    Failed requests: 0
    Broken pipe errors: 0
    Total transferred: 3005110 bytes
    HTML transferred: 3002600 bytes
    Requests per second: 19.23 [#/sec] (mean)
    Time per request: 520.00 [ms] (mean)
    Time per request: 52.00 [ms] (mean, across all concurrent requests)
    Transfer rate: 57790.58 [Kbytes/sec] received


    # ab -c 10 http://test.server:8080/largee_file
    Server Software: LiteSpeed
    Server Hostname: test.server
    Server Port: 8080

    Document Path: large_file
    Document Length: 300260 bytes

    Concurrency Level: 10
    Time taken for tests: 0.095 seconds
    Complete requests: 1
    Failed requests: 0
    Broken pipe errors: 0
    Total transferred: 3005160 bytes
    HTML transferred: 3002600 bytes
    Requests per second: 10.53 [#/sec] (mean)
    Time per request: 950.00 [ms] (mean)
    Time per request: 95.00 [ms] (mean, across all concurrent requests)
    Transfer rate: 31633.26 [Kbytes/sec] received



    Thanks in advance.
  2. mistwang

    mistwang LiteSpeed Staff

    It does not sound right, for file that large, it should be network bandwidth bounded no matter which server is used, even with 1Gb link in our lab.
    What is your test environment? What is the CPU utilization when you are testing both servers? Is there any disk I/O intensive application running the server when you were testing?

    What is the concurrent level of the the test? For standard edition, it should not go beyond 300 for large file test.
  3. user3

    user3 New Member

    The result downloading large file is not good

    Thanks for your reply.

    But it was tested at s same server which have different port number.
    and I have tested over 100 times from local and remote, but the result was same.

    The tested file is 300k, and 25M.

    apache 2.2 : 80
    litespeed(the lastest version) : 8080

    # ab -c 10 http://test.server:80/largee_file

    Server Software: Apache/2.2.0
    Server Hostname: test.server
    Server Port: 80

    Document Path: large_file
    Document Length: 300260 bytes

    Concurrency Level: 10
    Time taken for tests: 0.052 seconds
    Complete requests: 1
    Failed requests: 0
    Broken pipe errors: 0
    Total transferred: 3005110 bytes
    HTML transferred: 3002600 bytes
    Requests per second: 19.23 [#/sec] (mean)
    Time per request: 520.00 [ms] (mean)
    Time per request: 52.00 [ms] (mean, across all concurrent requests)
    Transfer rate: 57790.58 [Kbytes/sec] received


    # ab -c 10 http://test.server:8080/largee_file
    Server Software: LiteSpeed
    Server Hostname: test.server
    Server Port: 8080

    Document Path: large_file
    Document Length: 300260 bytes

    Concurrency Level: 10
    Time taken for tests: 0.095 seconds
    Complete requests: 1
    Failed requests: 0
    Broken pipe errors: 0
    Total transferred: 3005160 bytes
    HTML transferred: 3002600 bytes
    Requests per second: 10.53 [#/sec] (mean)
    Time per request: 950.00 [ms] (mean)
    Time per request: 95.00 [ms] (mean, across all concurrent requests)
    Transfer rate: 31633.26 [Kbytes/sec] received



    Thanks in advance.
  4. ts77

    ts77 New Member

    concurrency seems to be 10 looking at above results.

    but just one request looks unfair to me.
    try it with at least 1000 requests or something to get some good averages.

    also 30mb/s vs. 56mb/s ... whats the speed of the harddisk?

    @mistwang, don't know if apache gains something in io-performance for reading from disk with its many threads.
  5. user3

    user3 New Member

    Aapche seems 4 times faster at my ab test. I can't believe.

    Thanks for your reply.

    When I set -c 100 or 1000, the result was same.
    Apache seems faster over 4 times. (at a same server)


    ### Apache 2.2.0
    Server Software: Apache/2.2.0
    Server Hostname: test.server
    Server Port: 80

    Document Path: large_file
    Document Length: 300260 bytes

    Concurrency Level: 1000
    Time taken for tests: 0.408 seconds
    Complete requests: 1
    Failed requests: 0
    Broken pipe errors: 0
    Total transferred: 12020440 bytes
    HTML transferred: 12010400 bytes
    Requests per second: 2.45 [#/sec] (mean)
    Time per request: 408000.00 [ms] (mean)
    Time per request: 408.00 [ms] (mean, across all concurrent requests)
    Transfer rate: 29461.86 [Kbytes/sec] received

    ### litespeed
    Server Software: LiteSpeed
    Server Hostname: test.server
    Server Port: 8080

    Document Path: large_file
    Document Length: 300260 bytes

    Concurrency Level: 1000
    Time taken for tests: 1.184 seconds
    Complete requests: 1
    Failed requests: 0
    Broken pipe errors: 0
    Total transferred: 6766912 bytes
    HTML transferred: 6746176 bytes
    Requests per second: 0.84 [#/sec] (mean)
    Time per request: 1184000.00 [ms] (mean)
    Time per request: 1184.00 [ms] (mean, across all concurrent requests)
    Transfer rate: 5715.30 [Kbytes/sec] received

    Anyone who have tested against large file?
    If then, Please post a ab result.

    So thanks again..

    and my test environment is below..

    linux CentOS 3.5
    kernel is 2.4.21-32.0.1.EL
    CPU is P3 750Mhz
    RAM is 512M
    Disk is Ultra160 SCSI
  6. Xorlev

    Xorlev New Member

    Important question, are you using LSWS Standard, Professional, or Enterprise? Standard is capped to 160kb/s concurrent bandwidth I believe.
  7. xing

    xing LiteSpeed Staff

    user3, I'm going to do a mirror setup to see exactly what is going on here with the test results.

    If you can, please email your apache config file, lsws's /conf/httpd_config.xml and the vhost directory/conf/vhconf.xml to xing@litespeedtech.com.

    I can test with my own setup but it would be best with a perfect mirror.

    Xorlev, there is no bandwidth cap for the standard version of any version for that fact. The 160KB/s limit is the download cap set by us when you download binary packages from litespeedtech.com so people don't crash our bandwidth . =) We need to remove or reword that line so more people don't get confused.
  8. user3

    user3 New Member

    I have tested Standard version.

    thanks for your reply.

    I'm afraid, I have tested standard version.
    and 160kb/s limit makes so slow,I think.

    By the way,
    160kb/s means limitted per file or all files?


    Thanks in advance.
  9. xing

    xing LiteSpeed Staff

    There is no speed "cap"/limit in Standard or any of the LiteSpeed versions. Want to make sure others reading this post are not mistaken. Xorlev is referring to the "download" cap we have set to limit how fast people can download litespeed releases from our website.
  10. mistwang

    mistwang LiteSpeed Staff

    User3,

    You are using a wrong "ab" parameter for the test, "-c" is for concurrrency, not for number of requests, "-n" is for that purpose.
    Noticed that "Complete requests" is "1" in all of your tests. :p

    You should use "ab -n <#req> -c <#concurrency> ...".

    Another tip for testing on the same machine is to switch event dispatcher from poll to epoll.

    Anyway, what really counts is the result of over the network test. "ab" takes a lot of resource when doing the test locally.
  11. user3

    user3 New Member

    The result using "-n" is not change.

    Thanks for all your answer.

    Surely, I have tested using other parameters already.

    below result is using "-n" parameter.

    ## apache 2.2.0

    ./ab -n 100 -c 1000 http://test.server:80/index.html.1

    Server Software: Apache/2.2.0
    Server Hostname: test.server
    Server Port: 80

    Document Path: /index.html.1
    Document Length: 300260 bytes

    Concurrency Level: 1000
    Time taken for tests: 0.951 seconds
    Complete requests: 100
    Failed requests: 0
    Broken pipe errors: 0
    Total transferred: 36151432 bytes
    HTML transferred: 36121061 bytes
    Requests per second: 105.15 [#/sec] (mean)
    Time per request: 9510.00 [ms] (mean)
    Time per request: 9.51 [ms] (mean, across all concurrent requests)
    Transfer rate: 38014.12 [Kbytes/sec] received


    ## listespeed

    ./ab -n 100 -c 1000 http://test.server:80/index.html.1

    Server Software: LiteSpeed
    Server Hostname: test.server
    Server Port: 8080

    Document Path: /index.html.1
    Document Length: 300260 bytes

    Concurrency Level: 1000
    Time taken for tests: 2.629 seconds
    Complete requests: 100
    Failed requests: 0
    Broken pipe errors: 0
    Total transferred: 39494972 bytes
    HTML transferred: 39447612 bytes
    Requests per second: 38.04 [#/sec] (mean)
    Time per request: 26290.00 [ms] (mean)
    Time per request: 26.29 [ms] (mean, across all concurrent requests)
    Transfer rate: 15022.81 [Kbytes/sec] received


    Local and remote result was same.


    Thanks for your concerns...
  12. Xorlev

    Xorlev New Member

    "Your download speed for above packages is throttled to 160KB/s regardless of the number of connections."

    I see now. Very neat. Sorry I misunderstood.
  13. mistwang

    mistwang LiteSpeed Staff

    You have set the concurrency level too high, should not over 300 for standard edition. And the concurrency level should always be lower than number of requests.

    And you cn increase the "Max MMAP File Size" under the tuning tab higher than the size of the test file in order to get the best performance.
  14. mistwang

    mistwang LiteSpeed Staff

    Spent a little time to investigate this issue.

    Found that it is true Apache can serve large static file a little faster (upto about 30%) than properly configured lsws std.

    The reason is Apache uses sendfile() for static file, lsws std just use plain read() or MMAP() + writev(), which is not as efficient as sendfile(). That's the main factor for serving large static file.

    For most user it is not a big concern unless you have a Gb connection serving pure static large files. However, our Enterprise edition is highly recommended for this kind of application, it definitely beats Apache on both pure serving speed and scalability.
  15. ts77

    ts77 New Member

    but in the professional version one can enable sendfile too.
    wouldn't that help in that case already?
  16. xing

    xing LiteSpeed Staff

    The sendfile setting within professional does not take effect. If you click on help witin the admin gui, it will detail that sendfile settings is only applied for enterprise licenses.

    Please note this "bottleneck" witin std/pro version is only applicable in a bi-directional GigE setup where both the client and server on a GigE connection which is not often the case if at all, in most real world siutations.

    On a 100mb/s pipe, you will hit the 9.9MB/s pipe limit before hitting any i/o limit and apache has no advantage what so ever. The same goes to a real-world scenario where you have a much less than GigE interconnect to the internet and your web clients are on a < 10mb/s pipe to the inernet.
  17. madmage

    madmage New Member

    I as well have this issue. If the sendfile issue is what is causing this to occur, it is a shame. I'll be forced to switch back to apache, since I just can't afford the price of the enterprise server and the pro does not enable sendfile either.
  18. mistwang

    mistwang LiteSpeed Staff

    sendfile support will be turned on in professional edition in 2.1.13.
  19. madmage

    madmage New Member

    im still confused how you can claim that the std edition is FASTER than apache when it hands-down is not.

    I had to switch back to apache for our http traffic, but i left lsws in place for our ssl traffic and the difference is blatant.
    if i wget a 521k file, im getting average thruput here of 314.77K/s with apache. using lsws for the same exact file it goes at 12.07K/s.

    how exactly is that faster than apache?
  20. xing

    xing LiteSpeed Staff

    With or without sendfile() support in the Standard version of LSWS, your result appears to be out of wack. 12KB/s vs 314KB/s? Not saying your result is wrong, but there appears to be something broken with your configuration.

    With that said, Standard Edition of LiteSpeed is not optimized for raw static output due to the advantage of lack of sendfile() support that is available in Enterprise edition. Again, sendfile()'s advantage is not 30X so we need more info to replicate your test result.

    Despite all that, the LiteSpeed Standard Edition IS more scalable than Apache given load. Try to compare LiteSpeed, any edition, vs Apache under 200+ requests per second (mix dynamic content and static), and the difference in speed and latency is without questioned.

    The bigger your website, server load, the greater the advantage is LiteSpeed vs Apache.

    If you can provide us with more details of your configuration, we can try to see what went wrong with you. Due to possible sensitive info in your configuration, you can email the LiteSpeed xml config files plus Apache config file to bug@litespeedtech.com. Please note the Apache + LiteSpeed version and the size of the the static file from your test.
    Last edited: Jul 6, 2006

Share This Page