Home » Offload Resource Intensive Scripts to Improve Server Performance

Offload Resource Intensive Scripts to Improve Server Performance

Summary:

This article shows how offloading resource intensive scripts can significantly improve web server performance. By offloading the Web Page Analyzer script to a separate server, we improved response times by over 98%, improved throughput by a factor of 40, and significantly reduced response time variability.

In a previous speed tweak we showed how upgrading our web server to a solid state drive and faster processors improved response times by 35% to 50%. With the Web Page Analyzer on the same server, the average response time was 11.87 seconds with typical response times after ramp-up ranging from 23 to 36 seconds. While this was an improvement over the old server, there were still response time and availability issues caused by hosting the analyzer script on the same server. This article shows how offloading a resource intensive script can dramatically improve your server response times.

Baseline Server Before Offloading Script

Our upgraded server improved performance measurably, but users still experienced some slowdowns from the load on our free Web Page Analyzer script. The free script, which analyzes web pages for size and download speed, typically gets 2.2 to 3 times the traffic than our home page receives and is resource intensive. By offloading the script to a separate server, we thought we could reduce the delays users were experiencing due to memory and CPU usage. The upgraded server had the following specifications:

Upgraded Dedicated Server Specifications (WebsiteOptimization.com)

Processor: Dual Xeon E5310 Quad Core (Clovertown)
Memory: 4GB DDR Registered ECC Hd1 RAM
Drives: Dual 32GB SSD (solid state drives) Hardware Raid 1
Hd2: 120GB 7200RPM SATA / 8MB Cache RemoteBackup
OS: Linux – CentOS 4 (+64 Bit)

This new server setup benchmarked as follows (see Figure 1).

Figure 1: Response Time Graph – After Server Upgrade, Before Offloading Script

pylot response time graph after server upgrade before offload
Response Time (secs)
avg 11.87
stdev 14.74
min 0.08
50th % 0.77
80th % 27.31
90th % 35.05
95th % 36.16
99th % 39.02
max 47.86

Figure 1 shows the results from Pylot load testing the new server by ramping up responses per second and agents. The response time averaged 11.87 seconds, and once ramped up to 2 or more requests per second the response time averaged about 30 seconds (from 23 to 36 seconds), which is about 36% faster than the old server. The 95% decile response time was 36.16 seconds (25.6% faster than the old server) with a maximum response time of 47.86 seconds (the old ATA-based server had 95% decile response time of 48.6 seconds and the maximum response time was 53.4 seconds), Figure 2 shows the corresponding throughput for the benchmark test of the new server.

Figure 2: Throughput Graph – After Server Upgrade, Before Offloading Script

pylot throughput graph after server upgrade before offload
Throughput (requests/second)
avg 0.97
stdev 1.38
min 0
50th % 1
80th % 2
90th % 3
95th % 4
99th % 6
max 7

After Offloading Resource Intensive Script

To reduce response times even further and make them more consistent (and more “attunable”) we offloaded the Web Page Analyzer script to a separate dedicated server. The gateway form for the analyzer still resides on the WSO server, but the heavy lifting is done on a separate server referenced at a subdomain. Now the WebsiteOptimization.com server proper hosts mainly content, contact scripts, and some blogs based on Movable Type. After moving the script, the WSO server benchmarked as follows (see Figure 3):

Figure 3: Response Time Graph – After Offloading Script

pylot response time graph after offload
Response Time (secs)
avg 0.14
stdev 0.08
min 0.03
50th % 0.14
80th % 0.16
90th % 0.19
95th % 0.27
99th % 0.42
max 1.53

Figure 3 shows that the average response time dropped 98.8% from 11.87 seconds to 0.14 seconds. After ramp-up, typical response times ranged from 0.2 to 0.9 seconds with a maximum of 1.53 seconds. The 95% decile dropped from 36.16 seconds to 0.27 seconds, or 99.2% faster.

Improvement in Throughput (Requests per Second)

Figure 4 shows the corresponding throughput for the benchmark test of the new server after offloading the script.

Figure 4: Throughput Graph – After Ofloading Script

pylot throughput graph after offload
Throughput (req/sec)
avg 141.12
stdev 29.99
min 8
50th % 153
80th % 157
90th % 159
95th % 160
99th % 162
max 163

Throughput improved from an average of 0.97 requests per second (95% decile of 4 requests per second) to an average of 141 requests per second (95% decile of 160 requests per second after ramp-up). The new average throughput of 141 requests per second is 145 times the old throughput of 0.97, and after ramp-up the typical throughput jumped by a factor of 40 (160/4).

Conclusion

This article shows how offloading resource intensive scripts can significantly improve web server performance. By offloading the web page analyzer script to a separate server, we were able to improve response times by over 98%, and throughput by a factor of 40. Attunability was improved by reducing the standard deviation of response times from 14.7 seconds to .08 seconds.

Futher Reading

Get a Dedicated Server Hosting Your Web Site
Upgrading to your own server improves performance, reliability, and control over your website. Andy King talks about his experience moving to a dedicated server for WebSiteOptimization.com.
Speed Tweak, Oct. 4, 2004.
Pylot
HTTP Load Tester used to analyze WebsiteOptimization.com server.
Server Optimization Article Archive
Some Speed Tweaks for web servers from WebsiteOptimization.com.
Solid-State Drive Web Server Test
This article tests the upgraded WSO server before offloading the analyzer script. Upgrading our dedicated server to solid-state drives and faster processors improved performance by 35% to 50%.
Web Performance Optimization Section Summary
Summary of introduction to web performance section of Website Optimization Secrets book from O’Reilly.

Leave a Comment