Sunteți pe pagina 1din 46

Investigating performance outside of workflow and indexes

Danny Kellett Java System Solutions

Agenda
Latency
-

What is it and why is it such a big deal? How do I test for it? How to use this information to demonstrate performance for your users What are they How to read the logs How to let your AR Server tell you how many it needs What types there are

Queues & Threads


-

Plugins
-

How they can impact performance


The process of diagnosis and fix
2013 WWRUG Canada Inc. All Rights Reserved
2

Objects and Results


Objectives
-

To understand that no matter how many CPUS and RAM you have, a poor network can bring an application to its knees Demystify the confusion about queues and threads Understand the black boxes called plugins Understand what these are and to give you the tools to understand your own AR System To sit through a very technical and possibly boring tech talk and live to talk about it

Results
-

Skills developed
-

The knowledge to understand the not so well documented parts of the AR System

2013 WWRUG Canada Inc. All Rights Reserved

Latency
Higher latency decreases app response time, user performance and perceived app quality

2013 WWRUG 2012Canada WWRUG Inc. Canada All Rights Inc.Reserved All Rights Reserved 4

Latency :: What is it and why is it such a big deal?


What is it?
-

In a network, latency, a synonym for delay, is an expression of how much time it takes for a packet of data to get from one designated point to another. There are two typical types:

One way
The time from the source sending a packet to the destination receiving it

Round trip

The one-way latency from source to destination plus the one-way latency from the destination back to the source

Latency is not bandwidth


-

Two key elements of network performance are bandwidth and latency. The average person is more familiar with the concept of bandwidth as that is the one advertised by manufacturers of network equipment. However, latency matters equally to the end user experience
2013 WWRUG Canada Inc. All Rights Reserved
5

Latency :: What is it and why is it such a big deal?


Why is it such a big deal to us and BMC Software?
-

The BMC AR System architecture has multiple network node points

Each line in the diagram is effected by latency


If each line added even milliseconds, it all adds up! If any point adds a delay then the whole trip is effected

The AR System API (ARAPI) is very chatty


-

Instead of eating with a big spoon it eats with a small spoon

2013 WWRUG Canada Inc. All Rights Reserved

Latency :: What is it and why is it such a big deal?


Real life example
-

ITSM 7.6.04 SP2, load balanced environment as the diagram. Browser was Firefox v21.0. URL is HTTPS From the incident console, double clicking an incident. Took a measurement on the current network to get the number of trips, amount of data and response time in seconds With added latency of 50 ms from the client (browser on desktop) through the load balancer and to one of the Mid Tier servers

Test
-

50ms

Baseline (Initial, first load example)


-

Second test with latency


-

2013 WWRUG Canada Inc. All Rights Reserved

Latency :: What is it and why is it such a big deal?


Results of Baseline (Initial, first load example)
# Trips Client to server Server to client Total 65 103 168 Amount of Data 126.6k 318.6k 445.2k 9s Time (seconds)

50ms

Results of test with 50ms added latency


Total 168 445.2k 12s

Test summary Just 50ms of network latency in just one piece of the BMC architecture, from the browser to the Mid Tier, can add to your end user response times!
2013 WWRUG Canada Inc. All Rights Reserved
8

Latency :: How did I do those tests?


Before you start, understand these things
-

What happens when you type the Mid Tier address in the URL bar

Your browser will use your desktop network configuration to get the network details of your Mid Tier. First is will look at your local hosts file for the Mid Tier host name. If it is not in there it will ask the Domain Name Service (DNS) If your Mid Tier has an IP address of 192.168.0.5 and it is configured in your DNS database, then the browser will connect to it and everything works, you see the application etc BUT if you added a line in your local hosts file (c:\windows\system32\drivers\etc\hosts) so that your desktop believes its not that IP address but a different one e.g. 127.0.0.1 then the browser will try and connect to that. 127.0.0.1 is something called a loopback adaptor and its basically means your own machine you are typing on. And unless you have a Mid Tier running on your machine, it will fail.
2013 WWRUG Canada Inc. All Rights Reserved
9

Latency :: How did I do those tests?


Before you start, understand these things
-

What happens when you type the Mid Tier address in the URL bar (part 2)

What if you had a Mid tier on your desktop and you added the same Mid Tier host name to your local hosts file with 127.0.0.1? Your browser would still say the correct URL address but you would be connecting to the Mid Tier on your desktop and not the one on the network.

OK so why do I need to know that?

If you installed a piece of software on your desktop that wasnt a Mid Tier but something that connected to your REAL Mid Tier on the network, 195.168.0.5, BUT delayed all connections, adding latency . Then this is called a Proxy and this is what I used.
2013 WWRUG Canada Inc. All Rights Reserved
10

Latency :: How did I do those tests?


Add a proxy on the desktop to simulate latency

2013 WWRUG Canada Inc. All Rights Reserved

11

Latency :: How did I do those tests?


Find your Mid Tier real IP using ping or nslookup
-

<<TODO>> Insert screenshot of ping itsm7604.javasystemsolutions.local and get back 195.168.0.5

Insert that value into the proxy app as the MAP IP

Add the Mid Tier URL host name to the loopback address in your local hosts file

Click Start on the proxy. Use your browser as before and record the timings.
2013 WWRUG Canada Inc. All Rights Reserved
12

Latency :: How can this predict your response times


Obtain your users latency times to the Mid Tier server.

Latency London Paris 15 45

Open Incident

Houston

484
2013 WWRUG Canada Inc. All Rights Reserved
13

Latency :: How can this predict your response times


Obtain your users latency times to the Mid Tier server.
-

Using ping, which uses ICMP but sometimes turned off on network equipment Those times are round trip, so the time its taken from client to server AND back from server to client. Therefore when testing, half those values!

2013 WWRUG Canada Inc. All Rights Reserved

14

Latency :: How can this predict your response times


Obtain your users latency times to the Mid Tier server.
-

Using http-ping, which uses the actual web server and this will always be slower than a ping due to the fact it waits for the web server to respond with a HTTP code

Those times are round trip, so the time its taken from client to server AND back from server to client. Therefore when testing, half those values!

2013 WWRUG Canada Inc. All Rights Reserved

15

Latency :: How can this predict my response times


TODO INSERT SCREENSHOT OF FREE LATENCY APP OR maybe do a Demo if the Demo laptop could run vmware etc. Need to find out from the WWRUG people

2013 WWRUG Canada Inc. All Rights Reserved

16

Latency :: How can this predict my response times


Using free tools, you can test the response times of all your users from your own desktop!

Latency London Paris Houston 15 45 484

Open Incident 6s 8s 30s

2013 WWRUG Canada Inc. All Rights Reserved

17

Latency :: If your latency is high


Speak to your network teams about Quality of Service (QOS)
-

Some network equipment can prioritise certain protocols. The Mid Tier uses either HTTP typically on port 80 or HTTPS typically on port 443

Make sure your architecture has as little latency as possible between the Mid Tiers and AR Servers and more importantly between the AR Server and the database.
-

ITSM 7.6.04 with approx 900 concurrent users fires approx 127 SQL statements per second at the database. Latency would bring the app to its knees!! There is more traffic between the browser and the Mid Tier than there is from the Mid Tier to the AR Server.

Install local Mid Tier instances near your end users.


-

Or if you DARE! Make customisations to workflow to remove trips altogether.


-

Tell boring story at large outsourcer


2013 WWRUG Canada Inc. All Rights Reserved
18

Threads & Queues

2013 WWRUG 2012Canada WWRUG Inc. Canada All Rights Inc.Reserved All Rights Reserved 19

Threads :: Lets all get up to speed on queues & threads


A queue is an entry point into the AR System
-

They are identified by a number, and sometimes referred to as an RPC queue. Here are some examples

390600 = Admin 390603 = Escalation 390620 = Fast API calls (just a name without intending to indicate performance) 390635 = List API calls (just a name as well but was aimed at things that search and return lists/large amount of data)

A queue can have one or more threads defined for them. On startup, each thread creates a connection to the database that it uses throughout its existence. Threads only close when you shutdown the server or it cannot connect to the database One queue has one or more threads
20
2013 WWRUG Canada Inc. All Rights Reserved
20

Threads :: Lets all get up to speed on queues & threads


If an API call gets routed to a queue and all the current threads are being used, it will look at the Max Threads value configured for that RPC queue. If the current thread number is lower, then it will create another thread and use that.

If the list queue is at max resource, it will put the work on fast queue and vice versa
If both are full, it will move the work to the admin thread So, the system has a set of queues -- some pre-defined, some private and defined per instance -- and each of them has processing threads as configured in the ar.cfg/ar.conf

21
2013 WWRUG Canada Inc. All Rights Reserved
21

Threads :: Confusing or mixed messages


Google/Search BMC Support/Search ARSlist/Search BMC Support BMC Atrium Core 8.0.00_20120921_docs.pdf
-

Page 87 - set Min Threads to 5 and Max Threads to 10

262, same information repeated on 356, 383


Fast threads At minimum, the same number as you have CPU cores; at maximum, 3 times the number of CPU cores, but no exceeding 32 List threads At minimum, the same number as you have CPU cores; at maximum, 5 times the number of CPU cores, but not exceeding 32 CPU x 1.5 for the Private queue.

Page 2048

SW00427239 - Fast and List threads are not set as per the recommended Queue settings.
22

Doug Mueller ARSList post - In theory, there is no reason you cannot have 10s or even 100s of threads in a queue.
2013 WWRUG Canada Inc. All Rights Reserved
22

Threads :: Confusing or mixed messages


I do not believe the amount of threads is based on the number of CPUs alone. In all my tests, the CPU usage never went over 55% (excluding Developer Studio work) If the infrastructure can handle it E.g. an MSSQL database has a maximum 32767 connections. So theoretically, if the AR Server could fire that many connections and process them, then why not? Just for now think about if a connection to a database is doing some long query and is held up, the CPU on the AR Server is still the quickest component in the architecture and will have to wait and therefore it will do other things Its like saying a car can only handle 100BHP
-

Sure it can handle more if the rest of the car components and driver can handle it!
2013 WWRUG Canada Inc. All Rights Reserved
23

23

Threads :: In my experience then answer is


There are so many variables that make your system unique
-

CPU types, HT, SMT, Cores etc


Virtual CPU vs a bare metal CPU differs http://www.vmware.com/files/pdf/techpaper/VMW-Tuning-LatencySensitive-Workloads.pdf http://scn.sap.com/thread/1646435

Virtualisation or bare metal

Operating systems and settings

Therefore after 14 years of experience, researching hours and hours, googling the WHOLE internet on system architecture, posting on so many forums my answer is
24
2013 WWRUG Canada Inc. All Rights Reserved
24

Every environment is different so suck it and see! Get the system to tell you!
And heres how I do it...

Threads :: Heres how :: Simple principles


In a queue, if all the threads are constantly busy then you need to do some investigation
-

If you have a high number of threads already, and these threads are taking too long to complete. E.g time to look at the queries to the database and work with your DBA to speed them up If the above doesnt work, or the DBA doesnt want to play ball, then its time to increase the Max Thread count in the AR System Administration Console

Each queue and thread takes system resources such as CPU power and memory. If those resources are maximised, then its time for an upgrade or another AR Server in the server group

25
2013 WWRUG Canada Inc. All Rights Reserved
25

Threads :: Heres how :: Step 1 Create logs


In case you didnt know, you can have the multiple log data in one file. Therefore start a log of API, SQL and filter

Run this log in your peak periods if you can. Or if you are not live, then use a volume and performance testing application
This log will get large so make sure you have enough space

26
2013 WWRUG Canada Inc. All Rights Reserved
26

Threads :: Heres how :: Step 2 Run Log Analyzer


There are a couple of tools you can use
-

ARLogAnalyzer

https://communities.bmc.com/docs/DOC-2973 http://www.missingpiecessoftware.com/products/ar-log-file-analyser

AR Log File Analyser

27
2013 WWRUG Canada Inc. All Rights Reserved
27

Threads :: Heres how :: Step 2 Run Log Analyzer


Understanding the detail in the AR logs
-

Green -- The same user Purple -- The same RPC 390620 which is the Fast queue Red -- TWO RPC IDs meaning two different API calls being processed

Every call that the dispatcher thread receives is assigned an RPC ID that can be used to identify the call from the time the call is placed into the queue until a response is sent back to the client

Cyan -- One thread executing both API calls one after the other

28
2013 WWRUG Canada Inc. All Rights Reserved
28

Threads :: Heres how :: Step 3 What to look for?


Verify the number of threads is actually running. If the numbers in the log file match the Max Threads then you know at some point all threads were utilised!

ARLogAnalyzer

AR Log File Analyser

29

Both results show : Fast Max is 30 but 27 being used List Max is 40 but 35 being used
2013 WWRUG Canada Inc. All Rights Reserved
29

Threads :: Heres how :: Step 4 Idle time


Thread idle time is the time from when a thread completes some work and then has to start work again Therefore the lower the idle time, the busier the thread is

Remember that this will probably spike during the working day but this is truly the best way to monitor when your busy periods are and how stressed your system is
There is no such thing as 0 idle time. Even getting work from the dispatcher takes at least some time
-

Therefore ignore the MIN Idle Time examples include 0.0007

Look for very small numbers on the AVE idle time column

30
2013 WWRUG Canada Inc. All Rights Reserved
30

Threads :: Identifying busy periods


You can identify when the AR Server has needed to increase the thread count on a queue We can see one queue 390626, which is configured to start with 6 threads (Min Threads value below)

Looking through the log, we can see the thread number synchronously increment for the first 6, 28 to 33, then we see 130

31
2013 WWRUG Canada Inc. All Rights Reserved
31

Threads :: Identifying busy periods


Note the thread id 0000000130 underlined in red Search your log file for TID: 0000000130

The above screenshot of the log entry is on one line but I had to cut it to fit on the slide Find the first instance of the thread id (TID) and note the time in this example is 13:08. This is when the AR Server decided it needed to create a new thread on the 390626 queue

32
2013 WWRUG Canada Inc. All Rights Reserved
32

Threads :: Server Statistics


Another way of identifying number of threads started
-

AR System Administration Console > System > General > Review Statistics

33
2013 WWRUG Canada Inc. All Rights Reserved
33

Plugins

2013 WWRUG 2012Canada WWRUG Inc. Canada All Rights Inc.Reserved All Rights Reserved 34

Plugins :: Lets all get up to speed on plugins


Three types of plugins. Each do a different thing
-

AREA External Authentication ARF Filter plugin which are used to extend actions of filters ARDBC Access data outside of forms but mimic the behaviour of forms Which obviously relates to the programming language they are built with Runs through an executable file arplugin.exe (windows), arplugin (*NIX) Surprisingly runs from separate java processes, or java virtual machines

There are two types of plugins. C and Java


-

C
-

Java
-

They have completely separate configuration, logging output etc


35
2013 WWRUG Canada Inc. All Rights Reserved
35

Plugins :: Lets all get up to speed on plugins


C specific
-

arplugin.exe / arplugin started via armonitor and configured to run in armonitor.cfg / armonitor.conf

E.g. /opt/bmc/ARSystem/bin/arplugin s srv1 i /opt/bmc/ARSystem

Configured through the ar.cfg / ar.conf Plugin:, Plugin-Path: & Plugin-Port: apply only to the C plugin daemon. How to identify them? In the ar.cfg/ar.conf

Plugin: Then .dll on Windows, or .so or .a on NIX systems


E.g. Plugin: ServerAdmin.so E.g. Plugin: ardbcconf.dll

Logging is controlled through the AR System Administration Console

36
2013 WWRUG Canada Inc. All Rights Reserved
36

Plugins :: Lets all get up to speed on plugins


Java specific
-

A Java process is started via armonitor and configured to run in armonitor.cfg / armonitor.conf

E.g. /usr/java/jdk1.6.0_06/jre/bin/java -Xmx512m -classpath /opt/bmc/ARSystem/pluginsvr:/opt/bmc/ARSystem/pluginsvr/arpluginsvr 75.jar com.bmc.arsys.pluginsvr.ARPluginServerMain -x svr1 -i /opt/bmc/ARSystem Primary plugin server Full Text Search Engine 2 CMDB plugin servers

Typical ITSM instance has 4 Java plugin servers running


Configured via three seporate pluginsvr_config.xml files

How to identify them? Within pluginsvr_config.xml files and some are aliased in the ar.cfg/ar.conf
Logging is controlled through each log4j_pluginsvr.xml files
2013 WWRUG Canada Inc. All Rights Reserved
37

37

Plugins :: Lets all get up to speed on plugins


2 main types of functionality within the plugins 1-Way and 2-Way
-

1-Way is the AR Server calls the plugin and the plugin returns a response

2-Way is the AR Server calls the plugin but in order to complete that request, the plugin must connect back to the AR Server and lookup some data, and then returns a response

The two way plugins are typically the ones to look out for with regards to performance
-

E.g. REMEDY.ARDBC.APPQUERY

38
2013 WWRUG Canada Inc. All Rights Reserved
38

Plugins :: Monitoring the configuration in logs


Same process of assigning queue numbers permitting the monitoring of data within the logs
-

E.g. If the a plugin is configured on 390624 then what API and SQL the plugin fires against the AR Server, will be in the API and SQL logs with:

<Client-RPC: 390624 >

39
2013 WWRUG Canada Inc. All Rights Reserved
39

Plugins :: Example - REMEDY.ARDBC.APPQUERY


Seen in the log files when viewing the Overview Console Find if its a C or a Java plugin by looking in the ar.cfg/ar.conf
-

Server-Plugin-Alias: REMEDY.ARDBC.APPQUERY REMEDY.ARDBC.APPQUERY srv1:9999 See port number as :9999 so if Plugin-Port: 9999 then its a C plugin. Otherwise you can tell its a Java plugin.

Searched for in the java plugin config xml (pluginsvr_config.xml)

Now look for the above classname line in the log4j_pluginsvr.xml


40
2013 WWRUG Canada Inc. All Rights Reserved
40

Plugins :: Example - REMEDY.ARDBC.APPQUERY


Now look for the above line in the log4j_pluginsvr.xml

Change warn to trace, restart and open the arjavaplugin.log

ITSM OOTB, this plugin is not configured to run on its own queue. Add the line in the pluginsvr_config.xml

41
2013 WWRUG Canada Inc. All Rights Reserved
41

Plugins :: Summary
Plugins that connect back to the AR Server are clients just like the User Tool and Mid Tier etc Most, if not all, are not configured to run on queues OOTB

Its OK to run trace logs in production as long as it is managed!


-

No better log than a real users, working system, filled one Have some automated scripts for log rotation with email notification Just to get a weeks worth of usage statistics E.g. If we add 1000 users, will my need to increase my thread count?

Include this analysis in your capacity management assessment


-

42
2013 WWRUG Canada Inc. All Rights Reserved
42

Full screen slide example

2013 WWRUG 2012Canada WWRUG Inc. Canada All Rights Inc.Reserved All Rights Reserved 43

Conclusion
Add your conclusions here.

2013 WWRUG Canada Inc. All Rights Reserved

44

Question/Discussions
Add your discussion points here

2013 WWRUG Canada Inc. All Rights Reserved

45

Wrap-up
Contact information

2013 WWRUG Canada Inc. All Rights Reserved

46

S-ar putea să vă placă și