Performance Testing - 2
Performance Testing - 2
bear the load. It can analyse the system’s performance under high load. Jmeter
performance testing offers various benefits like it can be used to test the performance of
both static and dynamic resources.
Dynamic resources can be JSP, Servlets and AJAX. Static resources can be Javascript
and HTML.
There are two kinds of web application testing done using Jmeter:
1. Load Application Testing: The process is mainly used to predict the expected
usage by simulating various conditions.
2. Stress Application Testing: Be it any web application the architecture of it can only
support a certain number of users at a time. With the help of stress testing load above
this capacity will be given on the server after which it behaves weirdly. By doing so,
maximum load the web server can handle can be found out.
This can be understood in a much better way by below diagram:
Let’s test the Google website for 1000 users with the help of Jmeter.
Add Thread Group
First, start the JMeter application and click on test plan option on the
dashboard. Click on add option and then Thread(Users). Afterwards, click on
Thread Group.
The Flow would be:
Add -> Threads (Users) -> Thread Group
Enter thread properties in the thread group control panel. You have to enter a certain
number of things like:
Number of Threads: Number of users which you want to target to the target website. For
example, here we will use 100
Loop Count: 10 (Number of times to execute testing)
Ramp-Up Period: 100 (It is the delay which Jmeter has to wait before starting the next
user). 100 seconds is the time which we have used.
Now, you must be confused between thread count and loop count. It is very easy to
understand.
Thread count means how many concurrent users Jmeter will create to connect to the
web server.
Loop count would be the number of times, Jmeter would simulate one user connecting
to the target server.
Suppose in the above example: Jmeter would create 100 concurrent users connecting
to the server while one user would be connecting to the server 10 number of times.
2. HTTP request
You can add this element to the thread group by following below path:
Add -> Sampler -> HTTP Request.
Now, in the control panel of the HTTP request, you have to enter the URL request
you want to send to Google. If you give the command as “calendar” in path field, Jmeter
will send request http://www.google.com/calendar to google server. If you will keep it
blank then send request http://www.google.com/ to google server.
Throughput is the ability of the application to handle a heavy load. Throughput should
be very high ideally. Deviation indicated deviation from average. It should be very low.
In the above graph, throughput is 867/minutes. It means this server can handle 867
requests per minute. This data is of yahoo website. While if you will test Google.com
then you see throughput is 1000/ minute. Google has higher throughput than yahoo.
These parameters can vary on other factors also. Which include internet speed at
JMeter site, current server load at google server, your CPU power and many others. It’s
not necessary that you will get the same results every time as they can vary because of
other factors.
Conclusion
So start the web application testing using Jmeter and see how much load one website
can handle. In this way, you can see why your site stops responding and one of the
reasons can be low load-bearing capacity.
If you had some difficulty while doing the above test then try to not connect to the
internet via a proxy. If you are connecting through a proxy then don’t connect via that.
Try opening a new JMeter instance and then try to run the test.
By following these you would be able to run the test cases with Jmeter. So, keep doing
performance testing with JMeter and make your site less prone to vulnerable attacks. All
the best!!