Showing posts with label Performance Testing. Show all posts
Showing posts with label Performance Testing. Show all posts

Friday, March 1, 2013

Rapid file duplicator or copier


Recently, I was given a task to check the document processing capability of an application. The objective of the test was to check whether system can consume 2 million documents in one hour duration.

System is configured to consume the documents from the specified folder, but the question is how to create 2 million documents in a folder. Manually copying the files take lot of time and test need to be repeated multiple times. Windows file system don't work optimally when a folder contain more than 5000 files, so need to create sub-folders, each sub-folder containing 4000 files and in total 2 million files.

I have created simple VB script program that use copy method to create duplicate files, it took nearly 20 hours. Then I started redesigning the program that will run the copy method in multiple threads, so that task can be accomplished in 1 hour by utilizing the 100% CPU capacity.

It consists of two programs. Initiator program calls the duplicator program multiple times, so that each program runs in different thread and task is accomplished quickly. Program settings need to be tweaked as per the system configuration, so that threads run in an optimal way, not too many or too less threads.

Program download link

Initiator.vbs 


'Make sure you have enough space on the system, this program run in multiple threads by utilizing 100% cpu
'Just copy the files in any folder, it will automatically create subfolders
'Perform file partations in the optimal way.

FileName = "test.docx" 'Make sure file exist in the folder
NumberOfCopies = 100 'Make sure division with the below number gives reminder 0 -  1000000 (Actual Test)
NumberOfPartations = 10 'Number Of partaions or blocks for the above said file copies  - 10000  (Actual Test)
TimeStampGenerationAfterCopies = 10 'Generate time stamp in the log file after creating som many files - 1000 (Actual Test)
NumberOfFilesInFolder = 4 'Number of files inside each folder - 3000 (Actual Test)


'-------------------------------------------------------------------------------------

'For appending zeros to the file name, so that files are sorted sequently
Zeros = len(NumberOfCopies)

Const ForAppending = 8
count = NumberOfCopies/NumberOfPartations

Set wshShell = CreateObject( "WScript.Shell" )
set fso=CreateObject("Scripting.FileSystemObject")
WorkingDirectory = fso.GetParentFolderName(Wscript.ScriptFullName)

'Check folder exist, else create the folder
strFolder = WorkingDirectory & "\Duplicates\"
If Not fso.FolderExists(strFolder) Then
   fso.CreateFolder(strFolder)
End If

strFolder = WorkingDirectory & "\log\"
If Not fso.FolderExists(strFolder) Then
   fso.CreateFolder(strFolder)
End If

Set MyFile = fso.OpenTextFile(WorkingDirectory & "\log\log.txt", ForAppending, True)
MyFile.WriteLine("###################################################")
MyFile.WriteLine("File Duplication Launch Start:"  & funGetTimeStamp())
MyFile.WriteLine("Total Launches:"  & count)

Start = 1
End1 = NumberOfPartations

for count1 = 1 to count

strFileName =  WorkingDirectory & "\FileDuplicater.vbs" & " " & Start & " " & End1 & " " & count1 & " " & TimeStampGenerationAfterCopies & " " & NumberOfFilesInFolder & " " & FileName & " " & Zeros
wshShell.Run "wscript " & strFileName, 1, False
WScript.Sleep 3000

Start = Start + NumberOfPartations
End1 = End1 + NumberOfPartations


next

MyFile.WriteLine("File Duplication Launch  End:"  & funGetTimeStamp())

Set fso = Nothing
Set wshShell = Nothing


Function funGetTimeStamp()
sDateTIme = Now()

iDate = Datepart("d",sDateTime)
iLen = Len(iDate)
If iLen = 1 Then
iDate = "0" & iDate
End If

sMonth=  mid(MonthName(Datepart("m",sDateTime)),1,3)

iYear = Datepart("yyyy",sDateTime)

iHour = Datepart("h",sDateTime)
iLen = Len(iHour)
If iLen = 1 Then
iHour = "0" & iHour
End If

iMinute = Datepart("n",sDateTime)
iLen = Len(iMinute)
If iLen = 1 Then
iMinute = "0" & iMinute
End If

iSec = Datepart("s",sDateTime)
iLen = Len(iSec)
If iLen = 1 Then
iSec = "0" & iSec
End If


funGetTimeStamp =  sMonth & "_" &  iDate & "_" & iYear & "_" & iHour & "_" & iMinute & "_" & iSec

End Function


FileDuplicator.vbs


'This program need to be called by Initiator.vbs that pass the necessary command line parameters
'Arguments
Set objArgs = WScript.Arguments
StartIndex = clng(objArgs(0))
EndIndex = clng(objArgs(1))
LaunchID = clng(objArgs(2))
TimeStampGenerationAfterCopies = clng(objArgs(3))
NumberOfFilesInFolder = clng(objArgs(4))
FileName = objArgs(5)
Zeros = clng(objArgs(6))
Set objArgs = Nothing

FolderIndex = 1
FileCount = 1


TimeStampGenerationAfterCopies1 = TimeStampGenerationAfterCopies

set fso=CreateObject("Scripting.FileSystemObject")
WorkingDirectory = fso.GetParentFolderName(Wscript.ScriptFullName)

strFolder = WorkingDirectory & "\Duplicates\" & LaunchID & "_" & FolderIndex & "\"
If Not fso.FolderExists(strFolder) Then
   fso.CreateFolder(strFolder)
End If

Length = len(FileName)
JustFileName = Mid(FileName,1,Length-5) '.docx len 5
JUstFileExt = Mid(FileName,Length-4) 'docx len 4

LogFile = "\log\log_" & LaunchID & ".txt"

OrginalFileNamePath = WorkingDirectory & "\" & FileName

Set MyFile = fso.OpenTextFile(WorkingDirectory & LogFile, ForAppending, True)
MyFile.WriteLine("##########################################################")
MyFile.WriteLine("LaunchID:" & LaunchID & "---" & "Start:" & funGetTimeStamp())
MyFile.WriteLine("LaunchID:" & LaunchID & "---" & "StartIndex:" & StartIndex)
MyFile.WriteLine("LaunchID:" & LaunchID & "---" & "  EndIndex:" & EndIndex)
MyFile.WriteLine("LaunchID:" & LaunchID & "---" & "  TimeStamp Generated after number of files:" & TimeStampGenerationAfterCopies)

TimeStampCounter = TimeStampGenerationAfterCopies + StartIndex

if StartIndex = 1 then
else
StartIndex = StartIndex - 1
end if
Const ForAppending = 8

for count = StartIndex to EndIndex
'Logic to append zeros
FileIndexLength = len(count)
FileIndex = count
for count1 = 1 to (Zeros - FileIndexLength)
FileIndex = "0" & FileIndex
next

DuplicateFileNamePath = strFolder & JustFileName & "_" & FileIndex & JUstFileExt
fso.CopyFile OrginalFileNamePath, DuplicateFileNamePath , True

if TimeStampCounter = count then
MyFile.WriteLine("LaunchID:" & LaunchID & "---" & "Total Files Duplicated:" & TimeStampGenerationAfterCopies1 & "---" & funGetTimeStamp())
TimeStampCounter = TimeStampCounter + TimeStampGenerationAfterCopies
TimeStampGenerationAfterCopies1 = TimeStampGenerationAfterCopies1 + TimeStampGenerationAfterCopies
else
end if

if FileCount = NumberOfFilesInFolder then
FileCount = 0
FolderIndex = FolderIndex + 1
strFolder = WorkingDirectory & "\Duplicates\" & LaunchID & "_" & FolderIndex & "\"
If Not fso.FolderExists(strFolder) Then
fso.CreateFolder(strFolder)
End If
End If
FileCount = FileCount + 1

next

MyFile.WriteLine("LaunchID:" & LaunchID & "---" & "  End:" & funGetTimeStamp())
MyFile.Close
Set MyFile = Nothing

'wscript.echo "File Duplication Completed. Total Files:" & NumberOfCopies

Set fso = Nothing



Function funGetTimeStamp()
sDateTIme = Now()

iDate = Datepart("d",sDateTime)
iLen = Len(iDate)
If iLen = 1 Then
iDate = "0" & iDate
End If

sMonth=  mid(MonthName(Datepart("m",sDateTime)),1,3)

iYear = Datepart("yyyy",sDateTime)

iHour = Datepart("h",sDateTime)
iLen = Len(iHour)
If iLen = 1 Then
iHour = "0" & iHour
End If

iMinute = Datepart("n",sDateTime)
iLen = Len(iMinute)
If iLen = 1 Then
iMinute = "0" & iMinute
End If

iSec = Datepart("s",sDateTime)
iLen = Len(iSec)
If iLen = 1 Then
iSec = "0" & iSec
End If


funGetTimeStamp =  sMonth & "_" &  iDate & "_" & iYear & "_" & iHour & "_" & iMinute & "_" & iSec

End Function


Folder structure (Create below folders at any location in your file system)





---




Sunday, May 6, 2012

Tracert - Visually trace the packet flow

Tracert - Visually trace the packet flow.

"Tracert" is a command line program to find number of hops between source and destination. Visual Trace display the hops in the google map, so that people understand the packet route easily.

http://www.yougetsignal.com/tools/visual-tracert/

To start the trace from your computer, type the desired domain and select "Proxy Trace".


---

Understanding cloud response time

Understanding cloud response time

There are many cloud hosting providers, in order to understand the effect of latency on distance select this link.
It provide global statistics from specific geographical locations, so that you can select the right cloud service provider based on your targeted geographical locations.


---

Saturday, May 5, 2012

Gartner report on Application Performance Monitoring(APM)

Magic Quadrant for Application Performance Monitoring(APM)

Gartner report on APM providers list.


APM technologies is subdivided into five dimensions of functionality:
(1)End-user experience monitoring
(2)Application runtime architecture discovery, modeling and display
(3)User-defined transaction profiling
(4)Component deep-dive monitoring in application context
(5)Application performance analytics


Magic Quadrant


For more details select this link

---

Wednesday, January 25, 2012

Page Response - User expectations

Page Response - User expectations.

As per the study conducted by Forrester Research on behalf of Akamai, users are expecting the page to be downloaded in less than 2 seconds.


If your site page performance is less than 2 seconds locally, doesn't mean this performance is applicable to every user location. 
Performance is also impacted by distance between Data-center and end-user location. Need to deploy the Geographic load balancers  and CDN as per the requirement.
Below graphs shows the performance impact over distance.


Note: Above images copied from http://www.getelastic.com

Sunday, May 1, 2011

VB Script - Edit xml document.

VB Script - Edit xml document.

Recently I was performing a load test on Web service that consume XML document. The load test parameters are: upload 2000 XML files sequentially having different ID's (XML document contain  "PayloadID" and "OrderID" that should be unique). In order to create 2000 XML files with unique id's I have created following VB script.
  
Path = "C:\Documents and Settings\bharathm\Desktop\"
xmlfile=Path & "orginal.xml"    'your source file name
NumberOfFiles = 2
AppendString = "B"

set oparser=createobject("msxml2.domdocument")
with oparser
    .async=false
    .validateOnParse=false
    .resolveExternals=false
    .load xmlfile
end with
    
if oparser.parseerror.errorcode<>0 then
    wscript.echo "xml file " & xmlfile & " is not well-formed." & vbcrlf & "Operation aborted."
    wscript.quit 999
end if

for count = 1 to NumberOfFiles
 value = AppendString & count 'Unique string to update document
 set oroot=oparser.documentElement
 oroot.setAttribute "payloadID", value
 Set currNode = oparser.documentelement.selectSingleNode("//cXML/Request/OrderRequest/OrderRequestHeader")
 currNode.setAttribute "orderID",value
 outfile=Path & "TestFiles\" & value &".xml"   'create new output file with unique name
 oparser.save outfile
next
    
set oparser=nothing 
wscript.echo "Completed"

I hope this post will help you in manipulating XML document and make duplicate copies.

---

Friday, April 15, 2011

Why Load Testing from the Cloud Doesn't Work

Friday, March 18, 2011

Gomez Vs NeoLoad Vs Loadrunner Vs Selenium

Gomez Vs NeoLoad Vs Loadrunner Vs Selenium

One of my friend asked me for the comparison between Gomez and NeoLoad. I have included Loadrunner Ajax(Click&Script) protocol, as it is a well known performance testing tool. There is separate post for NeoLoad Vs Loadrunner. Also included Selenium function testing tool in the comparison because it can be used as performance testing tool and Gomez use Selenium scripts to run functional tests. HP QTP can't run parallel and Cross-Browser tests, so it is not included in the comparison.

Before starting the comparison, lets understand the performance issues between Server and Browser with few images, so that you can choose the tool in a better way.

Things can go wrong in any of the below mentioned places, Is your tool capable of identifying it.


Below are the issues at the application level. Below screen shot is taken from dynaTrace, excellent core application performance monitoring tool.


Currently there is no single browser dominating the web, every browser has its own share. You have full control of your data center, what about data coming from the third party sites. Today's websites are complex amalgamation of own and third party services. On a average browser need to resolve 8.3 different hosts (Different IP address) to display the content. Attaching the screen shot for more clarity.


Why will this impact the performance? Every browser has its own JavaScript engine, so the page rendering happen differently and have different parallel downloads. Website that work for one browser may not work properly with other browser at the some locations due to issues in third party services, If you can't detect it, you will loose the business. For more understanding select this link. Read this post to understand the rendering differences between FF and IE.



Small Description
Gomez is a portal where user can conduct Performance tests(Any browser/OS, Mobile devices), Cross Browser tests, monitor networks  and functional tests without any hardware requirements. Entire execution happen at Gomez servers.


NeoLoad is a pure performance testing tool that record and replay HTTP(S) requests.

HP Loadrunner is a pure performance testing tool which support different protocols.

Selenium is an open source tool that is designed to conduct functional testing, but by using Selenium GRID we can run parallel tests in different browser environments.

Licence Cost
Gomez - SaaS model.
NeoLoad - Number of virtual users, technology and monitoring services.
Loadrunner - Number of Virtual users and Protocol bundles.
Selenium - Free

About The Software
Gomez - It has Gomez screen recorder(GSR), once you record the script and make necessary dynamic value changes, you can upload into GPN(Gomez Performance Network) portal. You can access this site online and conduct tests, view results.
NeoLoad - Around 160MB software that is written in Java need to be installed on your workstations. If you are generating more load, need to install separate LoadGenerator software on separate server. Also LoadGenerators can be deployed from the cloud.
Loadrunner - Around 2.5GB software that has separate applications for recording, test execution and analysis. Also has cloud support.
Selenium - Need to have Java and set of Selenium libraries that can be executed using any language that support HTTP library (Java/.Net/Python/Ruby...)

Script Recorder
Gomez - All the user clicks or actions are recorded, once user select an item on the screen, system automatically generate JavaScript associated with that click (document.GetElementByID("LoginBtn")), use Firefox engine to record the script. There are different actions available Navigate, Type, Wait, Form Fill....... It can identify the screen objects using DOM or CSS. There are different built in Gomez functions that can provide data and reference to different elements. You have got the option to use User clicks OR directly POST the form. During replay, user action associate JavaScript get executed in the Gomez injected JavaScript core inside the browser.

NeoLoad - No user clicks are recorded, It record Request/Response during form submit. During replay, it re-executes the requests that re recorded after changing the dynamic values.
Loadrunner - Ajax(Click&Script) protocol is suitable for WEB2.0 applications, this protocol has HP QTP technology with limited object properties. User clicks are recorded as C functions.
web_click("ctl00$RightContent$ddlCycleNo",
"Snapshot=t14.inf",
DESCRIPTION,
"Name=ctl00$RightContent$ddlCycleNo",
"id=ctl00_RightContent_ddlCycleNo",
"FrameName=contentFRAME",
ACTION,
"Select=B",
LAST); 

It records only in IE, I think these c functions are converted into JavaScript to execute on the Loadrunner browser. 
The same functions are executed during replay in Loadrunner proprietary browser.
Selenium - It has Selenium IDE that record and replay script as Firefox add-on. Also you can directly write script in any of the following languages(Java/.Net/Python/Ruby...)
Selenium - For sample code select this link.

Script Replay 
Gomez - It replay the script in real and Gomez browser so there is page rendering.
Neoload - No browser, just replay of HTTP(S) requests.
Loadrunner - It replay the script in Loadrunner proprietary browser so there is page rendering. Lot of issues when page contain other objects.
Selenium - It replay the script in real browser so there is page rendering.

LoadGenerators
Gomez - It network exist in 168+ countries and 2,500+ ISP's. It consist of 500+ combinations of browsers and OS, 150+ commercial data centers, 5,000+ mobile supported devices and 1,50,000+ commercial grade desktops through which it is possible to generate enormous real user load.
Backbone are servers deployed on cloud to generate massive load.
Last Mile systems acts like a real users, executing single test by residing on real network, devise(Browser OR Mobile) and location. With massive last mile systems deployed around the word, it would be difficult for any one to challenge Gomez Network


NeoLoad - Deployed in the premises or on the cloud. Load getting generated from few places only.
Loadrunner -  Same as above.
Selenium - There is no concept of Loadgenerators in selenium, using GRID we can run multiple browsers on different systems.

WAN Emulators
What are WAN emulators?
Gomez - It is not required, as tests are getting executed on real network, device and location.
NeoLoad - There is no facility to add network effects, just limit bandwidth.
Loadrunner - It has integration with  SHUNRA Virtual Enterprise Suite to generate network effects.
Selenium -  There is no facility to add network effects.

Multi-Browser support
Gomez -  It support Firefox, IE and Gomez proprietary agent.  Also it consist of 500+ combinations of browsers and OS...Amazing, with "Reality View XF" where screen shots of different browsers are shown in a single page and compared against selected screen shot to find object devastation.
NeoLoad - It doesn't execute in a browser.
Loadrunner - No, it execute in Loadrunner propriety browser.
Selenium- Yes, you need to have own software and hardware. If you don't have consider SauceLabs.

Test execution length
Gomez - You can schedule your test and run for any amount of time. You have also got facility to stop collecting metrics during server maintenance, so that averages are not deviated. All the results are stored in the GPN.
NeoLoad - If you run the test for 4 days, I feel system would get stuck while processing the metrics.
Loadrunner - I think the same as NeoLoad
Selenium - You can schedule using Hudson-CI.

Response time and Test results
Gomez - It provide results in great detail. You can get based on Geography, ISP, Location, Browser type and even browser rendering details(Object level). Each browser JavaScript engine renders in different way, this will be helpful us understand the cross browser performance impacts at end user. It also has the capability to take the browser screen shot during error.

NeoLoad - Container and request level.
Loadrunner - Record at transaction level.
Selenium - There is no built in facility to calculate response time, need to consider other methods.

Functional Testing
Gomez - Can execute scripts created using Selenium IDE.
NeoLoad - No
Loadrunner - No
Selenium - It is a function testing tool with cross-browser and parallel test execution capability.

Mobile Platform Support
Gomez - Yes
NeoLoad - No
Loadrunner - No
Selenium - Yes

Resource Monitoring
Gomez - It monitors entire delivery chain, from server, ISP to the end user.
NeoLoad - Monitor the server resources and throughput.
Loadrunner - Same as above.
Selenium - No resource monitoring capability.

Flex Support
Gomez - Support Flex/Silver-light, I am not sure how they are able to select Flex objects. As Flex is proprietary tool doesn't expose the methods in the DOM, generally .swf file need to be compiled with extra libraries. This compilation happen on fly while data getting downloaded into the browser, but increases number of objects and response time.
NeoLoad - It convert Binay data into readable format and then convert back after changing dynamic values as it is recording at request/response level, which is different from other reorders.
Loadrunner - It support, But I had issues identifying the objects.
Selenium - Yes, Select this for more information.

Presentations and Whitepapers
Gomez - Awesome, I love to read those presentations.
NeoLoad - Only pertaining to the tool.
Loadrunner - Only pertaining to the tool.
Selenium - As it is a open source tool, some time getting proper information would be difficult.

How to Choose and Use
Gomez - If your application is being used across different location or geographies with different browser combinations and your application has CDN or other third party services. Gomez is the best solution. It is ultimate in performance testing.
NeoLoad - If want to test the application inside the firewall OR if your application is used in specific places, generate the load from Cloud. For calculating true response time,  execute Selenium test for each location with required browser combinations. It is not easy to generate enormous load using real browsers as they require lot of resources, the best combination would be generating part of the load using HTTP(S) request servers as they are very cheap and the remaining part from real browser combinations.
Loadrunner - Same as Neolaod, you can use HP QTP to calculate response time, If there are more browser combinations need to move to Selenium.
Selenium - User Selenium GRID or other vendors to generate load. Some companies link BrowserMobPushToTest use Selenium GRID to conduct performance testing.

KeyNote Systems is similar to Gomez.

---




Friday, March 4, 2011

NeoLoad 3.2 With Cloud Support


 New features
  • Cloud testing
  • Silverlight module
  • Siebel module
  • VMware monitoring
  • SOAP: support for WS-Security
Neotys has opened its online store! Purchase or lease your licenses online and receive them immediately.
NeoLoad realistically simulates users and analyzes your servers' behavior. Get operational with NeoLoad 3.2 quickly, thanks to its intuitive interface and its advanced wizards, and take advantage of its exclusive features to:
Test more quickly:
  • Automatic handling of all your application's parameters (without any scripts)
  • Preconfigured monitoring and threshold alerts for a quick analysis of your servers
  • Smart pinpointing of your applications' critical performance issues
Test more efficiently:
  • Detailed statistics in real time during test runs
  • Results and analysis by business transaction
  • JavaScript for further customizing scenarios
Test all your Web applications:
  • View the supported technologies (AJAX, SOAP, GWT, Adobe Flex, Silverlight, Oracle Forms, Siebel, ... )
  • View the monitoring modules (all mainstream operating systems, Web servers, application servers and database servers available on the market are supported)
  • Test from your internal lab or from the Cloud


---

Tuesday, November 23, 2010

Understanding ScriptResource and WebResource in ASP.NET

Understanding ScriptResource and WebResource in ASP.NET

While recording load test script on ASP.Net application, you may come across following files based on your code design. These files need to be parameterized, as the file URL contain time stamp in encrypted format and resource id. You may encounter multiple files in a single page with different URL parameters.

Attaching the files and URL screen shot.



A web resource is a file embedded in an assembly.  This file can either be a JavaScript file or a BMP, or any other emendable type of resource in an assembly. 

There are two basic ways to getting at your assembly resources loaded on your ASP.NET web page.  ScriptResource.axd and WebResource.axd.

The URL for WebResource.axd looks like the following:
WebResource.axd?d=SbXSD3uTnhYsK4gMD8fL84_mHPC5jJ7lfdnr1_WtsftZiUOZ6IXYG8QCXW86UizF0&t=632768953157700078
The format of this URL is WebResource.axd?d=encrypted identifier&t=time stamp value. The "d" stands for the requested Web Resource. The "t" is the timestamp for the requested assembly, which can help in determining if there have been any changes to the resource.

Some of the advantages of using these files
1. Automatically GZip/Compressing your scripts over HTTP for delivery.
2. Dynamically resolving Release/Debug scripts based on build parameters.  This is useful, if you keep two types of the same script: one for debug, and one packed for release.
3. Can be used for Non-MsAJAX Framework script assets such as jQuery.


Following are the links for better understanding of this post.


---



Tuesday, October 26, 2010

Browser Rendering vs Repaints vs Reflows

Browser rendering, repaints, reflows


Performance test engineers need to understand these concepts, so that they can clearly distinguish between client and server bottleneck, guide the development team for better performance pages.


Renderingweb browser engine (sometimes called layout engine or rendering engine), is a software component that takes marked up content (such as HTMLXMLimage files, etc.) and formatting information (such as CSSXSL, etc.) and displays the formatted content on the screen. It "paints" on the content area of a window, which is displayed on a monitor or a printer. A web browser engine is typically embedded in web browserse-mail clients, on-line help systems or other applications that require the displaying (and editing) of web content.


Repaint - A repaint occurs when changes are made to an elements skin that changes visibility, but do not affect its layout. Examples of this include outline, visibility, or background color. According to Opera, repaint is expensive because the browser must verify the visibility of all other nodes in the DOM tree.


Reflow - A reflow is even more critical to performance because it involves changes that affect the layout of a portion of the page (or the whole page). Reflow of an element causes the subsequent reflow of all child and ancestor elements as well as any elements following it in the DOM.


In-order to improve the page performance need to avoid the reflows.
Following are some of the links that explain the above concepts in detail.
Stubbornella
Dev.Opera
Code.Google.com
Reflow Visualization 
Mozilla




---

Monday, October 4, 2010

Analyze Browser - JavaScript, AJAX, Rendering Details.

Analyze Browser - JavaScript, AJAX, Rendering Details.

For quite a log time I have been searching for tools that can show how the rendering happen at the browser level and amount of CPU consumed by that application at client side. Recently I came across Dyna Trace Ajax Edition that can
- Differentiate between browser and server bottlenecks
- Trace asynchronous JavaScript executions for the full round-trip
- Analyze JavaScript, AJAX remoting, network and rendering performance in real-time
- CPU load on the client
- Browser cache and server resources
- Page events (script, load, click, mouse)

I think this might be useful for performance testers, have a look! It is free.

Attaching screen shot of the tool.


---

Sunday, September 5, 2010

Browser wars & End user performance, content display impact.

Browser wars & End user performance, content display impact.

"Browser wars" is the term used to mention the competition for dominance in usage share in the web browser market. The term was used between Internet explorer and Netscape Navigator. By late 1990s Internet explorer emerged as the clear winner. Since 2003, collection of new browsers (Firefox, Chrome, Safari, Opera) eroded the Internet Explorer market share.

Today, no browser is dominating the web browser market, every browser has its own share. With the introduction of WEB 2.0, lot of computation has shifted from server to client side for delivering rich internet applications, now they are no more thin clients, executing java script, Flash and AJAX. With the introduction of HTML 5, load on the browser further increased.

In total there are many browsers and mobile devices, each has its own speed, characteristics and content display.

Link to Browser statics
Link to Browser OS statics

If you are blogger, you can get your blog Browser & OS statics from "Stats" TAB. Attaching the screen shot.

Today's web is getting complicated
1. Mobile platforms - A decade ago internet explorer is standard platform to access internet. Use of Mobile devices for accessing web is growing fast.
- Morgan Stanley predicts mobile users will outnumber desktop internet users worldwide by 2014
- AT&T has experienced a 50 times increase in mobile data over the last three years
- eBay expects to sell $1.5 billion worth of goods through mobile devices in 2010
- Facebook alone reports over 100 million people actively using its site from mobile devices every
   month

2. More content from third party sites - You will have full control of your data centers, what about the data coming from the third party sites. Today's web site are complex amalgamation of own and third party services.



Performance issues with new browsers

1. Content display - Browsers render HTML elements, Cascading Style Sheet and Java Script in different ways. Site that display the content well on IE7 don't guarantee that it display the same on IE8. During transaction to IE8, Microsoft warned the developer community their CSS hacks would cease to work, encouraged developers to test their sites in new browser.

2. Parallel JavaScript Loading - Older browsers downloaded JavaScript files serially, so the developers clustered the JavaScript files into single large file. Modern browsers download them in parallel resulting in slower performance. Here is the dilemma, towards which browser should you optimize, old or new?

3. Faster JavaScript Engines - JavaScript also performs differently across browsers. For example, Chrome now calls setTimeout and setInterval with millisecond granularity. This can lead to much greater CPU drain from pages that use timers to run high-frequency loops in JavaScript. In general, the dramatically faster JavaScript engines in the new versions of Safari, Chrome, and Firefox are all capable of running client-side code much faster than before. This means that the JavaScript engine will no longer be a natural limiter on the impact your application may have on the end user’s machine.
With increase demand of rich-internet applications, much of the computation is moving to the client side (load on the browser). On the down side, poorly written applications will impact the end user machines by consuming more memory and CPU. To make matters worse, chrome has introduced "Task Manager" to monitor which applications are creating more strain on the browsers. End users will not tolerate these applications, just they would quit those applications.

Attaching Chrome task manager screen shot that display each process memory, CPU and Network utilization.

Attaching the JavaScript processing speed of browsers from Gomez.

WebKit SunSpider is one test to measure a browser’s JavaScript execution performance. The WebKit SunSpider test regularly changes which impacts a browsers score.

4. Parallel Connections - Older browsers like IE6 and IE7 were designed to make two host connections at a time (e.g., two images loading at once). The new IE8, Firefox, Safari, and Google’s Chrome triple the number of parallel connections per host to accelerate the browser experience (the maximum number of concurrent connections is limited only by the host itself). It is a good news, browsers are able to display the content faster with parallel connections. But there are side effects, with more number of parallel connections, it would create extra load on the servers and existing infrastructure may not support under peak load.


For more technical details about all the browsers visit BrowserScope

Attaching screen shot of IE and Firefox with parallel download.


5. Browser speed comparison


Screen shot taken from Gomez, Each browser version has vastly different performance and rendering characteristics. (Data based on real global broadband users accessing 466M pages on 200+ sites over a 30 day period)
It looks chrome 5 is better than other browsers.

6. ACID Test - The Acid 3 test, designed by the Web Standards Project, checks how well a Web browser
follows certain selected elements from Web standards, especially relating to the Document Object Model (DOM) and JavaScript.

For more technical details about all the browsers visit BrowserScope


Websites owners, don't get caught in the browser war cross-fire

It is very important to develop todays applications with cross-browser (Including mobile devices) functionality. Applications should have consistent look, feel and performance across IE, Firefox, Chrome and safari.
Following are some of the important points to consider while designing the web Site.

- Decide which browsers to support
- Knowing when to stop supporting older versions of the browsers
- Support for multi-operating systems: Each operating system platform interpret code slightly different, so
  the same browser can display and perform differently.
- Greater focus on design standards and open source: Cross-Browser Standards,  Open source web  
  browser engine, Browsers and applications using WebKit
- Increase support for forward looking technologies: HTML 5 and CSS 3
- Know your users browsers
- Stick with standards: W3C Markup Validation  CSS Validation
- Test early and test often: Browsershots, BrowserCam, Adobe BrowserLab, and Gomez’s Cross-
  Browser Compatibility Test.


How well does my website perform?

This assessment is a bit more complex and requires careful measurement of three parameters:

Availability: The ability to fulfill an end-user’s page request — or complete an end-to-end transaction — without error.

Response time: The speed at which every end-to-end transaction, page, image or piece of third party content, downloads.

Consistency: The site’s ability to deliver a quality customer experience over time, regardless of the user’s geographic location. Consistency can be especially impacted by connection parallelism. Remember the trade-off: more connections might mean better load time under light loads, but worse performance under heavy activity. Users might not return to sites with inconsistent load times.


---

Friday, September 3, 2010

Performance related issues between browser and server.

Performance related issues between browser and server.

Below screen shot taken from Gomez that explain application performance issues between browser and server. I was really impressed as it has covered the entire application delivery path.



---

Thursday, September 2, 2010

User Reaction To A Poor Online Shopping Portal

User Reaction To A Poor Online Shopping Portal

As per the study conducted by Forrester on behalf of Akamai Technologies, users are expecting dynamic, feature rich pages to load in 2 seconds or less, so design your application accordingly to retain and gain customers. Attaching the study report.


---

Performance Testing Tools, Script Recorder Types

Performance Testing Tools, Script Recorder Types
 

To perform the load test, any tool should initially record the request, response or browser events; recorders are broadly classified into three types.

1. Proxy recorder – User a small proxy server to intercept and record all the requests/response. This process record the entire communication between client/ server. Tools that use this method are Fiddler, Neoload, Loadrunner (HTTP/HTML)…
 

2. Browser recorder, hooking to IE navigation events – Records IE navigation events, but it doesn’t record all the requests (URL re-directions etc). Tools that use this method are Visual Studio (Convert request into .Net classes) , WebLoad (Convert request into JavaScript objects).
 

3. Browser recorder, based on GUI object selection by user -  Records click events on the GUI objects. Tool that use this method is Loadrunner (Click & Script), Implemented using QTP technology.

---

Tuesday, August 10, 2010

Performance Testing - Setting Think time ZERO, doesn't mean executing the test with more users.

Performance Testing -  Setting Think time ZERO, doesn't mean executing the test with more users.

Many people have wrong assumption, by decrease the think time, it is possible to create more load on the server. When think time is set as zero, virtual users are running at unrealistic speed.

The number of Virtual Users must be close to the number of real users once the application is in production, with a realistic think time  applied between pages. Avoid testing with less Virtual Users with a minimized think time. It could be assumed that the result would be the same, as the number of requests played per second is identical. However, this is not the case, for the following reasons:

1. The memory burden on the server will be different: Each user session uses a certain amount of memory. If the number of user sessions is underestimated, the server will be running under more favorable conditions than in real-life and the results will be distorted.

2. The number of sockets open simultaneously on the server will be different. An underestimation of user numbers means the maximum threshold for open server sockets cannot be tested.

3. The resource pools (DB Connections) will not be operating under realistic conditions. An inappropriate pool size setting might not be detected during the test.

4. Removing think time can create artificial bottlenecks in your application.
When striving for accuracy, you want to always try to do things MORE like actual users rather than LESS.   The only way to do this properly is to try to set all facets of a test to mimic real world traffic.

User Think Time is based upon the distribution with an Average of 7 Seconds and Maximum of 70 Seconds.
  Article by Wayne D. Smith, Intel Corporation

----

Tuesday, July 6, 2010

Performance Testing - TCP Connection Failures

Performance Testing - TCP Connection Failures.

I came across this article on WebPerformanceInc, which explain about establishing TCP connection and different reasons for connection failures…felt interesting.

Load Tester is a web site load testing tool, and as such we deal primarily with the most popular Internet communications protocol: the Hypertext Transfer Protocol, or HTTP, which controls the request and transmission of web pages between browser clients and web servers.  HTTP is based on a lower-level protocol known as the Transmission Control Protocol, or TCP.    For the most part, TCP works in the background, but its proper function is critical to your website, and problems at the TCP level can show up in many different ways during a load test.  These errors can sometimes be difficult to troubleshoot, requiring a packet sniffer such as Wireshark or tcpdump to analyze, while others are simpler.

TCP uses the concept of “ports” to identify and organize connections.  For every TCP connection, there are two ports – the source port, and the destination port.  For our purposes, the most important ports are port 80 and port 443, which are the two most common ports utilized by web servers – 80 for normal HTTP traffic, and 443 for SSL-encrypted traffic.  A typical TCP connection from a client to a webserver will involve a random source port such as 44567, and a destination port on the server of port 80.  Each web server can accept many hundreds of connections on port 80, but each connection must come from a different source port on each client.

To create these connections between ports, TCP relies on a three-way handshake.  The requesting client first sends a packet with the TCP SYN flag set, indicating that it wants to open a connection.  If the server has a process listening on the destination port, it will respond with a packet that has both the SYN flag set and the ACK flag set, which acknowledges the client’s SYN and indicates that a connection can be created on that port.  The client then sends a packet with the ACK flag set back to the server, and the connection is established.  The current connections can be viewed using the netstat tool on both Windows and Linux.

What does it look like when a TCP connection attempt fails?  The TCP packet with the SYN flag is sent from the client, which in our case is a load engine.  If the server sees such a packet, but does not have a process listening on the target port, it will typically respond with a TCP packet that has the ACK and RST flags set – a TCP reset.  This tells the client that connections are not available on this port.
Load Tester showing a connection refused (ACK RST)
Load Tester showing a connection refused (ACK RST)
This screenshot shows the result of a load engine failing to connect to the server.  In this case, you can see that I attempted to connect to TCP port 442, which doesn’t have a web server running on it (or any other service, for that matter).  Note that the response was received quickly, in about 1 second, indicating that the remote server saw the ill-fated packet and responded.  The most important thing to know about this error is that it is one of the most reliable errors that you’ll see – either the Load Tester controller or the load engine really is having trouble connecting to the site.  The most common reason for this is that either the site is down, or there is a firewall that is blocking the load engine but not the controller.
So … what happens when the remote server does not respond?
Load Tester showing a connection timeout (dropped packet)
Load Tester showing a connection timeout (dropped packet)
This screenshot shows the same attempted connection, only this time, no response was received from the target server – not even the TCP reset that indicates connections are not available on the target port.  Note how long it takes for Load Tester to report an error – 21 seconds, in this case.  I induced this error by configuring the Linux iptables firewall to drop all incoming packets on TCP port 442, so the server’s TCP stack never saw the incoming SYN packet and thus did not respond to it – from the server’s perspective, the packet never arrived.  A similar error will occur if the server cannot be reached for some reason; for example if you attempt to connect to the wrong hostname, the server is offline, or your traffic is being misrouted between the client or load engine and the server.  If you see these kinds of errors, then the first thing you should do is make sure that the server is up, and that any HTTP proxy servers necessary to reach the server are configured correctly.

Of course, TCP connections can also fail after a connection has been established.  Here’s an example:
Load Tester showing a server connection termination
Load Tester showing a server connection termination
This error message is much less clear.  Did the server close the connection on purpose?  If so, why?  If not, what happened? Did the process handling the server connection crash or return bad data?  In this case, it’s useful to know what Load Tester considers to be a successful connection.  Load Tester expects there to be HTTP headers, followed by data.  In this case, we did not finish receiving the HTTP headers, and so Load Tester considers the connection incomplete.  Load Tester failed to receive the headers in this case because I induced this error by attempting to elicit an HTTP response from the Secure Shell (ssh) service listening on TCP port 22, which terminated the connection after receiving what it saw as invalid data – Load Tester’s HTTP request.

In a real test, there’s a pretty large number of things that can cause this error, from server process crashes or errors, to overly aggressive firewalls, to reverse proxy failures, to misdirected traffic on a load balancer.  In such a case, a traffic analyzer such as Wireshark or tcpdump can be very helpful in determining what is happening.  Note that you may need to observe traffic in more locations that in front of the load engine or the controller though, as traffic can be altered by firewalls and load balancers.




----