Guidelines on post-production performance issues & resolutionsApr 5, 2016
There is no such thing as a bug-free software!
Although nice to think about, bug-free software seems to be a tomorrow that will never come. Problems can come from anywhere. There’s always a little chance of error when it comes to speed and performance in a web application, particularly when it involves customers and revenue. Though it is inevitable to evade any errors, we can definitely prevent it with some proactive actions like post-production performance testing. Some of the most common issues identified are:
- Long user response time
- Long server response time
- Memory leaks
- High CPU usage
- Length queues for requests
- HTTP errors
- Pages not available
It is rightly said that prevention is better than cure. As an experienced software testing company, we thought of drafting guidelines on some of the most common performance issues one can encounter and how to resolve it.
Poorly Written Code: Poorly written code can cause memory leaks and application deadlocks. Sometimes the old version of a software or integrated legacy system can also drag performance down.
- Solution: Make sure an application has passed through white box testing, teams are using all the tools at their disposal – from automated tools like profilers to best programming practices like code reviews.
Un-Optimized Databases: Production Environment can be destroyed by an un-optimized database output. Missing indexes also slow down the performance of SQL queries.
- Solution: Make sure developer has used the scripts and file statistics to check for any inefficient queries.
DNS, Firewall, and Network Connectivity: The DNS queries take the majority of web traffic. Sometimes outside visitors also face the problem of opening the site and resulting errors, 404 and incorrect pathway.
- Solution: Use DNS monitoring safeguards to pinpoint problems at hand. Also, revise switches, check VLAN tags, and distribute tasks between servers.
Slow 3rd Party Search Service: Sometimes 3rd party tools slow down and gets out of control. It’s hard to determine that the problem is on our side or that of the third party user. If you decide to continue using the third-party service, look at making some design changes to protect your site from at least some of the effects of a third-party service issue.
- Solution: Make sure that your off-service provider guarantees performance.
Extreme XML processing: If data is too long to process than XML processing can be long process after fetching data from database and it takes so much time and resulting the slowness of server and creates bad effect in performance of application.
- Solution: Make sure the server configuration is also high so that multiple requests and responses can be handled in minimum amount of time.
Excessive SQL Queries: SQL queries requests come from an application and fulfilled by database that sometimes application throws so many requests at a time. Stack will create on application pool and as per request priority, database gives output to application. It may be possible that so many client requests are on application pool and it takes too long time to render request of application and resulting into slowness of server.
- Solution: Server configuration should be high so that so many Queries can be handled in less amount of time.
Mail Server Connectivity: Application uses the Mail server for communication. Sometimes it takes long time to connect mail server and resulting into slowness.
- Solution: We can use continuous ingression tools available in market like, “New Relic” (End-to-end transaction tracing, code-level visibility, and Key transaction).
Below are few points for resolution this post production performance issue:
Web Application Performance tuning:
- Turn off Tracing unless until required
- Turn off Session State, if not required
- Disable View State of a page if possible
- Set debug=false in web.config
- Avoid Response.Redirect
- Use the String builder to concatenate string
- Avoid throwing exceptions
- Use Finally Method to kill resources
- Use Client Side Scripts for validations
- Avoid unnecessary round trips to the server
- Use Page.ISPostBack
- Include Return Statements within the function/method
- Use "ArrayLists" in place of arrays
- Avoid unnecessary indirection
Tips for Database operations:
- Return multiple result sets
- Connection Pooling and Object Pooling
- Use SqlDataReader Instead of Dataset wherever it is possible
- Keep your datasets lean
- Avoid inefficient queries
- Unnecessary round trips
- Too many open connections
- Avoid transaction misuse
- Avoid over normalized tables
- Reduce serialization
- Do not use command builder at run time
- Use stored procedures whenever possible
- Avoid auto-generated commands
Web applications are becoming complex day by day and at the same time, the identification of their performance bottlenecks is becoming a tough task. Various factors contribute to the performance issues and knowledge of those issues & their symptoms are mandatory to rectify the performance bottlenecks. Web server, application server, database server hardware, software and design along with network configurations can be major contributors to performance bottlenecks. Moreover, client-side design and third party components can also affect web application performance. Knowledge of a performance testing and complete list of symptoms of all potential problematic areas will help in identifying the root cause and its remedy.
Author: This blog is written by Software Quality Assurance team at TatvaSoft. Please feel free to talk to us for any queries or requirements of software testing.
TatvaSoft is a CMMi Level 3 and Microsoft Gold Certified Software Development Company offering custom software development services on diverse technology platforms, like Microsoft, SharePoint, Biztalk, Java, PHP, Open Source, BI, Big Data and Mobile.