Calculating Transaction Concurrency from a DB table

A customer I was doing some performance testing for wanted to know how many particular transactions where being processed at any one time. Within their DB they capture the start time and end time of the transaction. So, I thought I could give them an indication of concurrency if I could construct a SQL query to extract and process the data.

Here is a a example that I have constructed in a simple MySQL DB (rather than use their data). For this purpose a table called log containing start and end time.

.

Here is the code I wrote. Any optimisation to the SQL welcome. (I am but a performance tester interested in the data)


SELECT tL.StartTime, (select count(1) from test.Log where StartTime = tL.StartTime) FROM test.Log tL where StartTime > 0 group by StartTime order by 1

Here is the output from running the query. It should be noted that it presents the concurrency at the start time of a new transaction.

Posted in MySQL, Performance Engineering | Leave a comment

Timing JavaScript execution with Fiddler

I have been doing some performance debug work with fiddler recently and I wanted to add some timers to the java script which I am debugging via using an auto responder.

For the JavaScript I am interested in I added the function below at the top of the script.

function now()
{
var d = new Date();
return (d.getTime());
}

At the beginning of the function I want to time I added

var time = now();

At the end of the function I added

alert(“Time to execute = ” + (now()-time)+”);

Posted in Performance Engineering, Uncategorized | Leave a comment

Expanding LoadRunner functions

I quickly wanted to get some lr_status message outputted to the console for every LoadRunner transaction in a script, I basically wanted to insert a status message every time the lr_start_transaction was called to output the transaction name to the console. however, it was a large script and I didn’t want to make any code changes to the load runner script. So I wanted to expand the existing function. The code below was added into the vinit section.

void my_start_transaction (char *name)
{
lr_vuser_status_message("Starting Transaction %s",name);
lr_start_transaction(name);
return ;
};
vuser_init()
{

#define lr_start_transaction(x) my_start_transaction(x)

return 0;
}

LoadRunner Function Override

Posted in LoadRunner | Tagged | Leave a comment

Ticket Website Performance Crash

Another example of a website that may not have been properly performance tested.

Ticket Crash

Posted in performance failures | Tagged | Leave a comment

LoadRunner Spill file too large

Was playing back in loadrunner Vugen multiple iterations of a C code script making calls to a legacy application. First iteration worked fine but then load runner gave me the error message “Spill file too large.” I am not sure what this is but I noticed that if I turned off animation not only did this speed up the script execution but the error message disappeared.

Posted in LoadRunner | Tagged | Leave a comment

LoadRunner not capturing perfmon stats

Just been doing some load testing over the weekend on the production boxes. For weeks I have been collecting resource usage CPU etc from the windows server in the UAT environment. So, I thought let’s just change the machine name and collect all the same stats. Alas, it didn’t work as I did not have the correct privileges. On the UAT box I could login and run perfmon manually but on the production box I had not been given access.

Moral of the story. Remember to get this set up before you are the only person in the office on a Sunday.

Posted in LoadRunner | Leave a comment

Quick Analysis of an Oracle AWR report

Oracle Database 11g Performance Tuning Recipes: A Problem-Solution Approach
by Sam R. Alapati, Darl Kuhn and Bill Padfield
Step 1: Check DB Time

If DB time is significantly higher than the elapsed time then things are waiting.

Elapsed: 60.10 (mins)
DB Time: 197.70 (mins)

The example in the book shows DB time 20x the elapsed.

Step 2: Instance Efficiency

Hopefully these will be above 90%

Buffer Nowait %: 100.00
Redo NoWait %: 100.00
Buffer Hit %: 99.88
In-memory Sort %: 99.95
Library Hit %: 98.84
Soft Parse %: 97.81
Execute to Parse %: 83.30
Latch Hit %: 100.00
Non-Parse CPU: 99.89
Parse CPU to Parse Elapsd %: 0.00 %

The last one shows how much time the CPU is parsing SQL statments, so the lower the better.

Step 3: Top 5 Timed Events

This tell you where the highest resources are being consumed. In the book the example is the db file sequential read would indicate that there where full table scans being performed.

For my AWR report is looks like most of the resources are used in the remote connections over DBlink. Now I need to find out if this is due to a poor network or just user load.

Posted in Oracle, Performance Engineering | Leave a comment

I/O Test Tool for Oracle DBs

Been surfing the web and found a tool called Orion by Oracle that can be used for benchmarking your I/O subsystem and help identify potential problems before installing the DB,

http://www.oracle.com/technetwork/topics/index-089595.html

 

Posted in Oracle, Performance Engineering | Leave a comment

Interesting Presentation on High Performance Trading System

Just came across this presentation. Some very interesting performance engineering concepts, particularly like the parts on Mechanical Sympathy and the fact you need developers to understand the hardware so that they can produce high performance/responsive code.

http://www.infoq.com/presentations/LMAX

Posted in Performance Engineering | Leave a comment

Script Scanning slow user Performance

This week I have been investigating slow click to screen response times for a browser based app. Using Fiddler on the client site PCs showed that the majority of time was client rendering/JavaScript execution. Great I thought I could debug this back at base.

However, when I connected my laptop to the test environment response times where much worse. It wasn’t the test environment as fiddler showed that back end performance was fine. My laptop was a higher spec than the client PC so I started up perfmon and observed high CPU as the main cause. However, it was not the Internet explorer process that was consuming the CPU but the McAfee intrusion protection process. Little known to me this was a recent corporate wide download (ok, I probably got the email about it but hey, I get a lot of emails!)

So. the delay was primarily the anti-virus script scanning the JavaScript. Disabled on the clients PC but not on
my laptop Luckily, there is a registry setting that will disable scanning for a particular URL. With that in place I could get around to debugging the JavaScript with IE 8.

Moral of the story check to see if script scanning is enabled on yours abs the clients PC.

Posted in Performance Engineering | Tagged | Leave a comment