Book Image

Performance Testing with JMeter 2.9

By : Bayo Erinle
Book Image

Performance Testing with JMeter 2.9

By: Bayo Erinle

Overview of this book

Performance testing with JMeter 2.9 is critical to the success of any software product launch and continued scalability. Irrespective of the size of the application's user base, it's vital to deliver the best user experience to consumers. Apache JMeter is an excellent testing tool that provides an insight into how applications might behave under load enabling organizations to focus on making adequate preparations. Performance Testing with JMeter 2.9 is a practical, hands-on guide that equips you with all the essential skills needed to effectively use JMeter to test web applications using a number of clear and practical step-by-step guides. It allows you take full advantage of the real power behind Apache JMeter, quickly taking you from novice to master. Performance Testing with JMeter 2.9 begins with the fundamentals of performance testing and gets you acquainted with JMeter. It will guide you through recording realistic and maintainable scripts. You will acquire new skills working with tools such as Vagrant, Puppet, and AWS, allowing you to leverage the cloud to aid in distributed testing. You will learn how to do some BeanShell scripting and take advantage of regular expressions, JMeter properties, and extension points to build comprehensive and robust test suites. Also, you will learn how to test RESTful web services, deal with XML, JSON, file downloads/uploads, and much more. Topics like resource monitoring, distributed testing, managing sessions, and extending JMeter are also covered. Performance Testing with JMeter 2.9 will teach you all you need to know to take full advantage of JMeter for testing web applications, dazzle your co-workers, and impress your boss! You will go from novice to pro in no time.
Table of Contents (14 chapters)

JMeter to the rescue

In the previous section, we covered the fundamentals of conducting a performance test. One of the areas performance testing covers is testing tools . Which testing tool do you use to put the system and application under load? There are numerous testing tools available to perform this operation, from free to commercial solutions. However, our focus in this book will be on Apache JMeter, a free open source, cross platform desktop application from The Apache Software Foundation. JMeter has been around since 1998 according to historic change logs on its official site, making it a mature, robust, and reliable testing tool. Cost may also have played a role in its wide adoption. Small companies usually may not want to foot the bill for commercial testing tools, which often still place restrictions on how many concurrent users one can spin off, for example. My first encounter with JMeter was exactly as a result of this. I worked in a small shop that had paid for a commercial testing tool, but during the course of testing, we had overrun the licensing limits of how many concurrent users we needed to simulate for realistic test plans. Since JMeter was free, we explored it and were quite delighted with the offerings and the sheer number of features we got for free.

Here are some of its features:

  • Performance test of different server types including web (HTTP and HTTPS), SOAP, database, LDAP, JMS, mail, and native commands or shell scripts

  • Complete portability across various operating systems

  • Full multithreading framework allowing concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups

  • GUI (Graphical User Interface)

  • HTTP proxy recording server

  • Caching and offline analysis/replaying of test results

  • Highly extensible

  • Live view of results as testing is being conducted

JMeter allows multiple concurrent users to be simulated on the application allowing you to work towards most of the target goals mentioned earlier in the chapter, such as attaining baseline, identifying bottlenecks, and so on.

It will help answer questions such as:

  • Will the application still be responsive if 50 users are accessing it concurrently?

  • How reliable will it be under a load of 200 users?

  • How much system resources will be consumed under a load of 250 users?

  • What is throughput going to look like when 1000 users are active in the system?

  • What is the response time for the various components in the application under load?

JMeter, however, should not be confused with a browser (more on that in Chapter 2, Recording Your First Test and Chapter 3, Submitting Forms). It doesn't perform all the operations supported by browsers; in particular, JMeter does not execute JavaScript found in HTML pages, nor does it render HTML pages the way a browser does. It does give you the ability to view request responses as HTML through one of its many listeners, but the timings are not included in any samples. Furthermore, there are limitations as to how many users can be spun on a single machine. These vary depending on the machine specifications (for example, memory and processor speed) and the test scenarios being executed. In our experience, we have mostly been able to successfully spin off 250-450 users on a single machine with 2.2GHz processor and 8 GB of RAM.