LiteSpeed, Nginx, Lighttpd, Apache Show Down

February 3rd, 2010

After we posted recent benchmark test results, we got some interests and challenges. On our side, we can only say that we just posted untwisted results under our test environment.

One WebHostingTalk user offered his server and opened a topic there. Mistwang spent time and tested LSWS 4.1RC2 and gave full results. However, no full results on other web servers. So it ends up nowhere. If you are experienced in configuring other web servers, you are welcome to continue the test.

Benchmarking takes a lot of time and is hard to get comprehensive. We’ll do more benchmark tests after we release LSWS 4.1.

This year we will also have major feature enhancement on LSLB, since more and more people started using it and requested new features.

Benchmark Comparison on Serving Simple PHP: LiteSpeed vs Apache vs Nginx

January 6th, 2010

To perform a fair benchmark requiring a lot of preparation, as you need to know the detail of each product and set appropriate configuration. Recently, we got chance to do some internal testing. It’s experimental, however the result is good enough to make some points and may be useful to our users, so we would like to share it in a series of blog posts first. Feel free to provide any feedback, so we can improve in our formal benchmark test later on.

This time we will compare web server performance on serving simple hello.php. Comparing simple php files is standard practice for benchmark, as this can reveal web server performance instead of php engine being the bottleneck. We will compare LiteSpeed, Apache and Nginx with different configurations.

Software version:  LiteSpeed 4.1RC2, LSAPI 5.0b2, PHP 5.3.0, Apache 2.2.14, Nginx 0.7.61.

Test results:

Configuration Non-Keep-Alive Keep-Alive
Server Mode Average of 4 tests Rating Average of 4 tests Rating
LiteSpeed LSAPI 1 CPU 4741.78 305 6488.52 326
Apache mod_php worker 1554.69 100 1992.34 100
event 1736.26 112 2217.04 111
prefork 1844.85 119 2501.67 126
Nginx 1 worker 1213.67 78 1226.19 62
Apache mod_fcgid worker 1012.43 65 990.87 50
event 970.53 62 973.11 49
prefork 939.67 60 942.61 47
Apache mod_fastcgi worker 832.76 54 825.22 41
event 792.64 51 779.92 39
prefork 795.51 51 793.18 40
Apache suPHP worker 89.63 6 90.09 5

Conclusion
LiteSpeed + LSAPI apparently have big advantage over other configurations. LiteSpeed performs more than 2 times faster than Apache mod_php, which is best configuration for Apache setup. There is little performance impact for LiteSpeed to run in suEXEC mode; therefore it can achieve security benefit of suPHP without losing performance while CGI-based suPHP is the biggest loser in this test.

There are almost no differences between keep-alive and non-keep-alive for Nginx, mod_fcgid, mod_fastcgi and suphp.

Apache mod_php is second to LiteSpeed: about 52% (non-keep-alive) / 103% (keep-alive) faster than Nginx, about 83% (non-keep-alive) / 152% (keep-alive) faster than mod_fcgid, about 120% (non-keep-alive) / 207% (keep-alive) faster than mod_fastcgi, 18 (non-keep-alive) / 22 (keep-alive) times faster than suPHP.

Apache prefork performs mod_php better than worker and event modes; Apache worker performs mod_fcgid and mod_fastcgi just a little better than event and prefork modes.

Apache mod_fcgid is about 20% faster than mod_fastcgi; either mod_fcgid or mod_fastcgi lose keep-alive ability that mod_php has.

Read the rest of this entry »

Benchmark Comparison on Serving Small Static Files: LiteSpeed vs Apache vs Nginx

December 29th, 2009

To perform a fair benchmark requiring a lot of preparation, as you need to know the detail of each product and set appropriate configuration. Recently, we got chance to do some internal testing. It’s experimental, however the result is good enough to make some points and may be useful to our users, so we would like to share it in a series of blog posts first. Feel free to provide any feedback, so we can improve on our formal benchmark tests later on.

This time we will compare web server performance on serving small static files. Comparing small files is standard practice for benchmark, as this can reveal web server performance instead of network being saturated by large files first. We will compare LiteSpeed, Apache and Nginx with different configurations on serving small static files.

Software version: LiteSpeed 4.1RC2, Apache 2.2.14, Nginx 0.7.61.

Test Result

Round Apache
(worker)
Apache
(event)
Apache
(prefork)
Nginx
(1 worker)
LiteSpeed
(1 CPU)
Non-Keep-Alive
1 2570.63 3192.56 3342.65 6616.52 9217.25
2 2555.7 3150.34 3275.96 7098.36 9474.72
3 2562.29 3159.37 3309.69 9609.46 9526.48
4 2534.73 3181.72 3392.23 6525.97 9550.62
Average 2555.84 3171.00 3330.13 7462.58 9442.27
Rating 100 124 130 292 369
Keep-Alive
1 4957.55 6571.35 6668.33 13862.73 27487.78
2 4609.48 6482.42 6595.71 13729.05 28333.26
3 4321.93 6709.53 6655.88 12319.22 27872.33
4 4384.76 6323.04 6633.4 13123.33 28788.51
Average 4568.43 6521.58 6638.33 13258.58 28120.47
Rating 100 143 145 290 616

Conclusion

LiteSpeed is apparently a big winner in this test. Apache worker and event model does not perform better than prefork model in serving small files. We are also surprised with LiteSpeed performance over Nginx, especially on keep-alive test.

Read the rest of this entry »

LiteSpeed + LSAPI vs. Apache + Passenger vs. Nginx + Passenger

December 16th, 2009

To perform a fair benchmark requiring a lot of preparation, as you need to know the detail of each product and set appropriate configuration. Recently, we got chance to do some internal testing. It’s experimental, as all tests were run within 1 box. We bind LSWS to 1 CPU, and leave another CPU to ab. The result here is good enough to make some points and may be useful to our users, so we would like to share in a series of blog posts first. Feel free to provide any feedback, so we can improve in our formal benchmark test later on.

In our last test, we studied the memory consumption of Ruby vs Ruby Enterprise Edition using Typo as a test case. Since Typo itself is a bottleneck when cache is disabled, performance among different web servers cannot be revealed.

This naturally leads to our next interested topic “Comparing the performance of the interface between web server and Ruby engine”.

This time, we focus on performance of the interface between web server and Ruby engine by using the simplest “Hello World” without database. We tested 3 configurations, all based on Ruby Enterprise 1.8.7: LiteSpeed/4.1RC2 + REE, Apache/2.2.14 (worker MPM) + REE + Phusion Passenger and Nginx/0.7.61  + REE + Phusion Passenger.

Test method is still based on http://www.rubyenterpriseedition.com/comparisons.html

Software Version: LSWS 4.1RC2, Nginx/0.7.61, Apache/2.2.14(Worker MPM), Ruby Enterprise Edition 1.8.7, Rails 2.2, Passenger 2.2.5

Test Result

Configuration Req/Sec Memory Usage
LiteSpeed + REE + LSAPI 280 146M ~ 158M
Nginx + REE + Passenger 212 153M
Apache(worker MPM) + REE + Passenger 200 178M

Conclusion

Based on above simple tests, LiteSpeed + REE + LSAPI are the preferred configuration.

Read the rest of this entry »

Litespeed + Ruby Enterprise Edition

December 9th, 2009

We haven’t done benchmarks since LSWS 2.0 due to various reasons… People may discount what we say because this is a vendor version… The main reason is that we are really busy with other high-priority things, like new feature enhancement, bug fixes and support… We treat every user’s feedback seriously. So to answer those people who request new benchmark, YES, we know it is OVERDUE, and it is on our TODO list after 4.1 stable released.

To perform a fair benchmark requiring a lot of preparation, as you need to know the detail of each product and set appropriate configuration. Recently, we got chance to do some internal testing. It’s experimental, as all tests were run within 1 box. We bind LSWS to 1 CPU, and leave another CPU to ab. The result here is good enough to make some points and may be useful to our users, so we would like to share in a series of blog posts first. Feel free to provide any feedback, so we can improve on our formal benchmark test later on.

In official site of Ruby Enterprise Edition, it compares REE with LiteSpeed 3.3.11 standard version (4-25-2008 released). According to the comparison, LiteSpeed is highest on memory usage. That test was flawed because each Ruby process occupies a lot of memory, and the default setting in LiteSpeed spawns 10 Ruby processes which are higher than that in other test cases. So the memory usage graph is basically illustrated how much memory Ruby processes used. Also in order to reduce the memory in real-time, the default setting also tries to destroy Ruby process whenever it is idle for a short time. This is not good for benchmark testing, as the server has to spend extra CPU in creating/destroying Ruby processes as this is not real-world scenario.

However, what we are interested here is “How about LiteSpeed + Ruby Enterprise Edition?

Test method is based on http://www.rubyenterpriseedition.com/comparisons.html

1. REE Saves Memory

LiteSpeed + Ruby Enterprise 165M
LiteSpeed + regular Ruby 264M
Memory Saving with REE (264 – 165) / 264 = 37.5%

This is close to “33% less memory on average” claimed by REE web site.

2. REE’s Copy-on-write Works with LiteSpeed

In order to test this, we manually enable/disable copy-on-write function by modifying lsws/fcgi-bin/RailsRunner.rb:

GC.copy_on_write_friendly = true|false

LiteSpeed + REE with Copy-on-Write 165M
LiteSpeed + REE without Copy-on-Write 234M
Memory Saving with Copy-on-Write (234 – 165) / 234 = 29~30%

Conclusion

Based on above simple tests, we recommend using REE with LiteSpeed.

Next, we’ll touch on another interesting topic “LiteSpeed vs Apache + Passenger vs Nginx + Passenger”.

Read the rest of this entry »

We did go to Hostingcon 09

August 28th, 2009

This is a delayed post. Yes, we did go to Hostingcon in DC this year. We first attended it on 07 at Chicago, when LSWS 3.0 released. Last year, we didn’t make it. This year, since in DC so close, we drove down directly.

Because of the conference, we had to delay our 4.0.10 release for a few days. We did not join the last evening session and went back directly to continue working on those 503 errors. Finally, after serveral round of build and test run on end users’ environment, 4.0.10 seems quite stable for now. We feel a little bit relief.

It was great pleasure that we were able to meet some LiteSpeed users there, all are very sharp, young and energetic guys. It’s nice feeling to work together with smart users. Well, I have to say all LiteSpeed users are smart …, they know that by using LiteSpeed actually save a lot for them, not only on support, maintenance, but also worries and sleepless night.

National Harbor has very good facility, still under development. While in DC, most places will have a name with “national”. We did not go around this time, since most places in DC we are pretty familiar. We just went out dining once at a local Thai restaurant, which kind of compensated all other junk food meals. Talking about food, George like Thai food a lot, of course, the best one we like still Chinese food, not American Chinese food, but genuine Chinese food. That’s why we already got our tickets to “Just EAT” on Sept. 21 in NYC – International Chinese Culinary Competition. You can watch them cook and taste at same time. If anyone in metropolitan area like authentic Chinese food, come and join us for fun!

Back to work, we will finish up a few to-dos for 4.0.x, and then will fully focus on 4.1RC2 release. Yes, new features will be added for RC2, but I’ll leave that for later post.

Going to switch this blog to wordpress

July 29th, 2009

Now it’s time to be more active on this blog site and put more useful stuff here, we decide to switch to wordpress.

Wordpress is easier and more popular than current RoR based Typo. Besides that, wordpress.org and wordpress.com still use LiteSpeed.

One funny site if you need a short break: icanhascheezburger.com

If you like gadgets, you may also like slashgear.com.

They are both LiteSpeed powered wordpress based sites. Some people may get confused by server header, you can read more info here. I guess this may due to no free version of LSLB.

Trouble Shooting for high load php driven site

July 22nd, 2009

Hello, everyone,

Time pasts so fast, it has been over 2 years since last blog post. Now we are back and will use this blog regularly. It’s good way to communicate with each other, as you, LiteSpeed users, may also wonder what we are doing.

Our daily life at LiteSpeed is very busy. Trouble shooting problematic server is a routine: if it is LiteSpeed related, we usually will fix it in a day or two and have a pre-release build for a particular client; many times it is not LiteSpeed bug, but configuration/tuning related.

We would like to post here and hopefully benefit others. Back to today’s story, one client report urgently:
> Server Load is very high

> Server configration : Opteron 8350 16 cores , 8gb ram , 300gb SA-SCSI 15.000 RPM .

> Look at top command output : Cpu idle %80 and MYSQL cpu very low %10 because database is a INNODB and very stable optimized.

> But load averega too high. and I can see Litespeed admin console — Realtime Stats too many EAWaitQ process (300-500 )

Logged to that server, did the following steps

  1. Top shows at the moment Server load is 75.
  2. Check what php is busy with.
    • ps -ef | grep php
    • find a php process with long CPU, for e.g. 2767.
    • strace -p 2767
    • from output, it is spending most of time cleaning up session files.
  3. Look at php session files, under /tmp/sess_*, too many cannot be displayed by ls directly.
    • find . | grep sess_ | wc, return count > 190K
    • check df, enough space left on file system.
    • Check phpinfo output, session auto start is off, no problem.
    • Move session path to tempfs:

      create a directory under /dev /shm/phpsess
      modify .htaccess under public_html/ of the problematic client, add php saved path /dev/shm/phpsess

  4. In a few minutes, got session write error.
    • Hit the limit of files that can be created under one directory of tempfs
    • use 2 directory level of php session files. (see details here)
  5. In a few minutes, got error again: “No space left on device”.
    • df -k , only use 1% of file system
    • df  -i, usage is 100%, used up all the inode.
    • Increase the inode limit:
      mount -o remount,nr_inodes=1G /dev/shm
      modify /etc/fstab mount, so next time server reboot will keep the change.
  6. Server load is around 3, no more errors.

Happy Ending for everyone. :)

Note here: strace is also quite useful for trouble shooting php script problem.

Using LiteSpeed Web Server for shared hosting environment

April 19th, 2007

LiteSpeed 3.0 release offer full compatibilities with commonly used web hosting control panels like cPanel, DirectAdmin and Plesk, etc.

We expect LiteSpeed will at least double the server capacity and reduce server load by 5-10 times when Apache was replace, just because of LiteSpeed’s high performance .htaccess implementation alone.

Hosting companies start to take advantage of this now.

[www.mediaLayer.com](http://www.medialayer.com), they even put up a press release [here](http://www.medialayer.com/pr.html).

Also, [www.eleven2.com](http://www.eleven2.com) starts to deploy LiteSpeed Web Server on their shared hosting servers with cPanel.

The feedbacks we got are all positive, pages get loaded faster, reduced memory usage and server load.

One of the feedback we got from one customer of eleven2.com, 30 minutes after the switch, the customer called eleven2, saying “What the crap, our site like a million times faster now!”, that’s a pretty large vBulletin forum. :-)

We expect to hear a lot more feedbacks like this. 8-)

Azureus/Zudeo and LiteSpeed

December 4th, 2006

A new and soon to be released product from LiteSpeed is part of the networking/application foundation for Zudeo. Azureus, the maker of the popular p2p file sharing client has officially lunched their attack on YouTube with Zudeo.

Check out the announcement coverage here:

[http://www.techcrunch.com/2006/12/03/azureus-launches-zudeo/](http://www.techcrunch.com/2006/12/03/azureus-launches-zudeo/)

On behalf of everyone at LiteSpeed, we wish the best for Zudeo.

If you are curious at what new LiteSpeed product Zudeo is using, please stay tuned. What we can say right now is that LiteSpeed is not just a web “server” company a full web “platform” company. Our new product will address the scalable needs for all web 2.0 startups at a decisive price-point that will turn heads.