Setup a Linux Server

Setup a Linux Server

Apache, Nginx, LiteSpeed, and Caddy

I often see many times in different forums, some of our support tickets, and so forth. What do I need to for my website? I want a VPS or Dedicated Server, but I don’t want to spend a lot of money, but dang I want it to handle my 7,938,093/hits a month site.

Quite often this is met with “Oh well you need, X, Y, and/or Z, that will be $199/month. This could not be further from the truth ( many times ). I want to dive into comparing different setups, control panels, configurations and more.

So here we go.

I decided to get a VPS with Linode. Why Linode? Well I have been using them for years and I like their services.

VPS Specs:

  • Shared CPU 1vCore
  • 2 GB’s RAM
  • 50 GB’s SSD
  • Ubuntu 20 / Alma Linux

Test Bench will be Apache Bench, with a simple command: ab -n 10000 -c 100 Site URL I will be using WordPress as the base for this test as 60% Plus of the internet is running this, so why not.

I will be running three tests, 1st on the main site, loading WordPress, 2nd against the main site but with the license.txt file, and 3rd the readme.html file. As I test, I will be using the same WordPress theme, the same site layout, the same content so we are not testing with very different sites.

  • Some notes, each site/setups will be defaults out of the box, then I will tweak WP a little, add some caching and rerun the tests.

So in no order here we go. First up is Apache. In this instance we are going to install cPanel as this is the most common control panel out there, and it uses Apache.

So here we go.

1st Test ** NO Cache: ab -n 10000 -c 100 https://cpaneltest.setupalinuxserver.com/

Server Software: Apache
Server Hostname: cpaneltest.setupalinuxserver.com
Server Port: 443
SSL/TLS Protocol: TLSv1.3,TLS_AES_256_GCM_SHA384,2048,256
Server Temp Key: X25519 253 bits
TLS Server Name: cpaneltest.setupalinuxserver.com

Document Path: /
Document Length: 96537 bytes

Concurrency Level: 100
Time taken for tests: 1338.416 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 969230000 bytes
HTML transferred: 965370000 bytes
Requests per second: 7.47 #/sec
Time per request: 13384.162 ms
Time per request: 133.842 [ms] (mean, across all concurrent requests)
Transfer rate: 707.19 [Kbytes/sec] received

Wow, that is awful, but again that is without any caching; so lets install a caching system and see.

Yeah, didn’t help at all.

Server Software: Apache
Server Hostname: cpaneltest.setupalinuxserver.com
Server Port: 443
SSL/TLS Protocol: TLSv1.3,TLS_AES_256_GCM_SHA384,2048,256
Server Temp Key: X25519 253 bits
TLS Server Name: cpaneltest.setupalinuxserver.com

Document Path: /
Document Length: 96537 bytes

Concurrency Level: 100
Time taken for tests: 1258.933 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 969910000 bytes
HTML transferred: 965370000 bytes
Requests per second: 7.94 #/sec
Time per request: 12589.331 ms
Time per request: 125.893 [ms] (mean, across all concurrent requests)
Transfer rate: 752.37 [Kbytes/sec] received

Well time to move onto the next test.

Lets now test html response.

ab -n 10000 -c 100 https://cpaneltest.setupalinuxserver.com/readme.html

Server Software: Apache
Server Hostname: cpaneltest.setupalinuxserver.com
Server Port: 443
SSL/TLS Protocol: TLSv1.3,TLS_AES_256_GCM_SHA384,2048,256
Server Temp Key: X25519 253 bits
TLS Server Name: cpaneltest.setupalinuxserver.com

Document Path: /readme.html
Document Length: 7399 bytes

Concurrency Level: 100
Time taken for tests: 11.269 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 77010000 bytes
HTML transferred: 73990000 bytes
Requests per second: 887.40 #/sec
Time per request: 112.688 ms
Time per request: 1.127 [ms] (mean, across all concurrent requests)
Transfer rate: 6673.73 [Kbytes/sec] received

So it looks like html files can do some butt kicking, 887/rps is nothing to sneeze it.

Now lets try .txt files.

ab -n 10000 -c 100 https://cpaneltest.setupalinuxserver.com/license.txt

Server Software: Apache
Server Hostname: cpaneltest.setupalinuxserver.com
Server Port: 443
SSL/TLS Protocol: TLSv1.3,TLS_AES_256_GCM_SHA384,2048,256
Server Temp Key: X25519 253 bits
TLS Server Name: cpaneltest.setupalinuxserver.com

Document Path: /license.txt
Document Length: 19531 bytes

Concurrency Level: 100
Time taken for tests: 10.109 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 198350000 bytes
HTML transferred: 195310000 bytes
Requests per second: 989.27 #/sec
Time per request: 101.085 ms
Time per request: 1.011 [ms] (mean, across all concurrent requests)
Transfer rate: 19162.20 [Kbytes/sec] received

Nice, almost 1000/rps that is nothing to really sneeze at. Lets now change things up, time to switch to Nginx. Same tests, lets see the results.

For this Nginx test, instead of building from scratch I am going to use a panel of sorts, WordOps, its a WordPress panel that from the command line installs and configures WordPress sites, really darn cool piece of software.

Time to format, and start over.

Same test, just changing the name from cpaneltest to nginx.setupalinuxserver.com

Server Software: nginx
Server Hostname: nginx.setupalinuxserver.com
Server Port: 443
SSL/TLS Protocol: TLSv1.2,ECDHE-ECDSA-AES256-GCM-SHA384,384,256
Server Temp Key: X25519 253 bits
TLS Server Name: nginx.setupalinuxserver.com

Document Path: /
Document Length: 97554 bytes

Concurrency Level: 100
Time taken for tests: 29.782 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 981780000 bytes
HTML transferred: 975540000 bytes
Requests per second: 335.77 #/sec
Time per request: 297.821 ms
Time per request: 2.978 [ms] (mean, across all concurrent requests)
Transfer rate: 32192.86 [Kbytes/sec] received

So yeah that was a crazy amount different, now lets try html and then txt from the same test

Server Software: nginx
Server Hostname: nginx.setupalinuxserver.com
Server Port: 443
SSL/TLS Protocol: TLSv1.2,ECDHE-ECDSA-AES256-GCM-SHA384,384,256
Server Temp Key: X25519 253 bits
TLS Server Name: nginx.setupalinuxserver.com

Document Path: /readme.html
Document Length: 146 bytes

Concurrency Level: 100
Time taken for tests: 22.981 seconds
Complete requests: 10000
Failed requests: 0
Non-2xx responses: 10000
Total transferred: 4470000 bytes
HTML transferred: 1460000 bytes
Requests per second: 435.13 #/sec
Time per request: 229.814 ms
Time per request: 2.298 [ms] (mean, across all concurrent requests)
Transfer rate: 189.95 [Kbytes/sec] received

Nice, even better, lets kill it on the txt file.

Server Software: nginx
Server Hostname: nginx.setupalinuxserver.com
Server Port: 443
SSL/TLS Protocol: TLSv1.2,ECDHE-ECDSA-AES256-GCM-SHA384,384,256
Server Temp Key: X25519 253 bits
TLS Server Name: nginx.setupalinuxserver.com

Document Path: /license.txt
Document Length: 146 bytes

Concurrency Level: 100
Time taken for tests: 23.019 seconds
Complete requests: 10000
Failed requests: 0
Non-2xx responses: 10000
Total transferred: 4470000 bytes
HTML transferred: 1460000 bytes
Requests per second: 434.43 #/sec
Time per request: 230.187 ms
Time per request: 2.302 [ms] (mean, across all concurrent requests)
Transfer rate: 189.64 [Kbytes/sec] received

Not a ton difference but a little tiny improvement.

Now onto Litespeed. Same three tests.

Server Software: LiteSpeed
Server Hostname: cyber.setupalinuxserver.com
Server Port: 443
SSL/TLS Protocol: TLSv1.2,ECDHE-ECDSA-AES128-GCM-SHA256,256,128
Server Temp Key: X25519 253 bits
TLS Server Name: cyber.setupalinuxserver.com

Document Path: /
Document Length: 96460 bytes

Concurrency Level: 100
Time taken for tests: 8.271 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 971140000 bytes
HTML transferred: 964600000 bytes
Requests per second: 1209.01 #/sec
Time per request: 82.712 ms
Time per request: 0.827 [ms] (mean, across all concurrent requests)
Transfer rate: 114659.92 [Kbytes/sec] received

Cheese and Rice!!! 1200/rps!!!

Now for .html test

Server Software: LiteSpeed
Server Hostname: cyber.setupalinuxserver.com
Server Port: 443
SSL/TLS Protocol: TLSv1.2,ECDHE-ECDSA-AES128-GCM-SHA256,256,128
Server Temp Key: X25519 253 bits
TLS Server Name: cyber.setupalinuxserver.com

Document Path: /readme.html
Document Length: 7399 bytes

Concurrency Level: 100
Time taken for tests: 7.100 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 78180000 bytes
HTML transferred: 73990000 bytes
Requests per second: 1408.41 #/sec
Time per request: 71.002 ms
Time per request: 0.710 [ms] (mean, across all concurrent requests)
Transfer rate: 10752.88 [Kbytes/sec] received

And on to .txt

Server Software: LiteSpeed
Server Hostname: cyber.setupalinuxserver.com
Server Port: 443
SSL/TLS Protocol: TLSv1.2,ECDHE-ECDSA-AES128-GCM-SHA256,256,128
Server Temp Key: X25519 253 bits
TLS Server Name: cyber.setupalinuxserver.com

Document Path: /license.txt
Document Length: 19915 bytes

Concurrency Level: 100
Time taken for tests: 7.329 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 203360000 bytes
HTML transferred: 199150000 bytes
Requests per second: 1364.49 #/sec
Time per request: 73.287 ms
Time per request: 0.733 [ms] (mean, across all concurrent requests)
Transfer rate: 27098.00 [Kbytes/sec] received

So lets do some math here. 100 Concurrent users, so thats a lot for a site.

With Apache/cPanel

7.94/s = 476.4/m = 28,584/h = 686,016/d

With Nginx

335.77/s = 20,146.2/m = 1,208,772/h = 29,010,528/d

LiteSpeed

1209/s = 72,540/m = 4,352,400/h = 104,457,600/d

Interestingly lets look at some super crazy numbers, say your running LiteSpeed, and your maxing out the VPS 24/7. Thats 38.1 Billion views/year to your website on a $12/month VPS. Now don’t get me wrong, I am sure you going to want to upgrade if your truly hitting that kind of traffic, but still it shows you the power of your choice in Web Servers.

So that really is nothing to sneeze at.

Apache, Nginx, LiteSpeed, and Caddy
Scroll to top