web application performance

23
Web application performance 1 4/23/22 Presented by Pranjal Srivastava

Upload: codefiretech

Post on 12-Nov-2014

3.355 views

Category:

Technology


1 download

DESCRIPTION

This is useful for any entry level web developer. It describes what is performance. Tools you can used to measure and optimize performance and steps to follow to do the same.

TRANSCRIPT

Page 1: Web Application Performance

Web application performance

1

Saturday, April 8, 2023

Presented by Pranjal Srivastava

Page 2: Web Application Performance

What is performance?

Page 3: Web Application Performance

Performance definition

• The accomplishment of a given task measured against preset known standards of accuracy, completeness, cost, and speed.

http://www.businessdictionary.com/definition/performance.html#ixzz2Y5INtXmj

• Performance is based on your “Perception”

Page 4: Web Application Performance

Perception

Page 5: Web Application Performance

Perception

Page 6: Web Application Performance

What is web application performance?

Page 7: Web Application Performance

Why application should perform well?

Page 8: Web Application Performance

image courtesy “Times of India”

Page 9: Web Application Performance

What is good / acceptable performance• Good performance is a relative term

– Varies based on type of applications– Varies based on type of usage

• What we say good today may not be good enough in future

• 5-8 Second is generally a threshold for a page to load on a web application

• For a rich web app (like gMail) initial load time may be higher but that’s a trade

off for rich UX inside app• AJAX and Use of animated gif to show that

page is loading…

Page 10: Web Application Performance

Steps to optimize you application

• Measure performance

• Diagnose bottlenecks

• Fix issues

Page 11: Web Application Performance

Measure

• Performance with single user

• Load it and monitor performance

• Monitor performance on Production server

– Identify bottlenecks

Page 12: Web Application Performance

Diagnose problems

• JS / HTML level• Code Level• DB level• Server level• Network

Page 13: Web Application Performance

Commonly used tools for diagnosis

• Slow query log– Generally 5-10 ms is considered reasonable query

performance • Yslow (http://developer.yahoo.com/yslow)/

Page speed (https://developers.google.com/speed/pagespeed/)

• Code profiling and optimization• Web based tools

– http://www.webpagetest.org– http://tools.pingdom.com

Page 14: Web Application Performance

Diagnostic tools (Page Speed)

Page 15: Web Application Performance

Diagnostic tools (webpagetest.org)

• Initial page load time• Repeat page load time• Filmstrip View• Video view of page load• Load times for each individual elements

Page 16: Web Application Performance

Fix (Browser level)• XHTML

• DIV based design

• Optimized images

• No errors in code (Validated HTML)

Page 17: Web Application Performance

Fix (Network level)• Reduce size of files

– Gzip (JS, CSS compression)– JS/ CSS minify (reduce size)– Image compression (reduce size)

• Use Content delivery network (CDN)– images, videos, audio clips, CSS files, JS files. – Browsers limit the number of concurrent connections

to a single domain. Most permit four active connections

– Distributed data center– Distribute the load, save bandwidth, boost

performance• Combine multiple web calls

Page 18: Web Application Performance

Fix (Code level)• Code Profiling

• Review code

• Change Algorithms

• Generally avoided since it can lead to functional bugs

Page 19: Web Application Performance

Fix (Server level)• Increase server size

– Shared host– VPS– Dedicated server – CPU / Memory

• Use Server Clusters– Load balancing– Sticky sessions

Page 20: Web Application Performance

AWS Server layout

Page 21: Web Application Performance

Fix (DB level)• Indexes

• Not more than 3 and at max 5 tables join

• MySQL query cache– query_cache_size (if set to 0 no cache)– query_cache_type (value on or 1)– query_cache_limit (max size limit)

• Optimize based on engine used (InnoDB, MyiSAM)

Page 22: Web Application Performance

Fix (Advanced)

• Cache– Code level Cache– Varnish

• DB cache– Code level Cache– Memcache

Page 23: Web Application Performance

About Presenter• Pranjal Srivastava is founder of CodeFire Technologies Pvt Lts.

• He has over 14 years of experience in technology consultancy, architecting enterprise systems and optimizing performance of web applications.

•  He received his B.Tech from Institute of Technology - Banaras Hindu University, Varanasi, India

• He can be reached at [email protected]