You are on page 1of 53

Performance Testing with JMeter 3

Enhance the performance of your web


application 3rd Edition Bayo Erinle
Visit to download the full and correct content document:
https://textbookfull.com/product/performance-testing-with-jmeter-3-enhance-the-perfor
mance-of-your-web-application-3rd-edition-bayo-erinle/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Boost!: How the Psychology of Sports Can Enhance Your


Performance in Management and Work Michael Bar-Eli

https://textbookfull.com/product/boost-how-the-psychology-of-
sports-can-enhance-your-performance-in-management-and-work-
michael-bar-eli/

Clean Code with C# - Second Edition: Refactor your


legacy C# code base and improve application performance
using best practices Alls

https://textbookfull.com/product/clean-code-with-c-second-
edition-refactor-your-legacy-c-code-base-and-improve-application-
performance-using-best-practices-alls/

Production Control Systems A Guide to Enhance


Performance of Pull Systems 1st Edition Yacob Khojasteh
(Auth.)

https://textbookfull.com/product/production-control-systems-a-
guide-to-enhance-performance-of-pull-systems-1st-edition-yacob-
khojasteh-auth/

Web Performance in Action: Building Faster Web Pages


1st Edition Jeremy Wagner

https://textbookfull.com/product/web-performance-in-action-
building-faster-web-pages-1st-edition-jeremy-wagner/
M100 Performance Standards for Antimicrobial
Susceptibility Testing 30th Edition Clsi

https://textbookfull.com/product/m100-performance-standards-for-
antimicrobial-susceptibility-testing-30th-edition-clsi/

Computational Network Application Tools for Performance


Management Millie Pant

https://textbookfull.com/product/computational-network-
application-tools-for-performance-management-millie-pant/

Digital Forensics with Kali Linux Enhance your


investigation skills by performing network and memory
forensics with Kali Linux 3rd Edition Parasram

https://textbookfull.com/product/digital-forensics-with-kali-
linux-enhance-your-investigation-skills-by-performing-network-
and-memory-forensics-with-kali-linux-3rd-edition-parasram/

Sports Biomechanics The Basics Optimising Human


Performance 3rd Edition Anthony Blazevich

https://textbookfull.com/product/sports-biomechanics-the-basics-
optimising-human-performance-3rd-edition-anthony-blazevich/

Sports Biomechanics The Basics Optimising Human


Performance 3rd Edition Anthony Blazevich

https://textbookfull.com/product/sports-biomechanics-the-basics-
optimising-human-performance-3rd-edition-anthony-blazevich-2/
Performance Testing with
JMeter 3
Third Edition

&OIBODFUIFQFSGPSNBODFPGZPVSXFCBQQMJDBUJPO

Bayo Erinle

BIRMINGHAM - MUMBAI
Performance Testing with JMeter 3
Third Edition
Copyright © 2017 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, without the prior written permission of the
publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the author, nor Packt Publishing, and its
dealers and distributors will be held liable for any damages caused or alleged to be caused
directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.

First published: July 2013

Second edition: April 2015

Third edition: July 2017

Production reference: 1170717


1VCMJTIFECZ1BDLU1VCMJTIJOH-UE
-JWFSZ1MBDF
-JWFSZ4USFFU
#JSNJOHIBN
#1#6,
ISBN 978-1-78728-577-4
XXXQBDLUQVCDPN
Credits

Author Copy Editor


Bayo Erinle Shaila Kusanale

Reviewers Project Coordinator


Vinay Madan Devanshi Doshi
Ripon Al Wasim

Commissioning Editor Proofreader


Smeet Thakkar Safis Editing

Acquisition Editor Indexer


Shweta Pant Mariammal Chettiyar

Content Development Editor Graphics


Onkar Wani Jason Monteiro

Technical Editor Production Coordinator


Harshal Kadam Shraddha Falebhai
About the Author
Bayo Erinle is an author and senior software engineer with over 14 years of experience in
designing, developing, testing, and architecting software. He has worked in various
spectrums of the IT field, including government, commercial, finance, and health care. As a
result, he has been involved in the planning, development, implementation, integration,
operations, and testing of numerous applications, including multitiered, standalone,
distributed, and cloud-based applications. He is passionate about programming,
performance, operations, scalability, and all things technical. He is always intrigued by new
technology and enjoys learning new things.
He currently resides in Maryland, US, and when he is not hacking away at some new
technology, he enjoys spending time with his wife, Nimota, and their three children,
Mayowa, Durotimi, and Fisayo.
He also authored Performance Testing with JMeter 2.9 (first edition and second edition) and
JMeter Cookbook, both by Packt.
Acknowledgments
I would like to thank all those people who helped make this book a reality. First, I want to
thank God for the strength; through Him, I can do all things! Secondly, Nimota, my wife,
for her encouragement, support, and picking up the slack while I took time to write the
book. Thanks to my kids for their several hugs, kisses, and amusement to keep me going.
Thanks to the folks at Packt for believing in me enough to give me yet another opportunity
to author the third edition of this book. Lastly, thanks to the readers of the first and second
editions of this book, and to all the future readers of this edition; your support is greatly
appreciated.
About the Reviewers
Ripon Al Wasim has over 16 years of experience in the software industry. His professional
experiences include software development, functional and non-functional testing (both
manual and automated testing). He currently works as senior software engineer at Cefalo
Bangladesh Ltd. (IUUQXXXDFGBMPDPN).                  

Ripon is a hunter of new technology and is very passionate about test automation.

He is an active participant in the professional community of Stack Overflow: IUUQTUBDL        

PWFSGMPXDPNVTFSTSJQPOBMXBTJN
                              

Ripon is the author of Mastering Selenium Testing Tools (IUUQTXXXQBDLUQVCDPNXFCE                         

FWFMPQNFOUNBTUFSJOHTFMFOJVNUFTUJOHUPPMTWJEFP), a video tutorial published by


                                               

Packt.

He has reviewed the following books published by Packt:

Selenium WebDriver Practical Guide (IUUQTXXXQBDLUQVCDPNXFCEFWFMPQNFOUTFMFOJ                                         

VNXFCESJWFSQSBDUJDBMHVJEF).
                           

Performance Testing with JMeter - Second Edition (IUUQTXXXQBDLUQVCDPNBQQMJDBUJPO                                

EFWFMPQNFOUQFSGPSNBODFUFTUJOHKNFUFSTFDPOEFEJUJPO).
                                                   

Mastering Selenium WebDriver (IUUQTXXXQBDLUQVCDPNXFCEFWFMPQNFOUNBTUFSJOH                                             

TFMFOJVNXFCESJWFS).
                 

I would like to thank my mother for always praying for me. In my spare time, I love to
spend time with my wife, Koly, as well as my twin babies, Nawar and Nazif.
Vinay Madan is currently a QA Lead with SecurePay (XXXTFDVSFQBZDPNBV). He has
more than 10 years of experience in the diversified fields of software testing, quality
assurance, test management, and agile software development.

He has worked on projects for leading international clients for payment gateway, eWallet,
smart cards issuance, big data, security, telecom, and e-learning. He is an avid learner with
strong technical expertise in functional and performance testing tools such as Selenium,
QTP, Cucumber, Serenity BDD, JMeter, and Load Runner.

Over the years, Vinay has worked with multiple software methodologies, including Agile,
Scrum, and Customized Waterfall for Windows, the web, and mobile. He is passionate
about automation and open source technologies, and loves sharing his knowledge on blogs
and forums.

Thank you, mom, for everything. I would also like to thank my wife for her everlasting love
and support.
www.PacktPub.com
For support files and downloads related to your book, please visit XXX1BDLU1VCDPN.

Did you know that Packt offers eBook versions of every book published, with PDF and
ePub files available? You can upgrade to the eBook version at XXX1BDLU1VCDPN and as a
print book customer, you are entitled to a discount on the eBook copy. Get in touch with us
at TFSWJDF!QBDLUQVCDPN for more details.

At XXX1BDLU1VCDPN, you can also read a collection of free technical articles, sign up for a
range of free newsletters and receive exclusive discounts and offers on Packt books and
eBooks.

IUUQTXXXQBDLUQVCDPNNBQU
                       

Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt
books and video courses, as well as industry-leading tools to help you plan your personal
development and advance your career.

Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Customer Feedback
Thanks for purchasing this Packt book. At Packt, quality is at the heart of our editorial
process. To help us improve, please leave us an honest review on this book's Amazon page
at IUUQTXXXBNB[PODPNEQ. If you'd like to join our team of regular
                    

reviewers, you can e-mail us at DVTUPNFSSFWJFXT!QBDLUQVCDPN. We award our regular


reviewers with free eBooks and videos in exchange for their valuable feedback. Help us be
relentless in improving our products!
Table of Contents
Preface 1
Chapter 1: Performance Testing Fundamentals 6
The incident 6
The aftermath 7
Performance testing 7
Performance testing and tuning 11
Baselines 12
Load and stress testing 13
JMeter to the rescue 13
Up and running with JMeter 14
Installation 14
Installing Java JDK 16
Setting up JAVA_HOME 16
On Windows 17
On Unix 17
Running JMeter 17
Command-line options 19
JMeter's classpath 20
Configuring a proxy server 20
Running in non-GUI mode 21
Running in server mode 22
Overriding properties 22
Tracking errors during test execution 23
Configuring JMeter 24
Summary 26
Chapter 2: Recording Your First Test 27
Configuring the JMeter HTTP(S) Test Script Recorder 27
Setting up your browser to use the proxy server 30
Using a browser extension 31
Changing the machine system settings 31
Running your first recorded scenario 34
Excilys bank case study 37
Parameterizing the script 39
Extracting information during test run 42
Anatomy of a JMeter test 46
Test plan 46
Thread groups 47
Controllers 47
Samplers 48
Logic controllers 48
Test fragments 48
Listeners 48
Timers 49
Assertions 49
Configuration elements 50
Preprocessor and Postprocessor elements 50
Summary 51
Chapter 3: Submitting Forms 52
Capturing simple forms 52
Handling checkboxes 53
Handling radio buttons 53
Handling file uploads 54
Handling file downloads 55
Posting JSON data 56
Reading JSON data 60
Using JSR223 PostProcessor 62
Handling XML responses 64
Summary 67
Chapter 4: Managing Sessions 68
Managing sessions with cookies 69
Managing sessions with URL rewriting 73
Summary 76
Chapter 5: Monitoring Tests in Real-Time 77
Setting up InfluxDB 77
Setting up Grafana 79
Creating an InfluxDB database for our test plan 81
Connecting Grafana to the database 82
Putting it all together 84
Importing the Grafana dashboard 84
Summary 90
Chapter 6: Distributed Testing 91
Remote testing with JMeter 91
Configuring JMeter slave nodes 93
Configuring one slave per machine 94

[ ii ]
Configuring the master node 96
Configuring multiple slave nodes on a single box 100
Configuring the master node 102
Leveraging the cloud for distributed testing 103
Obtaining your access key, secret key, and key pair 104
Launching the AWS instance 106
Executing the test plan 107
Viewing the results from the virtual machines 109
Using cloud services 112
Using Flood.io 113
Using BlazeMeter 115
Summary 118
Chapter 7: Helpful Tips - Part 1 119
Dummy Sampler 119
Debug Sampler 121
JDBC Request Sampler 123
Setting up the H2 database 123
Configuring a JDBC Connection Configuration component 125
Adding a JDBC Request Sampler 127
Using a MongoDB Sampler 127
Summary 130
Chapter 8: Helpful Tips - Part 2 131
JMeter properties and variables 131
JMeter functions 133
Using timers in your test plan 134
The Constant Timer 134
The Gaussian Random Timer 134
The Uniform Random Timer 134
The Constant Throughput Timer 134
The Synchronizing Timer 134
The Poisson Random Timer 135
The Regular Expression tester 135
The JSON Path Extractor element 137
Handling RESTful web services 138
Working with the reporting dashboard 139
Summary 142
Index 143

[ iii ]
Preface
Performance testing is a type of testing intended to determine the responsiveness,
reliability, throughput, interoperability, and scalability of a system and/or application under
a given workload. It is critical and essential to the success of any software product's launch
and maintenance. It also plays an integral part in scaling an application out to support a
wider user base.

Apache JMeter is a free and open source, cross-platform performance testing tool that has
been around since the late 90s. It is mature, robust, portable, and highly extensible. It has a
large user base and offers a lot of plugins to aid testing.

This is a practical hands-on book that focuses on how to leverage Apache JMeter to meet
your testing needs. It starts with a quick introduction on performance testing, but quickly
moves into engaging topics including recording test scripts, monitoring system resources,
an extensive look at several JMeter components, leveraging the cloud for testing, extending
Apache JMeter capabilities via plugins, and so on. Along the way, you will do some
scripting, learn and use tools such as Vagrant and Apache Tomcat, and be armed with all
the knowledge you need to take on your next testing engagement.

Whether you are a developer or tester, this book is sure to impact you with some valuable
knowledge to aid you in attaining success in your future testing endeavors.

What this book covers


$IBQUFS, Performance Testing Fundamentals, covers the fundamentals of performance
testing and the installation and configuration of JMeter.

$IBQUFS, Recording Your First Test, dives into recording your first JMeter test script and
covers the anatomy of a JMeter test script.

$IBQUFS, Submitting Forms, explores form submission in detail. It includes handling


various HTML form elements (checkboxes, radio, file uploads and downloads, and so on),
JSON data, and XML.

$IBQUFS, Managing Sessions, explains session management, including cookies and URL
rewriting.

$IBQUFS, Monitoring Tests in Real-Time, focuses on active monitoring and analysis of test
execution results, as well as new components in JMeter 3 that make it possible.
Preface

$IBQUFS, Distributed Testing, takes an in-depth look at leveraging cloud for performance
testing. We dive into tools such as Vagrant and AWS, and explore the existing cloud-testing
platforms BlazeMeter and Flood.io.

$IBQUFS, Helpful Tips - Part 1, provides you with helpful techniques and tips for getting
the most out of JMeter.

$IBQUFS, Helpful Tips - Part 2, further provides you with more helpful techniques and tips
continued from $IBQUFS, Helpful Tips - Part 1.

What you need for this book


A computer with internet connection
Apache JMeter: IUUQKNFUFSBQBDIFPSH                     

Java Runtime Environment (JRE) or Java Development Kit (JDK): IUUQXXXPS         

BDMFDPNUFDIOFUXPSLKBWBKBWBTFEPXOMPBETJOEFYIUNM
                                              

In addition, for $IBQUFS, Monitoring Tests in Real-Time, you need the following:

Grafana: IUUQTHSBGBOBDPN                

InfluxDB: IUUQTXXXJOGMVYEBUBDPNUJNFTFSJFTQMBUGPSNJOGMVYEC
                                                  

For $IBQUFS, Distributed Testing, you need these:

Vagrant: IUUQXXXWBHSBOUVQDPN
                    

AWS account: IUUQBXTBNB[PODPN                  

BlazeMeter account: IUUQCMB[FNFUFSDPN                  

Flood.io account: IUUQTGMPPEJP             

Code samples: IUUQTHJUIVCDPNQUXKQUXKDPEFUSFFW                                 

The book contains pointers and additional helpful links in setting all these up.

Who this book is for


This book is for software professionals who want to understand and improve the
performance of their applications with Apache JMeter.

[2]
Preface

Conventions
In this book, you will find a number of text styles that distinguish between different kinds
of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Now,
edit +.&5&3@)0.&CJOKNFUFSTFSWFS using an editor of choice. "

A block of code is set as follows:


QSJWBUFCBOLBDDPVOU"$$PQFSBUJPOTIUNM
QSJWBUFCBOLBDDPVOU"$$ZFBSNPOUIQBHFPQFSBUJPOTKTPO


Any command-line input or output is written as follows:


./jmeter.sh

New terms and important words are shown in bold. Words that you see on the screen, for
example, in menus or dialog boxes, appear in the text like this: "Right-click on Test Plan
and navigate to Add | Threads (User) | Thread Group."

Warnings or important notes appear like this.

Tips and tricks appear like this.

Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this
book-what you liked or disliked. Reader feedback is important for us as it helps us develop
titles that you will really get the most out of. To send us general feedback, simply e-mail
GFFECBDL!QBDLUQVCDPN, and mention the book's title in the subject of your message. If
there is a topic that you have expertise in and you are interested in either writing or
contributing to a book, see our author guide at XXXQBDLUQVCDPNBVUIPST.

[3]
Preface

Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you
to get the most from your purchase.

Downloading the example code


You can download the example code files for this book from your account at IUUQXXXQ        

BDLUQVCDPN. If you purchased this book elsewhere, you can visit IUUQXXXQBDLUQVCD
                           

PNTVQQPSUand register to have the files e-mailed directly to you. You can download the
        

code files by following these steps:

1. Log in or register to our website using your e-mail address and password.
2. Hover the mouse pointer on the SUPPORT tab at the top.
3. Click on Code Downloads & Errata.
4. Enter the name of the book in the Search box.
5. Select the book for which you're looking to download the code files.
6. Choose from the drop-down menu where you purchased this book from.
7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the
latest version of:

WinRAR / 7-Zip for Windows


Zipeg / iZip / UnRarX for Mac
7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at IUUQTHJUIVCDPN1BDLU1VCM                       

JTIJOH1FSGPSNBODF5FTUJOHXJUI+.FUFS. We also have other code bundles from our


                                     

rich catalog of books and videos available at IUUQTHJUIVCDPN1BDLU1VCMJTIJOH.                            

Check them out!

[4]
Preface

Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do
happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-
we would be grateful if you could report this to us. By doing so, you can save other readers
from frustration and help us improve subsequent versions of this book. If you find any
errata, please report them by visiting IUUQXXXQBDLUQVCDPNTVCNJUFSSBUB, selecting
                                

your book, clicking on the Errata Submission Form link, and entering the details of your
errata. Once your errata are verified, your submission will be accepted and the errata will
be uploaded to our website or added to any list of existing errata under the Errata section of
that title. To view the previously submitted errata, go to IUUQTXXXQBDLUQVCDPNCPPL                        

TDPOUFOUTVQQPSUand enter the name of the book in the search field. The required
              

information will appear under the Errata section.

Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At
Packt, we take the protection of our copyright and licenses very seriously. If you come
across any illegal copies of our works in any form on the Internet, please provide us with
the location address or website name immediately so that we can pursue a remedy. Please
contact us at DPQZSJHIU!QBDLUQVCDPN with a link to the suspected pirated material. We
appreciate your help in protecting our authors and our ability to bring you valuable
content.

Questions
If you have a problem with any aspect of this book, you can contact us at
RVFTUJPOT!QBDLUQVCDPN, and we will do our best to address the problem.

[5]
Performance Testing
1
Fundamentals
Software performance testing is used to determine the speed or effectiveness of a computer,
network, software program, or device. This process can involve quantitative tests done in a
lab, such as measuring the response time or the number of MIPS (millions of instructions
per second) at which a system functions.
- Wikipedia

Let's consider a case study. Baysoft Training Inc. is an emerging start-up company focused
on redefining how software will help get more people trained in various fields in the IT
industry. The company achieves this goal by providing a suite of products, including online
courses, and on-site and off-site training. As such, one of their flagship products--TrainBot,
a web-based application--is focused solely on registering individuals for courses of interest
that will aid them in attaining career goals. Once registered, the client can then go on to take
a series of interactive online courses.

The incident
Up until recently, traffic on TrainBot was light, as it was only open to a handful of clients
since it was still in closed beta. Everything was fully operational, and the application as a
whole was very responsive. Just a few weeks ago, TrainBot was opened to the public and all
is still fine and dandy. To celebrate the launch and promote its online training courses,
Baysoft Training Inc. recently offered 75 percent off, on all the training courses. However,
this promotional offer caused a sudden influx on TrainBot, far beyond what the company
had anticipated. Web traffic shot up by 300 percent and, suddenly, things took a turn for the
worse.
Performance Testing Fundamentals

Network resources weren't holding up well, server CPUs and memory were at 90-95
percent, and database servers weren't far behind, due to high I/O and contention. As a
result, most web requests began to get slower response times, making TrainBot totally
unresponsive for most of its first-time clients. It didn't take too long for the servers to crash
and for the support lines to get flooded after that.

The aftermath
It was a long night at the Baysoft Training Inc. corporate office. How did this happen?
Could this have been avoided? Why were the application and system not able to handle the
load? Why weren't adequate performance and stress tests conducted on the system and
application? Was it an application problem, a system resource issue, or a combination of
both? All these were questions that the management demanded answers to from the group
of engineers, which comprised software developers, network and system engineers,
Quality Assurance (QA) testers, and database administrators gathered in the meeting
room. There sure was a lot of finger-pointing and blame going around the room. After a
little brainstorming, it wasn't long before the group had to decide what needed to be done.
The application and its system resources needed to undergo extensive and rigorous testing.
This included all facets of the application and all supporting system resources, including,
but not limited to, infrastructure, network, database, servers, and load balancers. Such a test
would help all involved parties to discover exactly where the bottlenecks were and address
them accordingly.

Performance testing
Performance testing is a type of testing intended to determine the responsiveness,
reliability, throughput, interoperability, and scalability of a system and/or application under
a given workload. It can also be defined as a process of determining the speed or
effectiveness of a computer, network, software application, or device. Testing can be
conducted on software applications, system resources, targeted application components,
databases, and a whole lot more. It normally involves an automated test suite, as this allows
easy and repeatable simulations of a variety of normal, peak, and exceptional load
conditions. Such forms of testing help verify whether a system or application meets the
specifications claimed by its vendor. The process can compare applications in terms of
parameters such as speed, data transfer rate, throughput, bandwidth, efficiency, or
reliability. Performance testing can also aid as a diagnostic tool in determining bottlenecks
and single points of failure. It is often conducted in a controlled environment and in
conjunction with stress testing; a process of determining the ability of a system or
application to maintain a certain level of effectiveness under unfavorable conditions.

[7]
Performance Testing Fundamentals

Why bother? Using Baysoft's case study, it should be obvious why companies
bother and go to great lengths to conduct performance testing. The disaster could have been
minimized, if not totally prevented, if effective performance testing had been conducted on
TrainBot prior to opening it up to the masses. As we go ahead in this chapter, we will
continue to explore the many benefits of effective performance testing.

At a very high level, performance testing is mostly conducted to address one or more risks
related to expenses, opportunity costs, continuity, and/or corporate reputation. Conducting
such tests helps give insights into software application release readiness, adequacy of
network and system resources, infrastructure stability, and application scalability, to name
a few. Gathering estimated performance characteristics of application and system resources
prior to launch helps address issues early and provides valuable feedback to stakeholders,
helping them make key and strategic decisions.

Performance testing covers a whole lot of ground, including areas such as the following:

Assessing application and system production readiness


Evaluating against performance criteria (for example, transactions per second,
page views per day, and registrations per day)
Comparing performance characteristics of multiple systems or
system configurations
Identifying the source of performance bottlenecks
Aiding with performance and system tuning
Helping identify system throughput levels
Acting as a testing tool

Most of these areas are intertwined with each other, each aspect contributing to attaining
the overall objectives of stakeholders. However, before jumping right in, let's take a moment
to understand the following core activities in conducting performance tests:

Identifying acceptance criteria: What is the acceptable performance of the


various modules of the application under load? Specifically, we need to identify
the response time, throughput, and resource utilization goals and constraints.
How long should the end user wait before rendering a particular page? How long
should the user wait to perform an operation? Response time is usually a user
concern, throughput a business concern, and resource utilization a system
concern. As such, response time, throughput, and resource utilization are key
aspects of performance testing. Acceptance criteria are usually driven by
stakeholders, and it is important to continuously involve them as the testing
progresses, as the criteria may need to be revised.

[8]
Performance Testing Fundamentals

Identifying the test environment: Becoming familiar with the physical test and
production environments is crucial for a successful test run. Knowing things such
as the hardware, software, and network configurations of the environment helps
derive an effective test plan and identify testing challenges from the outset. In
most cases, these will be revisited and/or revised during the testing cycle.
Planning and designing tests: Know the usage pattern of the application
(if any), and come up with realistic usage scenarios, including variability among
the various scenarios. For example, if the application in question has a user
registration module, how many users typically register for an account in a day?
Do those registrations happen all at once, at the same time, or are they spaced
out? How many people frequent the landing page of the application within an
hour? Questions such as these help put things in perspective and design
variations in the test plan. Having said that, there may be times when the
application under test is new, and so, no usage pattern has been formed yet. At
such times, stakeholders should be consulted to understand their business
process and come up with as close to a realistic test plan as possible.
Preparing the test environment: Configure the test environment, tools, and
resources necessary to conduct the planned test scenarios. It is important to
ensure that the test environment is instrumented for resource monitoring to help
analyze results more efficiently. Depending on the company, a separate team
might be responsible for setting up the test tools, while another team may be
responsible for configuring other aspects, such as resource monitoring. In other
organizations, a single team may be responsible for setting up all aspects.
Preparing the test plan: Using a test tool, record the planned test scenarios. There
are numerous testing tools available, both free and commercial, that do the job
quite well, with each having their pros and cons.
Such tools include HP LoadRunner, NeoLoad, LoadUI, Gatling,
WebLOAD, WAPT, Loadster, Load Impact, Rational Performance
Tester, Testing Anywhere, OpenSTA, LoadStorm, The Grinder,
Apache Benchmark, httpref, and so on. Some of these are
commercial, while others are not as mature, portable or extendable
as JMeter. HP LoadRunner, for example, is a bit pricey and limits
the number of simulated threads to 250 without purchasing
additional licenses, although it does offer a much better graphical
interface and monitoring capability. Gatling is the new kid on the
block, is free, and looks rather promising. It is still in its infancy
and aims to address some of the shortcomings of JMeter, including
easier testing of domain-specific language (DSL) versus JMeter's
verbose XML, and better and more meaningful HTML reports,
among others.

[9]
Performance Testing Fundamentals

Having said that, it still has only a tiny user base as compared to
JMeter, and not everyone may be comfortable with building test
plans in Scala, its language of choice. Programmers may find it
more appealing.

In this book, our tool of choice will be Apache JMeter to perform


this step. This shouldn't be a surprise considering the title of the
book.
Running the tests: Once recorded, execute the test plans under light load and
verify the correctness of the test scripts and output results. In cases where test or
input data is fed into the scripts to simulate more realistic data (more on this in
subsequent chapters), also validate the test data. Another aspect to pay careful
attention to during test plan execution is the server logs. This can be achieved
through the resource monitoring agents set up to monitor the servers. It is
paramount to watch for warnings and errors. A high rate of errors, for example,
can be an indication that something is wrong with the test scripts, application
under test, system resource, or a combination of all these.
Analyzing results, report, and retest: Examine the results of each successive run
and identify areas of bottleneck that need to be addressed. These can be related to
system, database, or application. System-related bottlenecks may lead to
infrastructure changes, such as increasing the memory available to the
application, reducing CPU consumption, increasing or decreasing thread pool
sizes, revising database pool sizes, and reconfiguring network settings. Database-
related bottlenecks may lead to analyzing database I/O operations, top queries
from the application under test, profiling SQL queries, introducing additional
indexes, running statistics gathering, changing table page sizes and locks, and a
lot more. Finally, application-related changes might lead to activities such as
refactoring application components, and reducing application memory
consumption and database round trips. Once the identified bottlenecks are
addressed, the test(s) should then be rerun and compared with the previous runs.
To help better track what change or group of changes resolved a particular
bottleneck, it is vital that changes are applied in an orderly fashion, preferably
one at a time. In other words, once a change is applied, the same test plan is
executed and the results are compared to a previous run to check whether the
change made had any improved or worsened effect on the results. This process is
repeated until the performance goals of the project have been met.

[ 10 ]
Performance Testing Fundamentals

The performance testing core activities are displayed as follows:

2GTHQTOCPEGVGUVKPIEQTGCEVKXKVKGU

Performance testing is usually a collaborative effort between all parties involved. Parties
include business stakeholders, enterprise architects, developers, testers, DBAs, system
admins, and network admins. Such collaboration is necessary to effectively gather accurate
and valuable results when conducting tests. Monitoring network utilization, database I/O
and waits, top queries, and invocation counts helps the team find bottlenecks and areas that
need further attention in ongoing tuning efforts.

Performance testing and tuning


There is a strong relationship between performance testing and tuning, in the
sense that one often leads to the other. Often, end-to-end testing unveils system
or application bottlenecks that are regarded as unacceptable for project target goals. Once
those bottlenecks are discovered, the next step for most teams is a series of tuning efforts to
make the application perform adequately.

[ 11 ]
Performance Testing Fundamentals

Such efforts normally include, but are not limited to, the following:

Configuring changes in system resources


Optimizing database queries
Reducing round trips in application calls, sometimes leading to redesigning and
re-architecting problematic modules
Scaling out application and database server capacity
Reducing application resource footprint
Optimizing and refactoring code, including eliminating redundancy and
reducing execution time

Tuning efforts may also commence if the application has reached acceptable performance
but the team wants to reduce the amount of system resources being
used, decrease the volume of hardware needed, or further increase system performance.

After each change (or series of changes), the test is re-executed to see whether the
performance has improved or declined due to the changes. The process
will be continued with the performance results having reached acceptable goals.
The outcome of these test-tuning circles normally produces a baseline.

Baselines
A Baseline is the process of capturing performance metric data for the sole purpose of
evaluating the efficacy of successive changes to the system or application. It is important
that all characteristics and configurations, except those specifically being varied for
comparison, remain the same in order to make effective comparisons as to which change (or
series of changes) is driving results toward the targeted goal. Armed with such baseline
results, subsequent changes can be made to the system configuration or application and
testing results can be compared to see whether such changes were relevant or not. Some
considerations when generating baselines include the following:

They are application-specific


They can be created for systems, applications, or modules
They are metrics/results
They should not be over generalized
They evolve and may need to be redefined from time to time
They act as a shared frame of reference
They are reusable
They help identify changes in performance

[ 12 ]
Performance Testing Fundamentals

Load and stress testing


Load testing is the process of putting demand on a system and measuring its response, that
is, determining how much volume the system can handle. Stress testing is the process of
subjecting the system to unusually high loads, far beyond its normal usage pattern, to
determine its responsiveness. These are different from performance testing, whose sole
purpose is to determine the response and effectiveness of a system, that is, how fast the
system is. Since load ultimately affects how a system responds, performance testing is
mostly done in conjunction with stress testing.

JMeter to the rescue


In the last 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 don't want to foot the bill for
commercial end testing tools, which often place restrictions, for example, on how many
concurrent users one can spin off. My first encounter with JMeter was exactly 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 outrun 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 share amount of features we got for free.

Here are some of its features:

Performance tests 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
Full featured Test IDE that allows fast test plan recording, building, and
debugging
Dashboard report for detailed analysis of application performance indexes and
key transactions

[ 13 ]
Performance Testing Fundamentals

In-built integration with real-time reporting and analysis tools, such as Graphite,
InfluxDB, and Grafana, to name a few
Complete dynamic HTML reports
Graphical User Interface (GUI)
HTTP proxy recording server
Caching and offline analysis/replaying of test results
High extensibility
Live view of results as testing is being conducted

JMeter allows multiple concurrent users to be simulated on the application, allowing you to
work toward most of the target goals obtained earlier in this chapter, such as attaining
baselines and identifying bottlenecks.

It will help answer questions, such as the following:

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 of the system resources will be consumed under a load of
250 users?
What will the throughput look like with 1000 users active in the system?
What will be the response time for the various components in the application
under load?

JMeter, however, should not be confused with a browser (more on this in $IBQUFS,
Recording Your First Test, and $IBQUFS, 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. However, it does
give you the ability to view request responses as HTML through many of its listeners, but
the timings are not included in any samples. Furthermore, there are limitations to how
many users can be spun on a single machine. These vary depending on the machine
specifications (for example, memory, processor speed, and so on) 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 a 2.2 GHz processor and 8 GB of RAM.

Up and running with JMeter


Now, let's get up and running with JMeter, beginning with its installation.

[ 14 ]
Performance Testing Fundamentals

Installation
JMeter comes as a bundled archive, so it is super easy to get started with it. Those working
in corporate environments behind a firewall or machines with non-admin privileges
appreciate this more. To get started, grab the latest binary release by pointing your browser
to IUUQKNFUFSBQBDIFPSHEPXOMPBE@KNFUFSDHJ. At the time of writing this, the
                                       

current release version is 3.1. The download site offers the bundle as both a [JQ file and a
UH[ file. In this book, we go with the [JQ file option, but feel free to download the UH[
file if that's your preferred way of grabbing archives.

Once downloaded, extract the archive to a location of your choice. Throughout this book,
the location you extracted the archive to will be referred to as +.&5&3@)0.&.

Provided you have a JDK/JRE correctly installed and a +"7"@)0.& environment variable
set, you are all set and ready to run!

The following screenshot shows a trimmed down directory structure of a vanilla JMeter
install:

,/'6'4A*1/'HQNFGTUVTWEVWTG

[ 15 ]
Performance Testing Fundamentals

The following are some of the folders in Apache-JMeter-3.2, as shown in the preceding
screenshot:

bin: This folder contains executable scripts to run and perform other operations
in JMeter
docs: This folder contains a well-documented user guide
extras: This folder contains miscellaneous items, including
samples illustrating the usage of the Apache Ant build tool
(IUUQBOUBQBDIFPSH) with JMeter, and bean shell scripting
lib: This folder contains utility JAR files needed by JMeter (you may add
additional JARs here to use from within JMeter; we will cover this in detail later)
printable_docs: This is the printable documentation

Installing Java JDK


Follow these steps to install Java JDK:

1. Go to
IUUQXXXPSBDMFDPNUFDIOFUXPSLKBWBKBWBTFEPXOMPBETJOEFYIUNM.
2. Download Java JDK (not JRE) compatible with the system that you will use to
test. At the time of writing, JDK 1.8 (update 131) was the latest, and that's what
we use throughout this book.
3. Double-click on the executable and follow the onscreen instructions.

On Windows systems, the default location for the JDK is under 1SPHSBN
'JMFT. While there is nothing wrong with this, the issue is that the folder
name contains a space, which can sometimes be problematic when
attempting to set PATH and run programs, such as JMeter, depending on
the JDK from the command line. With this in mind, it is advisable to
change the default location to something like $=UPPMT=KEL.

Setting up JAVA_HOME
Here are the steps to set up the +"7"@)0.& environment variable on Windows and Unix
operating systems.

[ 16 ]
Another random document with
no related content on Scribd:
Het zijn wafels, maar die kunnen jullie niet zien omdat ze onderin
zitten, en een leege wijnflesch, maar we doen net of die vol is." Even
keek Bep met een heel ernstig gezicht naar de lachende
toeschouwers, toen ver-[a196] volgde ze: "Ik ben ook heelemaal niet
bang voor de wolf, want die is er niet, en o ja, deze bloemen zijn
eigenlijk ook voor Grootmoeder, maar die wou ik nu maar aan
Maatje geven!" En toen holde ze naar haar Moeder toe en klom op
haar schoot.

"Dat 's ook wat!" zei Hugo, die dit niets geen gepast slot vond,
maar de andere kinderen klapten zoo hard dat er verder geen woord
tusschen te krijgen was.

Tante Lina vond dit slot mooier dan ze het hadden kunnen
bedenken.

"En gaan jullie nu mee naar beneden om een glaasje limonade te


drinken?" vroeg ze, Bep op den grond zettend.

In vliegende haast werden de mooie pakjes uitgeschopt, want ze


verlangden nu opeens allemaal weg te komen van de rommelige
zolder, waar een benauwde lucht van afgebrande Bengaalsche
lucifers hing. —

"Vond u 't mooi?" vroeg Eduard, toen ze de trap afgingen.

"Zeker," zei Tante Lina, "wat ik gezien heb vond ik heel aardig!"

En de Kapitein verklaarde dat hij zich bepaald dol geamuseerd


had.
[a197]

XI.
"Heb je nu eigenlijk gestudeerd of niet?" vroeg Mijnheer Hofman
ontevreden, want Eduard stond op een geweldige manier te knoeien
en hakkelde nu al voor de derde maal in een etude die hij de vorige
week al had moeten kennen.

Eduard keek van Mijnheer Hofman naar Theo, en van Theo naar
zijn viool.

"Jawel meneer!" zei hij toen.

"Hoeveel keer?"

Eduard zweeg.

"Nu, hoeveel keer heb je gestudeerd?"

"Drie keer!" klonk het zachtjes.

"Zoo, en dat vond je zeker voldoende, he? Verbeeldde je je nu


heusch dat je die etude kende? Ik wil je dan wel vertellen dat 't naar
niets lijkt! Vroeger kon ik tenminste merken dat je behoorlijk
gestudeerd hadt, maar 't is de laatste keeren al heel treurig! Je staat
te knoeien of je nog nooit een viool in je handen hebt gehad, en dat
is nu een jongen die bijna drie jaar les heeft!"

[a200] "Er was zoo weinig tijd!"


"Ja natuurlijk, dat kennen we! Zwijg nu alsjeblieft maar en speel de
sonatine!"

De jongens verwisselden de muziek en Eduard begon te spelen.


Vanmorgen voor hij naar school ging had hij de sonatine nog gauw
even een paar keer geprobeerd, maar hij wist heel goed dat hij er
niet veel van kende.

De eerste regels vielen hem mee, 't ging vrij goed, maar verderop
waren een paar moeilijke loopjes, en daarna raakte hij zoo in de war,
dat Mijnheer Hofman het al gauw mooi genoeg vond en hem
vertelde dat hij wel kon ophouden. "Berg je viool nu maar weg," zei
hij boos, "en dan zullen we zien of je er de volgende week meer van
kent. — Theo, wil jij de sonatine spelen alsjeblieft?"

Theo bracht het er nogal goed af, maar Eduard wilde er niet naar
luisteren. Vervelend gezanik ook, om hem zijn viool te laten
wegbergen; Theo maakte ook wel fouten; je moest het ook altijd
even prachtig kennen, en hij kon 't toch niet helpen dat Hofman
vandaag uit zijn humeur was. — Zoo vreeselijk slecht was 't niet
eens gegaan, maar omdat hij nu had verteld dat hij maar driemaal
gestudeerd had moest Hofman ook op alles vitten. Maar als die
malle vent soms dacht dat 't hem schelen kon, had hij het toch glad
mis!

En Eduard probeerde zoo onverschillig mogelijk te kijken en


staarde strak naar buiten, steeds met zijn knokkels op de vioolkist
tikkend, totdat Theo [a201] eindelijk klaar was met spelen en
Mijnheer Hofman opgaf wat ze voor de volgende week te doen
hadden. Toen konden ze hun jassen aantrekken en naar school
gaan.
"Flauwe aardigheid," was 't eerste wat Eduard mopperde, nadat de
voordeur achter ze dichtgevallen was.

"Wat flauwe aardigheid?" vroeg Theo.

"Nou, van Hofman natuurlijk!"


Theo keek Eduard eens even schuins aan en be-[a204] gon te
lachen. "Nou, je kende er dan toch ook eigenlijk wel een bar schijntje
van, als ik 't zeggen mag!" beweerde hij.

"Zeker mag je 't zeggen!" zei Eduard kwaad, "als jij Hofman
geweest was had je me zeker dadelijk naar huis gestuurd!"

"Wees nou niet zoo, flauw!"

"Flauw? 'k Ben niet flauw, jij bent flauw!"

"Nou ja, maar heel veel gestudeerd had je toch ook niet!"

"Dat zei 'k immers al!"

"Jawel. — Maar 't was toch zeker geen drie keer?"

"Waarom niet?"

"Zoo maar. Je zei 't net of je dacht: drie keer vind ik wel zoowat het
minste dat ik zeggen kan!"

Eduard zweeg even. "Maandag heb ik een kwartiertje gestudeerd,"


zei hij toen, "en Woensdag had ik juist mijn viool gekregen en toen
was er net iets anders, 'k weet niet meer wat, nou, en vanmorgen
voor 'k naar school ging heb ik de sonatine nog eens gespeeld."

Theo antwoordde niet.

"Jij moest maar eens bij een Oom en Tante en zes nichtjes en
neefjes logeeren, dan zou je eens zien hoe hard je werken kon!"
vervolgde Eduard, verwoed tegen een steentje schoppend, en Theo
aanziende: "Zeg nou eens, wat zou jij tegen Hofman gezegd
hebben?"

"Dat weet ik niet," zei Theo, nadat hij even ge-[a206] floten had, "ik
zou 't misschien ook wel gezegd hebben, hoor!"

"Vind je 't erg gemeen?"


"Gemeen? Och ja, natuurlijk is 't gemeen, maar dat bedenk je
meestal pas achteraf."

"Ja, dat is lam genoeg!" Eduard zuchtte. "'t Is net of 't me nu niets
meer zou kunnen schelen om te zeggen dat ik maar ééns
gestudeerd had. Hij was toch al woedend, en een beetje meer of
minder is dan toch zoo erg niet!"

"Als je nu maar maakt dat je 't de volgende week kent," besloot


Theo. "Wanneer 't sonatineboek uit is krijg ik als 'k twaalf word een
fiets, heeft Pa beloofd!"

"Krijg je ook een fiets? Wat moppig!" riep Eduard, want door dit
nieuwtje was hij opeens de narigheid van de vioolles vergeten. "Wat
zullen we dan van de zomer leuk samen kunnen rijden, zeg!"

"Nou, fijn!" vond Theo, "een Fongers, leuk he?"

"Ja, mijne is een Humber, hij staat nog thuis, maar zoo gauw als
het mooi weer wordt mag ik hem gaan halen!"

En ze hadden 't nog druk over de fietsen toen ze eindelijk de


school inliepen en Theo met een "Nou dag!" naar zijn eigen klas
ging.

Fransche themaschriften terug! Eduard schoof in zijn bank en sloeg


't schrift open. Met schrik keek hij naar de elf fouten en naar het
"slecht, overmaken", dat in groote blauwe letters onder aan de
[a207] bladzijde stond. Afschuwelijke thema ook! 't Was een echte
ongeluksdag vandaag, eerst die ellendige vioolles, en nu dit weer!

En ongeduldig stopte hij 't schrift in zijn lessenaar toen om twee uur
de bel luidde.

"Ziezoo, dat hebben we alweer gehad!" en Tante Lina leunde


achterover in haar stoel. 't Was een roezemoezig half uurtje geweest
na 't eten, maar zooeven waren de twee jongsten door de juffrouw
mee naar boven genomen, en een oogenblikje genoot Tante van de
rust, nu de twee schel en helder boven alles uit klinkende
kinderstemmetjes niet meer gehoord werden.

Broertje had voor 't eerst ook mee mogen spelen vanavond, en met
gesloten oogen dacht Tante Lina nog even aan het opgewonden
gezichtje en de drukke bewegingen van 't kleine ventje. Maar toen
viel haar iets in, en glimlachend keek ze Oom Tom aan en zei: "Die
jongste zoon van jou zal anders een beste worden!"

"Hoezoo?" vroeg de Kapitein, die 't zich in een groote leuningstoel


gemakkelijk gemaakt had, en juist een sigaar aanstak.

"Wel, vanmiddag nam ik hem mee uit, 't was mooi weer, en voor we
naar huis gingen liep ik nog even 't plantsoen door. Opeens zag ik
Kolonel Durand naar mij toekomen; hij maakte een praatje en begon
[a208] toen notitie te nemen van Broer, die hem met zijn groote
blauwe oogen strak stond aan te staren. 'Hoe heet je wel, vent?'
vroeg hij, en Broer verklaarde heel ernstig dat hij Willem Cornelis
Verhey heette, maar verder verkoos hij heelemaal geen antwoord
meer te geven, en toen Kolonel Durand eindelijk wegging en vroeg
of hij een hand kreeg hield Broer stijf zijn handen op zijn rug en zei
niets anders dan 'Ik doet het niet!'"

De Kapitein lachte. "Dan legde je met dat jongemensch meer eer


in!" merkte hij op, naar Piet wijzend, en Tante Lina vertelde nog aan
Eduard en Lineke hoe Piet als jongetje van een jaar of vier met alle
officieren beste maatjes was, en als ze hem vroegen wat hij worden
moest, altijd antwoordde "Generaal!" "Och, 't was zoo'n lieve jongen,
he?" besloot ze, op één na haar oudsten zoon op den schouder
kloppend.

"Je zou 't nu niet meer van hem gelooven!" zei de Kapitein
droogjes, en Lineke zong zachtjes:
"Zeg eens, ken je onze Piet?
Och, da 's jammer, ken je 'm niet,
Och, hij was zoo'n lieve jo...."
Een harde klap op haar wang van Tommy deed haar plotseling
ophouden, en half verbaasd, half verschrikt vloog Lineke van haar
stoel, om de beleediging met de rente terug te betalen. Maar haar
Moeder hield haar tegen, en de Kapitein vroeg streng: "Tommy,
waarom sla je Lineke?"

Tommy gaf geen antwoord, en schopte met zijn [a209] laars tegen
de tafelpoot, maar toen zijn Vader opstond en naar hem toe kwam,
schoof hij haastig naar den anderen kant van de kamer.

"Tommy, kom onmiddellijk hier!"

Maar Tommy, die zich, zoolang hij buiten 't bereik van den Kapitein
was, nog veilig voelde, zei met een ondeugend gezicht: "Ik doet het
niet!"

"Doe je het niet?"

"Nee!"

Zonder verder nog iets te zeggen ging de Kapitein op hem af; nog
eenige oogenblikken deed Tommy vergeefsche moeite om te
ontkomen, toen voelde hij zich stevig bij den kraag gepakt. "Waarom
heb je Lineke geslagen?"

"Omdat ze zoo gemeen deed!" riep Tommy half huilend.

"Gemeen?" vroeg zijn Vader, zich even bedenkend wat Lineke


gedaan had, dat de boosheid van haar broertje zoo had opgewekt:
"Wat deed ze dan?"

"Ze zong over Piet!"

"Was dat alles? Maak je daar nu zoo'n scène om? Begreep je nu


niet eens dat dat gekheid was?"

Tommy zweeg.
"Zeg nu maar dadelijk tegen je zusje: 'Het spijt me dat ik je
geslagen heb,' en laat het dan uit zijn alsjeblieft."

Maar Tommy verroerde zich niet en herhaalde alleen zijn


ondeugend: "Ik doet het niet!"

Tante Lina wenkte Oom Tom, den kleinen jongen [a210] verder aan
zijn lot over te laten, en stuurde de andere kinderen de kamer uit.
"Neem de kaarten maar mee en ga in de leerkamer een spelletje
doen!"

Langzaam verdween het drietal, om even later in de leerkamer te


gaan "banken", tot groot ongenoegen van Hugo, die zat te werken,
en met 't gezelschap dat hij kreeg alles behalve ingenomen was;
zuchtend besloot hij, dan maar liever mee te doen; de fiches werden
verdeeld, en Eduard, die de bank hield, schoof ze ieder een kaart
toe, met een luid "opzetten!"

"'k Ga nog lang niet naar bed!" verklaarde Lineke met een kleur van
plezier, toen haar bakje met fiches steeds voller werd.

Aan Tommy dachten ze niet meer, totdat ze hem om kwart voor


acht weer in de gang hoorden, hard gillend, en steeds herhalend: "Ik
doet het niet!"

"Ma zal wel spijt hebben dat ze dat verhaal over Broertje verteld
heeft!" merkte Piet lachend op.

Een kwartier daarna kwam Tante Lina de leerkamer binnen om


Eduard en Lineke naar bed te sturen. 't Was Linekes tijd, en Eduard
moest ook maar eens vroeg gaan slapen, 't was al een paar
avonden achter elkaar erg laat geworden, en hij was vanmiddag aan
tafel zoo stil geweest, zeker een beetje moe.

"He Ma, nog even! 'k Heb nu juist zoo'n mooie kaart!" zeurde
Lineke, en Eduard zei dat hij juist heelemaal niet moe was; maar
Tante Lina's geduld was door 't gezanik met Tommy vrijwel uitgeput,
en met een "'t Is nu mooi geweest!" konden ze [a211] gaan
opruimen. Langzaam werden de fiches weer in de doosjes gestopt,
en na nog wat lachen en onzin praten gingen ze eindelijk naar
boven.

't Licht brandde nog in de kamer van de kleine jongens, Tommy


scheen nog steeds niet in bed te zijn, en duidelijk hoorde Eduard
nog zijn boos: "ik doet 't niet." En toen hij zelf al uitgekleed was
hoorde hij de juffrouw pas naar beneden gaan. Even keek hij om de
deur; alles was nu donker, ook in de meisjeskamer. Maar stil was 't
nog niet geworden, en Eduard lag er in bed naar te luisteren hoe
Tommy nog maar steeds bleef doorschreeuwen en eindelijk zelfs 't
portaal opkwam om over de trapleuning hangend nog eens hard
naar beneden te roepen dat hij 't niet deed.

Wat zou hij nu toch eigenlijk niet willen doen? Hield die vervelende
jongen zijn mond nu toch maar! Net of je zoo kon slapen!

Daar ging opeens beneden haastig de deur open en dicht, en een


driftige stap kwam naar boven; Eduard hoorde duidelijk dat het Oom
Tom was —wat zou er nu gebeuren? Een zacht geritsel op 't portaal
— Tommy was zoodra hij zijn Vader hoorde aankomen naar zijn bed
gevlucht.

Eduard voelde zijn hart kloppen en met wijd open oogen bleef hij
liggen luisteren. Oom Tom liep langs zijn deur naar de kamer van de
kleine jongens, en begon daar heel kwaad tegen Tommy te praten —
Eduard verstond het niet, maar wel kon hij duidelijk [a212] de
klappen hooren, die toen volgden, en Tommy's huilend geroep: "Ik
zal wel gaan slapen!"

Arme Tommy! Hij was wel vreeselijk ondeugend en vervelend


geweest, maar hij riep nu toch al dat hij zou gaan slapen en 't duurde
zoo lang! Oom Tom was toch ook wel vreeselijk streng; Vader was
ook wel streng, maar héél anders, en zóó zou Vader nooit gedaan
hebben! Tenminste .... ja, toen! 't Was nu al meer dan een jaar
geleden, ze waren samen aan 't koffiedrinken en weer hoorde hij
Vaders stem vragen: "Wel, hoe was 't vanmorgen? Ging 't uit 't hoofd
rekenen goed? Hoeveel sommen had je?" En weer hoorde hij
zichzelf haastig antwoorden: "vijf Vader." — Dadelijk kreeg hij spijt
toen hij 't gezegd had: 't waren er maar vier geweest, maar hij had
de laatste keeren al altijd moeten vertellen dat 't onvoldoende was,
en dan had Vader altijd zoo teleurgesteld gekeken, want ja, 't was
dikwijls zijn eigen schuld als hij een som fout had, als hij middenin
vergat verder te rekenen of zoo — maar vier of vijf maakte toch niet
zoo'n groot verschil — hij had 't eerst nog willen vertellen voor hij
naar school ging, maar Vader had verder aldoor over andere dingen
gepraat en was toen al heel gauw naar de fabriek gegaan .... Dien
middag was Vader hem 's middags van school komen halen, zooals
hij wel meer deed, en Vader had met Mijnheer Snijders staan praten
— en duidelijk herinnerde Eduard zich hoe Vader toen naar hem
gekeken [a213] had, hoe Vader toen met hem naar huis gegaan
was, hard loopend en steeds zwijgend, hoe hij zelf Vader telkens
even schuins aangezien had, zonder iets te durven zeggen ....

En ook wist hij nog heel goed wat er gebeurd was toen ze eindelijk
thuiskwamen; hoe Vader hem heel kortaf vertelde dat hij mee moest
gaan, naar Vaders eigen kamer, en wat Vader hem daar vroeg: of hij
dan heelemaal vergeten was hoe vreeselijk boos Vader werd als
hem iets verteld werd dat niet waar was; of hij er dan heelemaal niet
aan gedacht had hoe naar Vader het zou vinden, om te merken dat
zijn eigen jongen hem voorgelogen had, en of hij wel wist wat hij nu
verdiende?

Dát was de eenige keer geweest.

En nu? Wat had hij vanmiddag gedaan? Wat had hij tegen Mijnheer
Hofman gezegd? Hoeveel keer had hij er wel bij gelogen dat hij
gestudeerd had? Dit was véél erger dan die ééne som! Wat zou
Vader wel zeggen als hij dát wist! Als Vader hem gehoord had
vanmiddag, hoe zou hij Vader tegengevallen zijn! Een gemeene
jongen was hij, en veel meer dan Tommy had hij verdiend wat zijn
kleine neefje zooeven gekregen had —

Maar niet van Oom Tom — dat mocht alleen Vader zelf doen!
En Eduard draaide zich om en drukte zijn gezicht zoo stijf in 't
kussen dat hij bijna geen adem kon halen — och, kwam Vader maar!

[a214]

XII.
"Zeg Kerner!" klonk het zachtjes.

"Nou?"

"Wacht even, hij kijkt!"

Mijnheer Snijders zag zoekend de klas rond. "Van Hamel, wil jij de
gebergten Van Zwitserland eens komen aanwijzen?" En Van Hamel
schoof zijn bank uit om langzaam naar voren te komen.

"Zeg Kerner!" herhaalde dezelfde fluisterende stem. Eduard leunde


zoo ver als hij durfde achterover en draaide zijn hoofd half opzij, om
geen woord te verliezen van wat zijn achterbuurman te zeggen had.

"Wil je een stukje drop hebben?"


"Jawel."

"Nou, steek je hand dan uit. — Voorzichtig, doe nou niet zoo sloom,
straks ziet hij het!"

Een kleverig stukje drop werd tusschen Eduards vingers geduwd.

"Ik heb niks geen zin om op te letten!" ging de stem achter hem
voort.

Eduard maakte van een oogenblik dat Mijnheer [a217] Snijders


naar 't bord keek gebruik om 't stukje drop in zijn mond te stoppen.

"Ik ook niet; 'k verveel me dood."

"Dat taaie Zwitserland ook."

"Net zoo taai als die drop van jou."

"Wat?"

"Ik zeg dat 't net zoo taai is als die drop van jou, je tanden blijven er
in kleven!"

"Kerner, je zit aldoor te praten, je hebt een aanteekening! Wilkens,


kom jij de rivieren aanwijzen!"

"Natuurlijk doe ik 't weer," mopperde Eduard. "Net of je in je eentje


kan praten!" en Meertens fluisterde hem in dat dat zijn straf was,
omdat hij zijn drop voor taai had uitgescholden. "Wil je soms nog
een stukje?"

"Nee, dank je feestelijk!"

"Nou, niet of graag!"

"Meertens, houd nu onmiddellijk op met dat gepraat!" viel Mijnheer


Snijders uit, die aldoor in dezelfden hoek hoorde fluisteren; "Kerner,
kom jij voor de kaart en wijs de rivieren nog eens aan!"
Eduard stond op, zijn handen in zijn zakken, liep tusschen de
banken door, en begon voor de klas de verschillende rivieren op te
noemen, telkens even wachtend om 't lastige stukje drop achter zijn
kiezen te duwen.

"Wat eet je toch eigenlijk?"

Eduard keek verschrikt op. "Een stukje drop," zei hij toen.

"Waarom? Ben je verkouden?" en toen Eduard [a218] geen


antwoord gaf, nog eens, ongeduldig: "Geef me antwoord, ben je
verkouden?"

"Nee meneer."

"Heb je drop meegebracht?"

"Nee meneer."

"Heb je het gekregen?"

't Was doodstil in de klas.

"Heb je het gekregen?"

Alle jongens keken en luisterden, maar Eduard bleef zwijgen.

"Heel goed," besloot Mijnheer Snijders, "je verkiest dus geen


antwoord te geven. Ga nu maar naar je plaats, om twaalf uur kun je
schoolblijven."

"Daar bof je bij!" fluisterde Meertens, toen Eduard weer in de bank


schoof, "'n taaie boel, he?"

Maar Eduard was niet meer in de stemming om door te praten, en


schoof met een kwaad gezicht zijn elleboog op de bank.

"Wil je soms een turf hebben?" vervolgde Meertens, en hoe boos


Eduard ook wilde kijken, toch kon hij niet laten even te lachen.
"Kerner, doe die elleboog weg!"

"Ook al goed!" mompelde Eduard, en onverschillig langzaam trok


hij zijn arm weg en bleef schuin in de bank hangen.

Mijnheer Snijders keek nog even naar hem, maar liet hem verder
stil zitten.

"We zullen voortgaan met de les; Van Effen, het is jouw beurt!"
[a221] Toen om twaalf uur de bel gegaan was en de andere jongens
weg waren liet Mijnheer Snijders Eduard bij zich voor de klas komen.

"Kerner, wilde je deze zomer nog toelatingsexamen voor het


gymnasium doen?"

Eduard knikte van ja.

"Zoo, nu, dan wilde ik je eens even het volgende zeggen: ik heb
van de week de rapporten opgemaakt, die jullie vóór de
Paaschvacantie zult krijgen, en ik heb je voor Fransche taal een 4 en
voor rekenen een 3 gegeven. Het werk dat je tegenwoordig inlevert
is bepaald slecht, en je huiswerk is eigenlijk gezegd beneden alle
critiek; en het ergste is, dat het niets dan luiheid van je is; als je je
werkelijk inspant kun je heel goed werken, maar van de fouten die je
maakt is het grootste gedeelte slordigheid en onattentie, en ik heb je
voor vlijt dan ook niet meer dan een 4 kunnen geven."

Eduard luisterde met zijn handen op zijn rug, en aldoor keek hij
naar den grond.

"Je vader zal het zeker wel heel plezierig vinden als je hem dat
schrijft!"

Stijf kneep Eduard zijn vingers tegen elkaar.

"Ik waarschuw je nu nog eens voor de laatste keer, 't is vandaag 3


April, je hebt nog ruim drie maanden tijd, maak dat alles zoo gauw
mogelijk beter wordt en probeer in de Paaschvacantie de tijd die je
verknoeid hebt in te halen. Je begrijpt wel, dat er, als het laatste
rapport zoo is als dit, van examen doen niets [a222] komt! Ziezoo,
denk daar nu maar eens goed over, en nu kun je naar je plaats gaan
en voor je gepraat en je koppigheid vanmorgen de aardrijkskundeles
nog eens uitschrijven."

Haastig begon Eduard, met een krassende griffel; een 4 voor


Fransch en een 4 voor vlijt en een 3 voor rekenen! 't Was ook
allemaal zoo ellendig lastig en vervelend! En dan dat
toelatingsexamen nog! Vader rekende er vast op dat hij er door zou
komen! De Rijn, de Rhône, de Aar, de Reuss, de Limath .... En nu
kwam hij natuurlijk weer veel te laat voor de koffie ook! De Sint
Gothard, de Simplon .... had hem tenminste best een 4 voor rekenen
kunnen geven, 't was op 't vorige rapport ook een 4 geweest! De
Jungfrau .... Vooruit, klaar, streep er onder! —

"Zie je wel dat je 't wel weet?" vroeg Mijnheer Snijders, toen hij 't
nagekeken had.

"Nou ja, aardrijkskunde!" Eduard haalde zijn schouders op.

"Ja, maar 't andere kun je ook wel! Heusch, span je nu eens in!
Begin nu eens met te maken dat er geen enkele fout in de Fransche
thema voor morgen zit! En ga nu maar gauw weg, dag Kerner!"

Eduard haastte zich niet om thuis te komen. Even holde hij tot hij
de straat uit was, toen bleef hij met aandacht bij den singel staan
kijken; een troepje jongens was er aan 't spelen op een vlot, dat met
een stevig touw aan den kant vastlag. Telkens klonk een luid gejuich
als een van de jongens met een [a223] flinke sprong op 't vlot terecht
kwam, en geen van 't troepje scheen zich er aan te storen dat bij 't
daarop volgende geschommel de klompen vol water liepen. Wat zou
't ze ook kunnen schelen! Zij hoefden geen akelige Fransche
thema's te maken, en toelatingsexamen voor 't gymnasium hoefden
ze ook niet te doen!

Met een harden schop tegen een kiezelsteentje liep Eduard verder.
Een 4 voor vlijt! Verbeeld je! En een 3 voor rekenen! Nou ja,
rekenen kon hij nou ook eenmaal niet, en dat zou hij wel nooit leeren
ook! Maar die 4 voor vlijt was onzin! Dat was zeker om vanmorgen;
net of je altijd maar hetzelfde uitgestreken gezicht kon zetten! En
natuurlijk had hij moeten schoolblijven, en Meertens, die begonnen
was, kon stilletjes naar huis gaan. Die kwam er altijd goed af, en hij
kreeg er de standjes voor! En die cijfers moest hij nu aan Vader
schrijven! Wat zou Vader 't ook lam vinden! Misschien kwam 't
rapport ook wel te laat om 't nog te schrijven, Oom Tom had gezegd
dat wanneer hij na de volgende week nog schreef Vader de brief
toch niet meer zou krijgen. Dan moest hij 't vertellen als Vader terug
was!

Eduard liep de stoep op en trok hard aan de schel.

Vervelende boel hier ook al! Was hij maar weer goed en wel thuis!

Trijntje deed de deur open, brommend over 't malle gebel, maar
Eduard liep haar zonder iets te [a224] zeggen voorbij en hing zijn pet
aan de kapstok.

"Edu!" en Lineke kwam de huiskamer uithollen.

"Wat is er?" vroeg Eduard op alles behalve beminnelijke toon.


Lineke bleef voor hem staan. "Wat heb je?" vroeg ze.

"Ik? Ik heb niks!" 't Klonk dreigend. "Wat heb jij?"


"Ik wou je alleen maar vragen of je mij wilde [a227] leeren fietsen!"
zei Lineke verontschuldigend, "maar je zult het zeker ook wel niet
doen!"

"Waarom niet?"

"Nou, je kijkt zoo kwaad!"

Eduard draaide zich om en hing zijn jas op. "Vraag 't maar aan
Hugo of Piet, hoor!" antwoordde hij, toen Lineke bleef staan
wachten.

"Dat heb ik al gedaan, maar die willen juist niet!" klonk het treurig,
"en 'k zou het toch zoo vreeselijk graag leeren!"

Eduard keek zijn nichtje even aan, maar hij zei niets.

"Heb je school moeten blijven, Ee?" vroeg Lineke opeens; "waarom


kijk je zoo boos? Heb je gehuild?"

Hij had niet gehuild, heelemaal niet, verbeeld je dat hij zou huilen
om dat malle schoolblijven! En hij keek Lineke aan en probeerde te
lachen. "Welnee!" antwoordde hij luchtig, "hoe kom je er bij?" en
haastig over het fietsen doorpratend: "In de Paaschvacantie zal ik
mijn fiets gaan halen en dan zal ik het je wel leeren hoor!"

De uitdrukking van Linekes gezichtje veranderde onmiddellijk.


"Zalig dol-leuk!" riep ze, en toen sloeg ze in haar verrukking opeens
een arm om Eduards hals en gaf hem een zoen. "Je bent een
snoes!" verklaarde ze.

Eduard duwde haar lachend op zij.

"Toe, schei uit!" zei hij, "gaan we nog niet koffiedrinken?"

[a228] "Ze zijn al lang bezig!"

Eduard wilde naar binnen gaan, maar Lineke hield hem bij zijn
mouw vast. "Wacht nog even," riep ze, "ik weet nog wat!"
"'t Zal wat zijn!"

"Nee, heusch!"

"Nou, wat dan?"

"Er is een brief!"

"Een brief? Wat voor brief?"

"Nou, voor jou, van Oom Eduard, en ...." Maar Eduard had zich al
losgetrokken en liep de huiskamer in.

"Edu zal 't me leeren!" vertelde Lineke aan de anderen, toen ze


weer op haar stoel schoof, en ze keek met voldoening rond.

"Daar ben je vet mee!" zei Hugo, en Piet reciteerde half hard:
"Ik heb een aardig neefje
Dat op zijn fiets óók rent!
En als je vraagt 'hoe rijd je toch?'
Dan zegt hij 'Wel, patent!'"

Dit vers was een blijvende aardigheid geworden en werd bij alle
mogelijke en onmogelijke gelegenheden en met alle denkbare
variaties te pas gebracht. Maar de geestigheid ging voor Eduard
deze keer verloren; haastig had hij het couvert met de Indische
postzegel opengescheurd, en met alle aandacht was hij verdiept in
wat Vader schreef:

[a230]

"Mijn beste jongen!

Daar zit ik nu in de leeskamer van de groote mailboot


te schrijven; we zijn nu al een heel eind; overmorgen
zullen we waarschijnlijk in Batavia aankomen, en ik
kan je vertellen dat ik er al naar verlang om mijn
voeten weer op vasten grond te zetten! We hebben

You might also like