Is it possible to use curl to accurately stress test a site that has lots of javascript

curlperformancestress-testing

I have a web site that has lots of javascript but simple html. I want to try simple stress tests with curl. Is that possible? If I just curl the site I get HTML. So making tons of curl requests won't really tell me how it performs at certain rates of traffic. (I know there are 1000s of complex frameworks and methods for stress testing — and I'm excited to learn them. But for now I need something quick and dirty because the web site will get a lot of traffic in a few days.) Is there any way to use CURL to test a javascript-intensive site?

Best Answer

You're right, curl won't browse your website like a real user with a real browser so you'll need something else (if you care about that differentiation).

Remember that JS executes in the browser so this won't necessarily add load to your server (this of course depends on if your JS invokes a call to the server to do more work, like an ajax call). Do you care about what happens once the page hits the user, or are you testing the performance of your server? Either way, you have a few options for performance/load testing.

You could use something like phantomjs (useful if you need that fully rendered webpage, or you need to interact with the JS...this gives you what curl can't), but even then you won't be able to easily simulate lots of users from different locations.

phantomjs.org/ PhantomJS is a headless WebKit scriptable with a JavaScript API. It has fast and native support for various web ...

You could look into beezwithmachineguns but that would probably require modification to properly load the JS like a real browser would.

Since you don't have the time, try an online service that already does what you want. I've used https://www.blitz.io/ in the past and since it's software as a service there's nothing to download or configure so it's easy and painless to get going.