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?
-
If you're in a rush use an online service – Drew Khoury Mar 13 '14 at 21:21
-
@DrewKhoury Can you explain more? What services are there? – bernie2436 Mar 13 '14 at 21:22
-
Search for something like "online load testing" and you should be spoilt for choice. I've used blitz in the past https://www.blitz.io/ – Drew Khoury Mar 13 '14 at 21:26
3 Answers
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.
- 4,569
- 8
- 26
- 28
Curl utility doesn't execute JavaScript I guess that you need something like N browsers which are accessing your site at the same time.
If you have enough hardware you can consider using Selenium Grid.
However AJAX requests can be still caught and replicated using lesser CPU/RAM consuming test tools like Apache JMeter. You can point browser to site under test through JMeter Proxy Server which will record all the requests including async JavaScript-driven and then replay the script with larger number of virtual users.
- 531
- 2
- 2
Or, consider the following commercial tools on a limited license basis
- SOASTA CloudTest lite. 100 threads, non expiring
- LoadRunner version 12 Community Edition. 50 Virtual Users, non expiring
If you have reached the point where the financial risk is sufficiently high to warrant performance testing then what you will find is that if you measure the financial impact of failure against even the most expensive commercial tools available that the cost of failure dwarfs the cost of any of the available market tools.
You can also still achieve a negative ROI with a free or open sourced tool if you give it to a person without the skills to achieve success, similar to handing the keys to an exotic italian sportscar to someone who doesn't believe in cars and who has ridden busses and trains their entire adult lives. Car very capable: Driver, not so much.
- 456
- 2
- 6