Designing Infrastructure for SlackerNews Launch
Background #
On Monday, I’m officially launching SlackerNews.io, the best of HackerNews, powered by artificial intelligence.
In this post I describe the steps I took to ensure the burst of activity on Monday morning would be handled gracefully.
Goal #
Support up to 5,000 users clicking once every 10 seconds, with a median load time below 1 second.
Throughput:
5,000*6 = 30,000 pages/min -> 500 pages/sec.
Median Load Time:
<1 second
Tools #
- jmeter - most established reputation, painful UI, steep learning curve to get a simple test running
- LoadImpact - SAAS provider, interesting platform, limited scope without subscribing. Initial results here
- pingdom - gives page load time information, but not load testing. Results
- Visual Studio Online Testing - easiest to get started with a simple test, more below
Test Details #
Test Actions #
Settings #
Original Hardware #
Specs #
Virtual Machine on Dedicated Hardware
CPU: Intel Xeon E5606 @2.13GHz
RAM: 3GB
OS: Windows Server 2012R2 Standard
Overall Results #
Looks like we need a new strategy for the minimized bundles included in MVC 4 by default
Avg page load times #
Saturated, climbed from 7 seconds up to 35 seconds per response
Throughput #
Way below target (500pages/sec): 20 requests/sec
New Hardware #
Specs #
AWS EC2 c4.large Instance:
CPU: 2vCPU Intel Xeon E5-2666 v3 (Haswell)
RAM: 3.75 GB
OS: Windows Server 2012R2
Overall Results #
Avg page load times #
205ms is amazing, this should load very well even on mobile
Throughput #
Excellent throughput, looks like reducing number of network requests by combining or offloading static contents will enable even higher page throughput
Server Stats #
Very low CPU usage, CPU looks over-spec
Summary #
Although it’s always good to have a healthy margin for PR events, we would probably be better served reducing the size of the instance, and consolidating or offloading static content (css, javascript, images, fonts).