Apache vs LiteSpeed
Over the last year or so the LiteSpeed Web Server http://www.litespeedtech.com has been gaining popular followings for its drop in and replace Apache.
I have found myself wondering if it really is a 1 LSWS = 2 AWS, so I setup a little test. Now a few things here please. This is older hardware and the tests will be even better on todays new servers, but you get the idea.
Test Server.
AMD 1666 GHz
512 MB RAM
80GB IDE HD
Centos 4.4
Apache 2.0.52 / LiteSpeed 3.0 Standard Edition
Client Machine
Intel 3.0 HT
2GB RAM
80GB HD
Ubuntu 8.04
Network
100Mbit Direct Connect over Cat5
I ran three tests of each file and took the best results.
Test 1. 100.html
This is a test page
Test 2. hello.php
echo "Hello World";
?>
Test 3. mysql_ver.php
$link = mysql_connect('localhost', 'username', 'password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
printf("MySQL server version: %s\n", mysql_get_server_info());
?>
Test 4. info.php
phpinfo();
?>
Each test was run with only 10 connections and 1000 requests. I decided to only do this, as I would be happy to play with the numbers and connections but the results I was getting was truly amazing; and I felt that I did not need to prove even more how awesome LiteSpeed is.
Test Results.
Test 1.
Server Software: Apache/2.0.52
Server Hostname: 192.168.1.200
Server Port: 80
Document Path: /server/100.html
Document Length: 102 bytes
Concurrency Level: 10
Time taken for tests: 0.899083 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 351000 bytes
HTML transferred: 102000 bytes
Requests per second: 1112.24 [#/sec] (mean)
Time per request: 8.991 [ms] (mean)
Time per request: 0.899 [ms] (mean, across all concurrent requests)
Transfer rate: 380.39 [Kbytes/sec] received
Server Software: LiteSpeed
Server Hostname: 192.168.1.200
Server Port: 80
Document Path: /server/100.html
Document Length: 102 bytes
Concurrency Level: 10
Time taken for tests: 0.220151 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 339000 bytes
HTML transferred: 102000 bytes
Requests per second: 4542.34 [#/sec] (mean)
Time per request: 2.202 [ms] (mean)
Time per request: 0.220 [ms] (mean, across all concurrent requests)
Transfer rate: 1503.51 [Kbytes/sec] received
Test 2.
Server Software: Apache/2.0.52
Server Hostname: 192.168.1.200
Server Port: 80
Document Path: /server/hello.php
Document Length: 11 bytes
Concurrency Level: 10
Time taken for tests: 1.456517 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 188000 bytes
HTML transferred: 11000 bytes
Requests per second: 686.57 [#/sec] (mean)
Time per request: 14.565 [ms] (mean)
Time per request: 1.457 [ms] (mean, across all concurrent requests)
Transfer rate: 125.64 [Kbytes/sec] received
Server Software: LiteSpeed
Server Hostname: 192.168.1.200
Server Port: 80
Document Path: /server/hello.php
Document Length: 11 bytes
Concurrency Level: 10
Time taken for tests: 0.772869 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 175350 bytes
HTML transferred: 11022 bytes
Requests per second: 1293.88 [#/sec] (mean)
Time per request: 7.729 [ms] (mean)
Time per request: 0.773 [ms] (mean, across all concurrent requests)
Transfer rate: 221.25 [Kbytes/sec] received
Test 3.
Server Software: Apache/2.0.52
Server Hostname: 192.168.1.200
Server Port: 80
Document Path: /server/mysql_ver.php
Document Length: 31 bytes
Concurrency Level: 10
Time taken for tests: 2.297821 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 208000 bytes
HTML transferred: 31000 bytes
Requests per second: 435.19 [#/sec] (mean)
Time per request: 22.978 [ms] (mean)
Time per request: 2.298 [ms] (mean, across all concurrent requests)
Transfer rate: 88.34 [Kbytes/sec] received
Server Software: LiteSpeed
Server Hostname: 192.168.1.200
Server Port: 80
Document Path: /server/mysql_ver.php
Document Length: 31 bytes
Concurrency Level: 10
Time taken for tests: 1.255216 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 195195 bytes
HTML transferred: 31031 bytes
Requests per second: 796.68 [#/sec] (mean)
Time per request: 12.552 [ms] (mean)
Time per request: 1.255 [ms] (mean, across all concurrent requests)
Transfer rate: 151.37 [Kbytes/sec] received
Test 4.
Server Software: Apache/2.0.52
Server Hostname: 192.168.1.200
Server Port: 80
Document Path: /server/info.php
Document Length: 39455 bytes
Concurrency Level: 10
Time taken for tests: 4.261630 seconds
Complete requests: 1000
Failed requests: 3
(Connect: 0, Length: 3, Exceptions: 0)
Write errors: 0
Total transferred: 39611985 bytes
HTML transferred: 39454985 bytes
Requests per second: 234.65 [#/sec] (mean)
Time per request: 42.616 [ms] (mean)
Time per request: 4.262 [ms] (mean, across all concurrent requests)
Transfer rate: 9077.04 [Kbytes/sec] received
erver Software: LiteSpeed
Server Hostname: 192.168.1.200
Server Port: 80
Document Path: /server/info.php
Document Length: 23470 bytes
Concurrency Level: 10
Time taken for tests: 3.738362 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 23635368 bytes
HTML transferred: 23491224 bytes
Requests per second: 267.50 [#/sec] (mean)
Time per request: 37.384 [ms] (mean)
Time per request: 3.738 [ms] (mean, across all concurrent requests)
Transfer rate: 6174.09 [Kbytes/sec] received
Now it is very interesting to me the differences in the response.
The short view
Test 1. 100.html
Apache 1112.24 [#/sec] (mean)
LiteSpeed 4542.34 [#/sec] (mean)
408% Faster
Test 2. hello.php
Apache 686.57 [#/sec] (mean)
LiteSpeed 1293.88 [#/sec] (mean)
188.4% Faster
Test 3. mysql_ver.php
Apache 435.19 [#/sec] (mean)
LiteSpeed 796.68 [#/sec] (mean)
183.0% Faster
Test 4. info.php
Apache 234.65 [#/sec] (mean)
LiteSpeed 267.50 [#/sec] (mean)
113.9$ Faster
So as you can see the LiteSpeed Web Server out performed Apache Web Server in every single test. What is a interesting find to me is that example the info.php file which is 100% PHP Engine the servers did not make that much of a difference. Now I understand that the PHP Engines speed comes from the server and not from the web server. However it still tells me it is faster.
So is the LiteSpeed Web Server faster then the Apache Web Server. In these tests I would have to say heck yes. This LSWS has several very easy drop ins for replacing Apache in todays cPanel, DirectAdmin, Plesk, and others.
For the sake if it I just ran a few more little tests on the static content.
Server Software: LiteSpeed
Server Hostname: 192.168.1.200
Server Port: 80
Document Path: /server/100.html
Document Length: 102 bytes
Concurrency Level: 50
Time taken for tests: 2.211605 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 3390000 bytes
HTML transferred: 1020000 bytes
Requests per second: 4521.60 [#/sec] (mean)
Time per request: 11.058 [ms] (mean)
Time per request: 0.221 [ms] (mean, across all concurrent requests)
Transfer rate: 1496.65 [Kbytes/sec] received
Server Software: LiteSpeed
Server Hostname: 192.168.1.200
Server Port: 80
Document Path: /server/100.html
Document Length: 102 bytes
Concurrency Level: 100
Time taken for tests: 2.179991 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 3390000 bytes
HTML transferred: 1020000 bytes
Requests per second: 4587.17 [#/sec] (mean)
Time per request: 21.800 [ms] (mean)
Time per request: 0.218 [ms] (mean, across all concurrent requests)
Transfer rate: 1518.35 [Kbytes/sec] received
Server Software: LiteSpeed
Server Hostname: 192.168.1.200
Server Port: 80
Document Path: /server/100.html
Document Length: 102 bytes
Concurrency Level: 150
Time taken for tests: 2.210094 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 3390000 bytes
HTML transferred: 1020000 bytes
Requests per second: 4524.69 [#/sec] (mean)
Time per request: 33.151 [ms] (mean)
Time per request: 0.221 [ms] (mean, across all concurrent requests)
Transfer rate: 1497.67 [Kbytes/sec] received
So as you can see for static content, it looks like I am capping out this bench servers at 4500 Requests per second. I would love to see what a RAID1 SCSI system could do with this. If you have a chance check out the specs of this product.
http://www.litespeedtech.com