devConf LK 2019
Letterkenny, 23 February 2019
http://bit.ly/devConfLK2019
How do compare Visual Studio Web & Load Test with JMeter? Can I replace one with the other? How hard is this open-source tool? Do I need to install and/or learn Java?
We will answer these questions and more with a practical introduction, exploring:
- Basics of JMeter
- Recording
- Collecting and analyzing results
- Tokens and parametrization
- Scenarios and distributions
- Setting up a test rig
6. Performance is
a Feature
«there are two
kinds of websites:
the quick and the
dead»
https://blog.codinghorror.com/performance-is-a-feature/
7. Response time
0.1 second is about the limit for having the user
feel that the system is reacting instantaneously,
meaning that no special feedback is necessary
except to display the result.
1.0 second is about the limit for the user's flow of
thought to stay uninterrupted, even though the
user will notice the delay. Normally, no special
feedback is necessary during delays of more than
0.1 but less than 1.0 second, but the user does lose
the feeling of operating directly on the data.
10 seconds is about the limit for keeping the user's
attention focused on the dialogue. For longer
delays, users will want to perform other tasks
while waiting for the computer to finish, so they
should be given feedback indicating when the
computer expects to be done. Feedback during
the delay is especially important if the response
time is likely to be highly variable, since users will
then not know what to expect.
Miller, R. B. (1968).
Response time in man-
computer
conversational
transactions. Proc. AFIPS
Fall Joint Computer
Conference Vol. 33, 267-
277.
12. What is JMeter?
Buy one get three
Script editor Visual Studio Web Test
Runner Visual Studio Load Test
Distributed runner Azure Cloud load testing
Does not manage the test rig for you
Free & widely used
Apache JMeter may be used to test performance both on
static and dynamic resources, Web dynamic applications.
It can be used to simulate a heavy load on a server, group of
servers, network or object to test its strength or to analyze
overall performance under different load types.
22. Setting up a test rig (1/2)
Create the VMs
Set environment variables for Java and JMeter; e.g. using a script like jcmd:
Title Java Environment
set JAVA_HOME=%~dp0jdk
set PATH=%PATH%;%JAVA_HOME%bin;%~dp0bin
cmd /k cls
Client (controller) jmeter.properties
remote_hosts=TEST-RIG1,TEST-RIG2,TEST-RIG3
server_port=4000
client.rmi.localport=4001
server.rmi.port=4000
server.rmi.localport=4001
server.rmi.ssl.disable=true
The last one is necessary to work around this bug
https://bz.apache.org/bugzilla/show_bug.cgi?id=62463
23. Setting up a test rig (2/2)
The Server (rig) jmeter.properties should have
server_port=4000
client.rmi.localport=4001
server.rmi.port=4000
server.rmi.localport=4001
server.rmi.ssl.disable=true
Open firewall ports
Invoke-Command -ComputerName "TEST-RIG0","TEST-RIG1","TEST-RIG2","TEST-RIG3" -
ScriptBlock {
New-NetFirewallRule -DisplayName 'JMeter Server' -LocalPort "4000-4010" -
Profile Any -Direction Inbound -Protocol 'TCP' -Action 'Allow' -Enabled 'True'
New-NetFirewallRule -DisplayName 'JMeter Server' -LocalPort "4000-4010" -
Profile Any -Direction Outbound -Protocol 'TCP' -Action 'Allow' -Enabled
'True’
}
24. Run test using rig
Server (rig)
jmeter-server -Djava.rmi.server.hostname=%COMPUTERNAME%
Use Task Scheduler
https://github.com/zloeber/Powershell/blob/master/Supplemental/Add-
UserToLoginAsBatch.ps1
Client (controller)
jmeter -n -t …Test.jmx -l …Test.log -r
Tune Java memory
25. Integrate in a pipeline
Cloud-based Apache JMeter Load Test task
Convert JMeter XML to JUnit
28. Why JMeter is interesting to a Visual Studio developer?
Visual Studio 2019 will be the last version with load test
features.
https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes-
preview#test-tools
https://devblogs.Microsoft.com/devops/cloud-based-load-testing-eol
35. Bibliography (2)
Writing High-Performance .NET Code —
Ben Watson (Ben Watson)
https://www.amazon.it/Writing-High-
Performance-NET-Code-
Watson/dp/0990583430/
Time Is Money: The Business Value of
Web Performance — Tammy Everts
(O'Reilly Media)
https://www.amazon.com/Time-Money-
Business-Value-Performance/dp/1491928743
35
36. Bibliography (3)
Software Performance and Scalability: A
Quantitative Approach — Henry H. Liu
(Wiley)
https://www.amazon.com/Software-
Performance-Scalability-Quantitative-
Approach/dp/0470462531
Continuous Delivery with Windows and .NET
— Matthew Skelton and Chris O'Dell
(O'Reilly)
http://www.oreilly.com/webops-
perf/free/continuous-delivery-with-windows-and-
net.csp
36