Saturday, April 4, 2009
How to implement Lower Thread Priorities?
How to address System Resource Bottlenecks?
The only ways around this problems are to recode the Java (the right solution) or add more App Server instances (the wrong solution).
How to check for Thread Context Switching Problems?
Check how many simultaneous requests are typically being handled when you have a large number of clients trying to access App Server. When the site is under load, go to the App Server administration page, and see how many handlers are active.
You can also reduce overhead from thread context switching by making sure you have at least one CPU for each process involved in handling the majority of requests:
- One CPU for your HTTP server,
- One for App Server,
- One for the database server.
Note:- The assumption here is that, all the servers (HTTP, Applicaion and Database servers) are running on a multiprocessor (more than 3 processors) system.
Typically, these context switches can be overcome by increasing the parallelism in your site (increasing the number of Server handler threads).
How to locate Performance Bottlenecks at High CPU Utilization in middleware or Application Server?
If your site CPU utilization is close to 100%, you can use a tool like OptimizeIt or KL Group's JProbe Profiler to help determine slow points of your code. See Using OptimizeIt .
In some instances, OptimizeIt cannot handle large sites running under load. If so, another way to identify deadlocks and bottlenecks is to get your JVM to dump out stack traces while your system is under load.
How to address Performance Bottlenecks for Network-Limited Problems?
Some ways to address network-limited problems include:
- Reduce the size of your HTML files by limiting comments and white space or redesigning the content of especially large pages.
- Increase the number of request handling threads. This won't improve the latency experienced by a user who requests a large file, but it will improve total throughput.
- Get a faster network connection.
- Locate and correct network bottlenecks
How to check for Disk I/O Bottlenecks in AppServer?
How to locate Performance Bottlenecks for Database?
- Get a JVM thread dump (see Getting Java VM Dumps ) and examine it to see if there are many threads waiting for a response from the database (see Analyzing Java VM Dumps ).
- Check the CPU utilization and disk I/O utilization of your database server.
- Check the network bandwidth between the App server and the database server.
How to locate Performance Bottlenecks at Low CPU Utilization?
- Database limited (if database output is maxed out); see Checking for Database Bottlenecks
- Disk I/O limited (if I/O output is maxed out); see Checking for Disk I/O Bottlenecks
- Network I/O limited (if I/O output is maxed out); see Checking for Network-Limited Problems
- Database or I/O activity in a synchronized method (if database or I/O output is not maxed out); see System Resource Bottlenecks
If your site is in this situation, CPU profiling tools like OptimizeIt are not that useful. Thread dumps taken while the system is under load can give you better information.
How to locate Performance Bottlenecks?
- Bottlenecks at Low CPU Utilization
- Checking for Database Bottlenecks
- Checking for Disk I/O Bottlenecks
- Checking for Network-Limited Problems
- Bottlenecks at High CPU Utilization
- Thread Context Switching Problems
- System Resource Bottlenecks
- Lower Thread Priorities
Note:- For detailed informationa about above mentioned bottlenecks visit our individual questions?
What is a cookie? What are the steps need to be taken care during recording?
- Persistent cookies. Also called a permanent cookie, or a stored cookie, a cookie that is stored on a user’s hard drive until it expires (persistent cookies are set with expiration dates) or until the user deletes the cookie. Persistent cookies are used to collect identifying information about the user, such as Web surfing behavior or user preferences for a specific Web site
- Non-persistent cookies (also known as session cookies). Used by Commerce Server to track authenticated users who visit your site? When the session ends, the cookies are deleted. Non-persistent cookies store MSCSAuth tickets.
Both persistent cookies and non-persistent cookies can be encrypted. The non-persistent cookies contain the fields like User ID , Time of last login, Time Window.
Before recording all the persistent cookies need to be removed from the respective browsers.
What is document cache? How does document cache impacts the peroformance of a webpage?
- Using the cache saves time. However, documents stored persistently will become outdated if the original documents on the web sever changes. To guard against this, web browser checks whether a document in the cache is an up-to-date copy of the original on the server. This is a user specified option, and the most popular setting for web browser today is set to check once per session whether a document on the server has changed since the user last viewed it.
- A load testing tool must emulate web browser’s document cache.
What is page redirection? How does page redirection works in load testing tools?
- Browsers usually do not follow redirections more than five times, since a high number of redirections could indicate a infinite loop.
A redirection from one page to another can occur in various way:
- Location field: The header of the HTTP response may contain a “location” or a “refresh” field that orders the browser to redirect the user to a different page
- Refresh Header: A web page may invoke a JavaScript the leads the user to another page
- Refresh Tag: A web page may contain an HTML tag that indicates a redirection
Load testing tools must be able to emulate redirection as it is frequently used technique in web applications.
What is Browser thread? How does Browser threads impact the performance?
- Single-threaded mode is used when a web browser executes a Java script that communicates continually with a web server, or more generally, when a client application other than a web browser is employed.
- Load testing tools need to have the ability to accurately emulate web browsers in both single and multi threaded modes in order to apply realistic workloads to the web applications being tested.
How to calculate sessions per hour? - Little's Law
- Example 1:- If a baseline test shows that a User Type takes a total of 120 seconds for a session, then in an hour long steady state test this User Type should be able to complete 3600 / 120 = 30 sessions per hour. Twenty of these users will complete 20 x 30 = 600 of these session in an hour. In other cases, we have a set number of sessions we want to complete during the test and want to determine the number of virtual users to start.
- Example 2:Using the same conditions in our first example, if our target session rate for sessions per hour is 500, then 500 x 30 = 16.7 or 17 virtual users. A formula called Little's Law states this calculation of VirtualUsers in slightly different terms.
- Using Little's Law with Example 2:
wV.U. = R x D where R = Transaction Rate and D = Duration of the Session
If our target rate is 500 sessions per hour (.139 sessions/sec) and our duration is 120 seconds, then Virtual Users = .139 x 120 = 16.7 or 17 virtual users.
how can you effectively test the performance of your Web site from locations that are thousands of miles away?
- Using the services of a third-party company that specializes in testing a Web site from different locations around the world
- Utilizing the different physical locations (branches) that your organization may already possess, coordinating the execution of your test plan with coworkers at the offices
- Using a modem to dial ISP telephone numbers in different cities and factoring out the additional time for the cross-country modem connection
- Buy an “around the world” airplane ticket for one or more of the Web site’s testers
How does user geographic locations impacts performance of the website?
Remote performance testing can become particularly important if mirror sites are to be strategically positioned in order to improve response times for distant locations.
What is background noise in performance testing?
Background noise is created by other applications running that will also be running on the production servers once the application under test moves into production, and other network traffic that will consume network bandwidth and possibly increase the collision rate of the data packets being transmitted over the LAN and/or WAN.
What is Site Abandonment?
Unfortunately basic load / performance test scripts/tools assume that a client will wait until a Web page has been completely downloaded before requesting the subsequent page
Why Functional Failures happen in Highly Stressed Applications?
Example:- In real time, when the stock market crashes(in India), most of the Security / Stock trading portal systems will not be responding or you can crashed in the application due to heavy user load or stress on the application.
What are the scalability considerations? What is Horizontal Scalability and Vertical Scalability?
- Adding new applications or customers to the system.
- Horizontal Scalability -- AKA "rack density". Throw hardware at the problem. Typically easier and affordable than most forms of vertical scalability.
- Vertical Scalability -- The ability to increase the capacity of existing hardware or software by adding resources - for example, adding processing power to a server to make it faster. nHardware/software scalability metrics Here are some metrics to measure the levels of resource saturation:
* CPU utilization — Number of users supported versus CPU utilization
* Memory — Number of users supported versus available memory
* Disk I/O — Number of users supported versus number of disks
* Network I/O — Number of users supported versus wire speed of network
What are the dimensions of scalability?
Scalability is often qualified along specific ranges of factors, among which are the ability to increase:
- Total number of users
- Number of concurrent users
- Number of user's locations
- The extent and size of the data store
- Transaction volume
- Output volume
- Response time
What is scalability?
- The key determinant of scalability is Transaction Time
- Transaction Time doesn't mean good scalability - in fact it's the antithesis of it.
Example:-
- Case - 1 :- The response time of a page for 100 users is 1 sec, 200 users 2 sec and 500 users is 5 Sec
- Case - 2:- The response time of a page for 100 users is 4 sec, 200 users 4.5 sec and 500 users is 5 Sec
Now analyze Case - 1 and Case - 2. Which is scalable?
The answer is Case - 2. The reason is response times in Case - 1 are growing as we increase the number if users. Whereas in Case - 2 the response times are some what stable even if we increase the number of users. Now we will say the Case - 2 is scalable.
What are the factors causes for slow download times?
- Pages: Too Many Bytes :- bigger the page size, slow the response time is. Compare loading google and yahoo websites and measure the response time. Which home page takes longer time to load. yahoo home page is more than 159KB with lots of images and google home page is not more than 10KB.
- Slow Servers:- If the performance of any server is slow within the architecture of the application, that server becomes a bottleneck. And it leads to high response time. That means poor performance.
The standard guidelines for response times are:
- 0.1 second (one tenth of a second). Ideal response time. The user doesn't sense any interruption.
- 1 second. Highest acceptable response time. Download times above 1 second interrupt the user experience.
- 10 seconds. Unacceptable response time. The user experience is interrupted at an alarming high rate and the user is likely to leave the site or system.
These numbers are highly useful when planning server capacity.
What is stability testing?
Outcomes of this testing is :
- To determine memory leaks on middleware or application servers
- To find out the cursor leaks on the database
- To find out connection leaks on the database
- To find out the response time degradation with the data growing on the database etc.
What are the goals of performance testing?
- Stability
- Response time
- Scalability
- Errors
Performance Testing in Modern Development Life Cycle
- Analyzing service level agreement
- Defining performance requirements
- Creating test design,
- Building performance test scripts, how these test scripts are executed
- And finally the analysis phase.
What kind of questions Performance, Load and Stress testing answers?
- Can my website support 1,000 hits/second? If so, for how long?
- Can my e-commerce application handle 500 users searching for products and 250 users adding items to their shopping carts simultaneously?
- What happens to application performance as the backend database gets larger and larger?
Why load testing is important?
- Increase uptime of mission-critical Internet systems.
- Avoid project failures by predicting site behavior under large user loads
- Measure and monitor performance of your e-business infrastructure.
- Protect IT investments by predicting scalability and performance.
What is the criteria to select a performance-testing tool?
- Support for your application environment
- Intuitive test case design and execution
- Accurate emulation of real users
- Power and scalability to generate required system load levels
- Accurate error detection and performance measurements
- Powerful root cause analysis capabilities
Where exactly the Performance Testing stands in Software Development Life Cycle?
ge gives you an insight about where exactly performance testing stands in Testing life cycle.
Constraints of Performance Testing
- Performance Testing is a complex and time consuming activity.
- The testing process should start from the requirements collection phase itself.
- Performance Testing requires simulating several hundred concurrent users. This requires automated tools that are expensive.
- A proper environment like bandwidth, system configuration, and concurrent users hinders in providing adequate performance results.
- Production environment cannot be simulated as it requires investments. A subdued environment may not produce the relevant results.
- Skill set to plan and conduct Performance Testing is not adequately available. It is a late activity, and duration available for testing is not adequate. However, testing the system for an optimal performance is a challenge and an opportunity.
Benefits from Performance Testing
- Improved quality from a user’s perspective
- Reduced cost of change
- Reduced system costs
- Increased profits
- Early identification of major application defects and architectural issues
- Guaranteed customer satisfaction
- Clarity on resource utilization
- Performance Testing also removes many myths associated with the users and builds confidence
Comparison between Functionality Testing and Performance Testing
- Functional Testing: Functional testing is conducted to verify the correctness of the operations of the software. The features and functions are tested before performance testing. The purpose is to verify that the internal operations of the product are working according to desired specifications. Functional testing typically tests accuracy of the application and how it behaves with different operating systems.
- Performance Testing: Performance Testing is designed to test the overall performance of the system at high load and stress conditions. Performance Testing occurs through out the software development life cycle to isolate performance related constraints. Even at unit level, the performance of the individual module may be assessed as the internal logic of software that is being tested.
How network speed impacts the performance?
- Network speed and performance are proportional to each other. As the network speed increases the page performance will also improves.
- Network speed and response time of a page are inversely proportional. As the network speed increases the response time decreases (means performance of the page is better).
Why do we need to go for Performance Testing?
Performance Testing Types
- load testing
- stress testing
- endurance testing
- spike testing
- Load Testing
This is the simplest form of performance testing. A load test is usually conducted to understand the behavior of the application under a specific expected load. This load can be the expected concurrent number of users on the application performing a specific number of transaction within the set duration. This test will give out the response times of all the important business critical transactions. If the database, application server, etc are also monitored, then this simple test can itself point towards the bottleneck in the application.
- Stress Testing
This testing is normally used to break the application. Double the number of users are added to the application and the test is run again until the application breaks down. This kind of test is done to determine the application's robustness in times of extreme load and helps application administrators to determine if the application will perform sufficiently if the current load goes well above the expected load.
- Endurance Testing (Soak Testing)
This test is usually done to determine if the application can sustain the continuous expected load. Generally this test is done to determine if there are any memory leaks in the application.
- Spike Testing
Spike testing, as the name suggests is done by spiking the number of users and understanding the behavior of the application whether it will go down or will it be able to handle dramatic changes in load.
What is Performance Testing?
- To demonstrate that the systems meets performance criteria.
- To compare two systems to find which performs better.
- To measure what parts of the system or workload cause the system to perform badly
functioning (delivering cash) according to requirements. It fails in terms of performance (takes more than 5 minutes to complete the transaction).