Share this page : facebooktwitterlinkedinmailfacebooktwitterlinkedinmail

Before setting up a web server, you probably need to plan the performance of the server, such as the amount of RAM, the type of CPU to choose, and the number of server in a cluster for a website. Before that, you can set up a server for pressure testing, then determine the number of server in the cluster.

Jmeter is a good software for this purpose.

Steps to install Jmeter.
  1. Download/ update Java on your system
  2. Download Apache jmeter from official website.
  3. Unzip to a location you like
  4. Start Jmeter: windows, Jmeter>BIN>Jmeter.bat ; MAC, open terminal , CD to the location in step 3. Jmeter>BIN> use command: sh jmeter.sh
http traffic test on web server

1.  Create a thread group: 

Right click the Test Plan > ADD > Threads(users) >Thread Group. Then configure the parameters: Thread number, which is mimic the number of users, Ramp-Up period, The ramp-up in the Thread Group is the time JMeter should take to start the total number of threads.

Number of Threads (users): 100
Ramp-up Period (in seconds): 10
Loop Count : Forever

In the example above this means that every 0.1 second a new thread starts giving 100 running threads after 10 seconds. These 100 threads perform your test iterations back-to-back, so after the ramp-up 100 threads run continously for the duration of the test.

2. Create a http request sample:

With click Threads > Add > Sampler > HTTP Request.

The parameters to configure include Server name or IP, port number, protocol, method, etc.

  • The server name or IP is the url or IP address,
  • port number is usually 80 for protocol http, or 443 for protocol https,
  • method is GET for visiting. If you want to test the performance for submitting data, such as you have some form on website to fill and submit, POST should be used.

3. Add listener ( report)

By now you can click start, but you can not see any report about the test. To add the result listener, right click HTTP Request > Add > Listener > Summary Report, Graph Results, View Results in Table, or View Results Tree are the popular ones.