Blog

Network Throttling using Jmeter

How to test Performance of the application for different network speeds using Jmeter.

Jmeter contains a interesting parameter called ‘CPS’ which simulate required network speed. CPS is defined as ‘Characters per second’. It contains a simple logic to extract value for CPS based on the network speed.

Jmeter.properties file contains two parameters as follows

#httpclient.socket.http.cps=0
#httpclient.socket.https.cps=0

cps are calculated using

cps = (target brandwidth in kbps * 1024 ) / 8

Once you have define the value which need to be used, run the test using non-gui mode as below (Example to use Mobile HSPA+ network).

jmeter -n -t C:\testplan\SC01.jmx -j C:\results\Mobile_HSPAPlus_log.log -l C:\results\Mobile_HSPAPlus_csv.jtl -Jhttpclient.socket.https.cps=2688000
jmeter -n -t C:\testplan\SC01.jmx -j C:\results\Mobile_EDGE_log.log -l C:\results\Mobile_EDGE_csv.jtl -Jhttpclient.socket.https.cps=49152

Run the command line on each injector with the different network speeds.

once the test is completed, upload the resuls to JAnalyser and apply global filters to each Injector ID to get the aggregate summary for each network speed.

Note: Make sure that you have enable hostname (jmeter.save.saveservice.hostname=true) in jmeter.properties file

Following are few examples for the network speed values for cps. (Thanks to Antonio Gomes Rodrigues)

Values to set for different networks

Network bandwidth

cps value

 

Mobile data GPRS : 171 kbit/s

21888

 

Mobile data EDGE : 384 kbit/s

49152

 

Mobile data HSPA : 14,4 Mbp/s

1843200

 

Mobile data HSPA+ : 21 Mbp/s

2688000

 

Mobile data DC-HSPA+ : 42 Mbps

5376000

 

Mobile data LTE : 150 Mbp/s

19200000

 

WIFI 802.11a/g : 54 Mbit/s

6912000

 

WIFI 802.11n : 600 Mbit/s

76800000

 

Ethernet LAN ; 10 Mbit/s

1280000

 

Fast Ethernet : 100 Mbit/s

12800000

 

Gigabit Ethernet : 1 Gbit/s

128000000

 

10 Gigabit Ethernet : 10 Gbit/s

1280000000

 

100 Gigabit Ethernet : 100 Gbit/s

12800000000

 

WAN modems V.92 modems : 56 kbit/s

7168

 

ADSL : 8 Mbit/s

1024000

 

ADSL2 : 12 Mbit/s

1536000

 

ADSL2+ : 24 Mbit/s

3072000