Vous êtes sur la page 1sur 27

Performance

Testing

Performance Testing Web


Applications with OpenSTA

Dan Downing, VP Testing Services


MENTORA GROUP
Atlanta • Boston • DC
www.mentora.com
Objectives

¾ Present the basics of using OpenSTA for load


testing web apps.

¾ Things you will learn:


ƒ Capabilities of OpenSTA
ƒ Basic script modeling, test execution, and results analysis
ƒ Resources for further learning

2
Copyright 2006 Mentora Group Inc.
Terms & Concepts

• History
– Develop by Cyrano, a French software company
– Released into public domain in 2001

• Collector: System resource monitor script


• Commander: Main UI and test launcher
• Modeling: Script development
• SCL: Script Control Language
• Task Group: Load scenario script or Collector script
• Test: Set of scripts comprising load scenario and related results
• Timers: Start-Stop transaction timing markers for actions to be timed
• Variables: Script Parameters

3
Copyright 2006 Mentora Group Inc.
Capabilities
• Applications it will test
– Protocols: Standard http/https only (not Oracle 11i, SAP, RMI, web services…)
– Development technologies: D/HTML, javascript, XML payloads, jvm servers (not java
applets, “latest technologies”)
• Functionality (LoadRunner = 10)
– Script development: 7/10 (Handles sessionid cookies; UI intuitivess “ok”; SCL
language support “good”)
– Test/Debug: 6/10 (Need error-handling and content checks to ensure script
functioning properly)
– Test execution: 7/10 (slow refresh on summary stats
– Results analysis: 3/10 (built-in graphs limited; need to do much in Excel)
• Robustness
– Excellent thread model; spawns a new thread only when it needs it to drive more load
– Sometimes hangs, crashes (must manually clean up processes and sometimes reboot)
– Conflicts with other load testing tools’ listener processes (run only one at a time)
• Limitations
– Does not record with IE7 or Firefox – needs IE6
– Max of 1664 users per Commander session
– Watch out for
• Trip-ups with https
• Too many parameter files can create file open bottleneck, throttling load
• Code your own error handling of http 400 and 500 errors

That said, it works great on many web apps! 4


Copyright 2006 Mentora Group Inc.
Download & Install

• V.1.4.3 12/04 is
current release
• 5.7 MB download
• Windows installer
• Runs on XP, W2K,
NT SP5
• Installer (usually)
runs flawlessly

5
Copyright 2006 Mentora Group Inc.
Components & Process

OpenSTA

1 Modeler Step 1: Develop test scripts


Record, parameterize user-entered data, parameterize dynamic
system data, adjust think-times & timers, test/debug
2 Step 2: Define & Launch Test
Commander
Define load scenario; configure Collectors; launch test;
monitor interactively

Name 3 Step 3: Export, Graph, & Analyze Results


Excel
Server* Select & filter results; export; generate graphs; analyze
& interpret.
* Listener process that communicates between
Commander, load drivers, & target system
6
Copyright 2006 Mentora Group Inc.
Architecture
Remote load driver(s)

SD

Sun E NT E RP R I SE
40 00


ULTRASPARC
DR IVEN

System Under Test

Local load
driver(s)

OpenSTA

Web Relay Daemon (opt.)

Name Server 7
Load Driving System
Copyright 2006 Mentora Group Inc.
Script Modeler
Menu bar
Toolbar

Html
header,
body
Script panes
editor
pane

Replay
output
pane

8
Copyright 2006 Mentora Group Inc.
Modeling Scripts: Cookies

• Defined automatically during Record

. • Handled automatically during replay


.
.

9
Copyright 2006 Mentora Group Inc.
Modeling Scripts:
Parameterizing User-Entered Data
• Define File variable with proper scope
. • Substitute user-entered static data with
. a variable; do “global edit
.

.
.
.

• Process file values


– MUTEX
– NEXT
– SET
• Display value to ensure its working
– LOG

10
Copyright 2006 Mentora Group Inc.
Modeling Scripts:
Capturing System Response Values

• Load Response Header/Body into a buffer


(character array)
• Parse desired value and load into a variable
. • Do global replace so it gets “fed back” on
.
later urls
.

11
Copyright 2006 Mentora Group Inc.
Commander
Menu bar
Test start/stop Toolbar

Test Configuration tab

Repository
Tree View
pane

Runtime
options
panel

12
Copyright 2006 Mentora Group Inc.
Commander: Monitoring a Test
Test start/stop Toolbar

Monitoring tab

User
ramp
Execution
graph
error
window

Execution
summary
pane

13
Copyright 2006 Mentora Group Inc.
Commander: Exporting Results
Test start/stop Toolbar

Results tab

Audit log

http
response
list

Timers list

14
Copyright 2006 Mentora Group Inc.
Exporting Bandwidth

Bandwidth
graph

15
Copyright 2006 Mentora Group Inc.
Graphing & Interpreting:
Scalability

• All workflows
scale well
though 60
users,
degrading
exponentially
above that level
16
Copyright 2006 Mentora Group Inc.
Graphing & Interpreting:
Page Times

• Sharp degradation
of "Display All
Studies" indicates
this page is the
major contributor
to RSD process
degradation

17
Copyright 2006 Mentora Group Inc.
Graphing & Interpreting:
Bandwidth Utilization
Bandwidth ramps
steadily and
roughly plateaus Bandwidth Utilization Average bandwidth • Bandwidth line’s
characteristically utilization is 6.8
600 at maximum load Megabits per second 12
shape indicates no
network throughput
500 10
bottleneck
Load (concurrent users)

400 8 • Average bandwidth


utilization is ~7 Mbps

Mbps
300 6

200 4

100 2

0 0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Test Session Time

18
Copyright 2006 Mentora Group Inc.
Graphing & Interpreting:
Application Errors

HTTP Error Responses Application unstable


Stable above 120 concurrent
range users • http ‘server errors’
600 250
Load (concurrent users)

500 200
begin above 120
400
150
concurrent users

Errors
300
100
• Error spikes indicate
200
50
unstable application
100
well before target
0 0
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44
load
Concurrent Users 20 60 120 175 235 295 350 410 453 477 497 495 495 492 488 487 486 485 485 484 479 479 478
HTTP 5xx Errors 0 1 1 80 94 178 33 134 1 88 46 230 1 1 211 71 158 92 146 88 1 99 19

Test Session Time (min)

19
Copyright 2006 Mentora Group Inc.
Directory Structure

• Base directory; location pointed to by Tools/Repository Path


– Main applications
– DLLs
– More DLLs, exes, ini files
– More DLLs
– Test assets (by project)
• <EMPTY>
• Screen shots <.ALL>
• Data files <.FVR>
• Compiled scripts <.tof, .scd>
• Collector scripts <.NTP>
• Scripts (source SCL code) <.HTP>
• Tests
– Load scenarios <Full_Load_1>
» Test results folders <09-06-2006-10.000>

20
Copyright 2006 Mentora Group Inc.
Architecture: Processes

• ArchMgrDmn.exe – Controls remote load drivers


• CyrDmn.exe – “Listener” daemon (started by Name Server)
• DaemonCFG.exe -- Name Server configuration utility
• OSComnander.exe – Main Commander UI
• TestManager.exe – Overall test execution manager
• TestPlugin,exe – Test configuration plug-in
• TExecuter_htp.exe – Runtime engine that runs task groups
• TExecturer_ntp.exe – Runtime engine that runs Collectors
• TModeller_Web.exe – Script Modeler UI

21
Copyright 2006 Mentora Group Inc.
Advanced Topics

• Development standards
– Naming conventions for Scripts, Timers, Tests
– Results directory structure
• Graphing results
– Pivot tables
– Creating & customizing “2 axis” charts
• Advanced script modeling
– Response parsing functions for capturing system dynamic values
– Parameter file management with ACQUIRE MUTEX
– Randomizing think times with GENERATE
– Error handling with ON ERROR
– Handling state ids in redirects with EXTRACT
– Debug statements
• OpenSTA init settings
– Timeout
– Max Ports

22
Copyright 2006 Mentora Group Inc.
Resources: On-Line Help

• Make it your
friend!
• Can get all the
basics and more

23
Copyright 2006 Mentora Group Inc.
Resources: FAQs

• Many “beyond basic”


how-tos in these
FAQs
• Many forum
questions from new
users direct you
back to the FAQs

24
Copyright 2006 Mentora Group Inc.
Resources: OpenSTA Forum
• Very active forum; email-based
• Quick responses to questions
• Anyone can sign up, read, submit posts
• Many OpenSTA experts respond

25
Copyright 2006 Mentora Group Inc.
Resources: Other

• Document Object Model


– www.w3.org/TR/1998/REC-DOM-Level-1-19981001/introduction.html

• OpenSTA Tutorial On-line Course


– http://mentora.com/training.htm
• Load testing presentations
– http://www.mentora.com/library.htm

• OpenSTA Graph examples


– http://mentora.com/documents/WebLoadTestTimesGR.pdf

• Testing blogs
– www.testingreflections.com – Antony Marcano
– www.exploratorytesting.com – James Bach
– http://tejasconsulting.com/blog/?p=88 – Danny Fraught
• (comment on using Excel Pivot Tables for graphing)

26
Copyright 2006 Mentora Group Inc.
Questions?

ddowning@mentora.com
www.mentora.com

27
Copyright 2006 Mentora Group Inc.

Vous aimerez peut-être aussi