Tuesday, September 11, 2007

Performance Testing

Introduction


This note outlines a proposed set of standard counters to monitor during a basic performance test. These include counters specific to a web server and database server. Operating system counters cover Windows servers only. Web and database counters are for MS IIS and MS SQL Server but should be useful for other technologies.


The counters included are a minimal set designed to ensure bottlenecks have not occurred during a performance test. If bottlenecks have occurred it may be appropriate to consider re-running tests with additional counters collected.

This note covers the following:

  • what statistics to collect

  • how to set up collection of monitoring counters


It does not cover how to analyse logs containing these counter values. The references below or other documentation should be consulted as required.

References


Two very useful references have been located in preparing this note.

Each has a number of sub-pages related to memory, CPU, network etc.

http://www.computerperformance.co.uk/HealthCheck/

http://www.sql-server-performance.com/tips_performance.asp


The following has guidance on what counters to collect and setup screenshots:

http://www.sql-server-performance.com/qdpma/inst_3_pmlogs.asp


What statistics to collect

What to collect – all Windows servers

Memory: Available Mbytes

Memory: Pages/sec

Memory: Page Faults/sec

Network Interface: [Relevant NIC]: Output Queue Length

Network Interface: [Relevant NIC]: Bytes Received/sec

Network Interface: [Relevant NIC]: Bytes Sent/sec

Network Segment object: %Network Utilization (if present)

Physical Disk: Avg Disk Queue Length: Total

Physical Disk: Disk Bytes/sec: Total

Physical Disk: % Disk Time: Total

Processor: % Processor Time: Total

Server: Bytes Received/sec

Server: Bytes Transmitted/sec

System: Context Switches/sec

System: Threads

System: Processes

System: Processor Queue Length

TCP: Connections Established

What to collect – web servers

Internet Information Services Global: File Cache Hits %,

Internet Information Services Global: File Cache Flushes

Internet Information Services Global: File Cache Hits

Web Service: Bytes sent/sec

Web Service: Bytes received/sec

Web Service: Connection Attempts/sec

Web Service: Current Connections

Process: Working set: Inetinfo.exe (or alternative web server .exe)

What to collect – database servers

SQLServer: General Statistics: Logins/sec

SQLServer: General Statistics: User Connections

SQL Server SQL Statistics: Batch Requests/sec

SQLServer: Access Methods: Page Splits/sec

SQLServer: Buffer Manager: Buffer Cache Hit Ratio

SQLServer: Buffer Manager: Free buffers

SQLServer: Cache Manager: Cache hit ratio

SQLServer: Locks: Average Wait Time (ms)

SQLServer: Locks: Number of Deadlocks/Sec

SQLServer: Latches: Average Latch Wait Time (ms)

SQLServer: Latches: Latch Waits/Sec

SQLServer: Memory Manager: Target Server Memory (KB)

SQLServer: Memory Manager: Total Server Memory (KB)


If you need more details on what queries are being executed and so on,

How to set up collection of monitoring counters

All the above mentioned counters can be set up via the Windows Perfmon interface. For specifics of Perfmon, you are advised to consult relevant help pages, Microsoft’s web site or other readily available articles.


Perfmon provides a real-time monitor and file logging capabilities. During a performance test, set up file logging and shutdown the real-time monitor.

Where to start (local or remote)

It is possible to set up monitoring of counters remotely. This has the benefit that the logs can be started/stopped from one place, they are stored in one place, and you can use a dedicated monitoring PC which is unlikely to be stressed during the test.


This will add a little network traffic but that should not interfere with a normal performance test unless the network is already approaching utilisation limits.


The referenced documents contain more notes which may help decide whether local or remote monitoring is preferable, but they are not unanimous on the subject.


The instructions below assume remote monitoring.

What to do


The following instructions (for Windows XP) should be useful as a guide:


To set up logging of counters

Start->Control Panel->Administrative Tools->Performance

In performance logs and alerts, right click Counter logs and select New log settings

Choose a log name eg. System_Counters_Web

(log file will be named eg C:\Perflogs\System_Counters_Web_000001.blg)

General tab:

Select Add Counters.

Select Add counters from computer and specify name (or IP address) of web server.

Select Select the object, then the counter within the object.

Repeat for all required counters on that server then Close.

Verify that all required counters are displayed.

Select Sample counters every 15 seconds.

Log Files tab:

Select Log file type to Text file (comma delimited)

Schedule tab: leave defaults

When you are completed, click Apply, then click OK

Logging of the counters to the specified file should start immediately.


To stop logging:

Start->Control Panel->Administrative Tools->Performance

In performance logs and alerts, left click Counter logs and right click on the log eg. System_Counters_Web.

Then select Stop.

You can stop or change properties of the log.

Logs are green when running, red when stopped.


To start logging:

Start->Control Panel->Administrative Tools->Performance

In performance logs and alerts, left click Counter logs and right click on the log eg. System_Counters_Web.

Then select Start.

A file with a new suffix is created (eg. System_Counters_Web_000002).


Scheduling

It is also possible to use the Schedule tab to schedule the start and stop time of logging. If you do use Schedule, you still need to reset the start date after each log file is created (i.e. the interface does not allow Recurrence to be set up).

1 comment:

TestWithUs said...

SWIFT Interview questions on

http://testwithus.blogspot.in/p/swift.htm

For selenium solution visit
http://testwithus.blogspot.in/p/blog-page.html


For QTP interview questions

http://testwithus.blogspot.in/p/qtp-questions.html


www.searchyourpolicy.com