Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing How Code Scales

I am currently working on some Ajax heavy code and I am wondering how my server will scale as more and more users (hopefully) start to use my web app. It is only on my internal test server for the moment and I was wondering how I would go about simulating a few hundred or thousand users so that I can see how it handles a heavier load. It is written in PHP/MySQL and I really didn't want to find hundreds of computers to set up and test manually :) Thanks in advance, any advice or direction is much appreciated.

like image 344
Blather Avatar asked Sep 05 '09 04:09

Blather


Video Answer


1 Answers

Apache Benchmark. It ships with Apache Web Server. Works kinda like this: For 100 requests using 10 concurrent threads, use this command:

ab -n 100 -c 10 http://localhost/

Replace the localhost url with a url that your AJAX code will be calling. The output will give you a nice report on how the requests were processed. Some of the interesting numbers are:

Complete requests
Failed requests
Requests per second
like image 171
Asaph Avatar answered Nov 15 '22 13:11

Asaph