Ask HN: Load testing a site
4 comments
I use Apache jmeter, which is free. Alternative a simple nodejs script. It's possible to saturate my laptop simply because any outgoing request has a cost (CPU, bandwidth, writing results to disc) and I wouldn't be able to simulate 100k users. For most cases and a piece of mind that the website doesn't break under load it's fine.
Those services do just that: send requests to a specified URL. Some can play whole scenarios (logging in, setting cookies etc). The power is in the reports they create and the convenience of an easy (repeatable, shareable) setup. You may or may not need to simulate users from across the globe or users with slow connections or certain browsers.
If possible have a second setup of your website for testing. This makes sure you don't pollute your production logfiles or affect real users.
Those services do just that: send requests to a specified URL. Some can play whole scenarios (logging in, setting cookies etc). The power is in the reports they create and the convenience of an easy (repeatable, shareable) setup. You may or may not need to simulate users from across the globe or users with slow connections or certain browsers.
If possible have a second setup of your website for testing. This makes sure you don't pollute your production logfiles or affect real users.
As you say the problem with testing from a single laptop, or desktop system, is that your outbound pipe will get saturated.
If you want to do distributed testing you can rent a couple of virtual machines from Amazon, etc, and run tsung to test from a cluster:
http://brightbox.com/blog/2014/11/07/distributed-load-testin...
If you want to do distributed testing you can rent a couple of virtual machines from Amazon, etc, and run tsung to test from a cluster:
http://brightbox.com/blog/2014/11/07/distributed-load-testin...
For basic load-testing Httperf and Apache Benchmark are nice. If you want more complicated stuff (really simulating a user taking actions on your site) I'd recommend leveraging Selenium or even plain PhantomJS (setup a separate server to spawn those processes and hit your main site).
And yes, it will stress whatever site you're testing. In most cases, you'll want to setup another site (make it an exact replica of your main site) and direct your load tests to hit that alternate site instead.
And yes, it will stress whatever site you're testing. In most cases, you'll want to setup another site (make it an exact replica of your main site) and direct your load tests to hit that alternate site instead.
Apache jmeter is a good choice but a little more complicated. If you need something simpler for a start (as I did) go for adb (Apache benchmark) which is a command line tool
Also, I'm not sure what are you doing but 100k simultaneous user seems like a lot, only way I can think about testing that is to get a few AWS instances and running ab or meter from them...
Also, I'm not sure what are you doing but 100k simultaneous user seems like a lot, only way I can think about testing that is to get a few AWS instances and running ab or meter from them...
For load test I use blitz.io, they have a great interface, live stats and can handle up to 200k concurrent users. You'll get 10 free credits every month for tests.
Also, a very noob question but how do these services work ? I mean if I do the testing, does it stress my actual production servers ? If yes, then my site could go down while testing right ? or do I make a copy of everything for testing ?