The Setup
Both server were set up on a t2.micro available form Amazon's AWS under the free tier. The t2.micro is one single core vCPU with 1 GiB ram and up to 30GiB storage. The Windows server was running Windows Server 2016 (ami-c9deafb1) with IIS, asp.net enabled and MySQL Community Edition installed. While the Linux server was set up on Debian 9.4 with Nginx, FastCGI Mono Server and MySQL installed. FastCGI Mono Server was installed as a systemd service to start on boot and restart on failure. The web application used was a shopping site home page with master page. The site accesses the database, pulls 50 item to display and renders it in html.
*** Nginx configuration snippet ***
server { listen 80; ... location / { index index.html index.htm default.aspx Default.aspx; fastcgi_index Default.aspx; fastcgi_pass 127.0.0.1:9000; include /etc/nginx/fastcgi_params; } ... }
*** /etc/systemd/system/fastcgi-mono.service **
[Unit] Description=Mono FastCGI Wants=network.target [Service] Type=simple User=www-data Group=www-data ExecStart=/usr/bin/fastcgi-mono-server4 /applications=/:/var/www/cscd379/ /socket=tcp:127.0.0.1:9000 Restart=on-failure [Install] WantedBy=multi-user.target
The Tests
Testing was conducted with ApacheBench (ab) to the loopback address (IPv4) on both systems. Each testing cycle consisted of 1,000 connections and the test were repeated five times. Testing was completed in both a linear fashion and 10 concurrent connections. All other setting were left to the defaults.
The Results
The Linux server running a FastCGI Mono Server was capable of handling an average of 50.09 linear connections and a minor drop to 48.026 concurrent connections. Windows Server 2016 and IIS was only capable of processing an average of 36.278 linear and 38.104 concurrent connections. That computes to a 38% increase in linear connections and 26% increase in concurrent connections for Mono over IIS.
Total time per request shows similar results to connections per second. FastCGI Mono Server averages a total connection time of 19.965 and 20.8276 linearly and concurrently respectfully. IIS's results were 27.5998 and 26.2498.
Total time per request shows similar results to connections per second. FastCGI Mono Server averages a total connection time of 19.965 and 20.8276 linearly and concurrently respectfully. IIS's results were 27.5998 and 26.2498.
Analysis
Both servers only have access to one single code vCPU so it was expected to see some variation between linear and concurrent connections. What wasn't expected was is the slight performance increase that IIS obtained with concurrent connections. However that was only an average of a 5% increase in performance and in one test the performance is the same. FastCGI Mono Server acted as expected with concurrent connections on a single core an average loss of 2% in performance was seen.
Recommendations
Further testing should be conducted to see how well the performance boost scales onto larger servers and in production environments. That being said FastCGI Mono Server is a viable option that can increase web server performance. Combined with the cost savings and increased security associated with Linux servers running a FastCGI Mono Server is preferable over IIS.
Data
Request per second | ||||
Test # | Nginx & Mono FastCGI | Windows Server 2016 | Nginx & Mono FastCGI concurrent | Windows Server 2016 concurrent |
1 | 50.85 | 33.97 | 47.42 | 37.60 |
2 | 50.32 | 36.32 | 47.19 | 38.12 |
3 | 49.19 | 36.70 | 48.69 | 37.74 |
4 | 50.00 | 36.53 | 47.95 | 39.19 |
5 | 50.09 | 37.87 | 48.88 | 37.87 |
AVG | 50.09 | 36.278 | 48.026 | 38.104 |
Time per Request (ms) | ||||
Test # | Nginx & Mono FastCGI | Windows Server 2016 | Nginx & Mono FastCGI concurrent | Windows Server 2016 concurrent |
1 | 19.659 | 29.437 | 21.090 | 26.594 |
2 | 19.875 | 27.531 | 21.193 | 26.234 |
3 | 20.328 | 27.250 | 20.540 | 26.500 |
4 | 19.998 | 27.375 | 20.856 | 25.515 |
5 | 19.965 | 26.406 | 20.459 | 26.406 |
AVG | 19.965 | 27.5998 | 20.8276 | 26.2498 |