Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Rest Api Performance Testing with JMeter and EC2
1. Case
Study
Rest
API
Performance
Testing
with
JMeter
on
EC2
Cloud
India
Office
Address:
Waviz
Tech.
(P)
Ltd.
D-77,
Bassment-8,
Sector-63,
Noida-201301
Phone:
+91-120-429-5252
|
www.waviz.com|
info@waviz.com
Objective:
To test the REST API’s performance, which is deployed on EC2 Cloud. To
perform ‘Stress Test’ on the server by simulating 5000 concurrent requests.
Why we have chosen JMeter:
The leader of the pack in awareness is probably Apache JMeter. This is an
open-source Java application whose key feature is a powerful and complete
GUI which you use to create test plans. A test plan is composed by test
components which define every piece of the test such as:
• Threads that are used to inject load
• Parametrizing HTTP requests used in the test
• Adding listeners, which are widget-like test components used to display
results in different ways
Before selecting a tool, keep in mind different parameters such as the tool
should be cost effective, easy to use, easy to configure & easily available third
party plug in, if needed. Here we will discuss JMeter as it has all the stated
features in it, as well as it has more support from well-established open
source community as compared to LoadUI. JMeter can be used to gather
information related to API request, response time of server & resource
utilization of server for a given number of threads in following ways:
Request/Response time of RESTful APIs
• TPS (transaction per second)
• Aggregate time of all virtual users
• Request-response time graph of APIs
• Active thread in a given time
• View results in tree (actual results will be shown)
2. Case
Study
Rest
API
Performance
Testing
with
JMeter
on
EC2
Cloud
India
Office
Address:
Waviz
Tech.
(P)
Ltd.
D-77,
Bassment-8,
Sector-63,
Noida-201301
Phone:
+91-120-429-5252
|
www.waviz.com|
info@waviz.com
Resource Utilization of Server
• Memory consumption
• CPU usage
• Network I/O
• Disk I/O etc
Pros:
• It’s the best tool for functional load testing. We can model
complex user flows, using conditions and also create assertions
to validate the behavior.
• It’s relatively easy to simulate non-trivial HTTP requests, such
as requests that require logging in before or file uploads.
• Very extensible. There is a large number of community plugins
to modify and extend the built-in behaviors
• Open source and free
Cons:
• The GUI has a steep learning curve. It’s bloated with options,
and there is a large number of concepts to learn before you can
run your first test.
• When testing with high loads, the workflow becomes
cumbersome. You will need to first use the GUI to generate the
XML test plan.
Challenges :
Request count > 1000, Single JMeter instance will not be sufficient. We need
JMeter cluster with multiple machine, we will use capabilities of JMeter
Distributed Tests which has some limitations also. JMeter uses RMI to
communicate in distributed environment but these connection require all
machines to be on the same subnet and this is not feasible with EC2
3. Case
Study
Rest
API
Performance
Testing
with
JMeter
on
EC2
Cloud
India
Office
Address:
Waviz
Tech.
(P)
Ltd.
D-77,
Bassment-8,
Sector-63,
Noida-201301
Phone:
+91-120-429-5252
|
www.waviz.com|
info@waviz.com
instances. Load Test becomes effective only when the load comes from
different IP Addresses similar to real world scenario and not from a single
source IP.
Implementation : Distributed Testing using JMeter on EC2
AWS
We have followed below implementation.
• Master : Which has controls and pass .jmx scripts. It may be JMeter
GUI or some EC2 node
• Slave : The EC2 instance having running JMeter server, which takes
commands from Master and send request to target.
• Target : The web server we plan to stress test.
• The idea is that we have 1 master instance that sends the test to 4
slaves. These slaves execute the test and send the results back to the
master who will collect and combine the results.
• Test will be executed on all 4 slave machines and not divided across
them.
4. Case
Study
Rest
API
Performance
Testing
with
JMeter
on
EC2
Cloud
India
Office
Address:
Waviz
Tech.
(P)
Ltd.
D-77,
Bassment-8,
Sector-63,
Noida-201301
Phone:
+91-120-429-5252
|
www.waviz.com|
info@waviz.com
EC2 Instances Set-Up:
We are using 5 EC2 instances (medium instances usually do the job) with
Ubuntu server.
Since we are using SSH tunnels to the slaves and we don’t know how long it
is going to take, so it’s a good idea to keep the SSH alive.
We can give those instances static IP addresses, and configure the hosts file
to use domain names. By doing so, we can create a central script to create
the tunnels every time you start the machines.
SSH Port Forward: JMeter will be configured to use the localhost IP (+ port) to
connect to the server. Based on the graph above, we need to create three
tunnels (2 outgoing, 1 incoming) for each slave.