SlideShare a Scribd company logo
1 of 30
Download to read offline
Performance of
Web Technologies
Thanos Theodoridis
@attheodo - http://attheo.do
Τετάρτη, 11 Ιανουαρίου 2012
What is web performance?
Τετάρτη, 11 Ιανουαρίου 2012
What is web performance?
Τετάρτη, 11 Ιανουαρίου 2012
“The delay perceived by the user between an action
and a meaningful response”
What is web performance?
Τετάρτη, 11 Ιανουαρίου 2012
What causes the delay?
Web technologies are mostly client-server AND/OR server-server
architectures over the network
Client
• bad hardware
• front-end (app/website/browser) sucks
Server
• bad hardware
• back-end (operating system, web server, database
software, your code) sucks
Network
• bad hardware (routers, switches, WiFi antennas)
• limited availability & bandwidth (ever heard of 3G?)
• dodgy ISPs & datacenters
Τετάρτη, 11 Ιανουαρίου 2012
Why delay matters?
Τετάρτη, 11 Ιανουαρίου 2012
Why delay matters?
Τετάρτη, 11 Ιανουαρίου 2012
Why delay matters?
It costs money to
EVERYONE!
Τετάρτη, 11 Ιανουαρίου 2012
Why delay matters?
Τετάρτη, 11 Ιανουαρίου 2012
Why delay matters?
Amazon Offline: $1M/hour
Τετάρτη, 11 Ιανουαρίου 2012
Why delay matters?
Amazon Offline: $1M/hour
eBay Offline: $90K/hour
Τετάρτη, 11 Ιανουαρίου 2012
How performance becomes a money issue
• Bad UX (you are losing fans)
• Bounce Rate sky-rockets (you are losing visitors)
• Page Views go down (you are losing Sales)
• Conversion Rate goes down (you are losing revenue)
• Infrastructure expenses go high (you bleed money)
Τετάρτη, 11 Ιανουαρίου 2012
4 Laws of web performance
Τετάρτη, 11 Ιανουαρίου 2012
The Law of Stickiness
If your website performs, users stick with it.
If your website disappoints users, they move to another and
stick with that.
Τετάρτη, 11 Ιανουαρίου 2012
The Law of User Perspective
Measure performance from the end-userʼs point of view
Τετάρτη, 11 Ιανουαρίου 2012
The Law of Responsibility
Whatever happens, itʼs your fault. Even if hell breaks loose.
Τετάρτη, 11 Ιανουαρίου 2012
The Law of Expectations
Users expect your website to perform at least as well or
better that a similar website theyʼve used
Τετάρτη, 11 Ιανουαρίου 2012
The law of the laws
“Premature optimization is the root of all
evil.”
Τετάρτη, 11 Ιανουαρίου 2012
Server-side performance
Τετάρτη, 11 Ιανουαρίου 2012
Server-side performance
• How good you stack components interoperate together
• HTTP server
• database
• frameworks
• operating system
• How efficiently your code runs on your stack
• query tuning / indexes (for the database)
• runtime optimizations (compiler flags, configuration/tuning)
• resource utilization (multicore CPU)
requests / second avg response
time / request
Most important numbers
Τετάρτη, 11 Ιανουαρίου 2012
Load Testing
ab - Apache HTTP server benchmarking tool
$ ab -n 1000 -c 5 http://www.inf.uth.gr
[...]
Requests per second: 0.59 [#/sec] (mean)
Time per request: 1688.597 [ms] (mean)
[...]
... or Apache JMeter
... or httperf (HP labs)
... or OpenSTA (heavyweight tool)
... or even cloud services like Blitz.io (paid)
Τετάρτη, 11 Ιανουαρίου 2012
Application Level (code profiling)
- PHP - XDebug, PECL APD Extension
- Python - cProfile, timeit
- Java Servlets - JProfiler
- ....Good old gettime();
Database Level (optimize queries)
- MySQL
mysql> SET profiling=1;
SELECT * FROM `table_name`;
mysql> SHOW PROFILES;
- MongoDB
mongostat
Operating System Level (resource monitoring)
./top (general)
./vmstat (Virtual Memory Statistics, paging, block I/O)
./iostat (disk I/O)
Networking Level
- tcpdump
- netstat
Τετάρτη, 11 Ιανουαρίου 2012
Client-side performance
Τετάρτη, 11 Ιανουαρίου 2012
Client-side performance
• How good is your front-end
• Browser (you canʼt really do anything about it)
• HTML syntax (standards compliant?)
• CSS (standards compliant?)
• Javascript code
• How well all the above play together
Most important numbers
Initial Render Time
Page (completely) Load time
~ 3-4 seconds
< 700-1000ms
< 3s
Τετάρτη, 11 Ιανουαρίου 2012
Client-side performance
• 0.1 seconds gives the feeling of instantaneous respone
• 1 second keeps the userʼs flow of thought constant
• 10 seconds keeps the userʼs attention
• Most of the page load time is spent outside your hosting
datacenter
• Optimize your front-end
• Optimize the interaction bertween the end-userʼs browser and
your server
• Fine tune the way the browser processes client-side elements
HTML CSS Javascript Images
Browser
HTTP
TCP/IP
Τετάρτη, 11 Ιανουαρίου 2012
How a website loads
Τετάρτη, 11 Ιανουαρίου 2012
Page Load Time
Page Load Time = (RTT x Turns) + Server Processing Time +
Client Processing Time + Page Size/Bandwidth
• Page Size
• HTML filesize + Stylesheets size + Javascripts size + images size + 3rd party
banners + ...
• RTT
• latency between sending of a request to the Web server and the receipt of the
first bytes
• Turns
• The number of TCP connections required to download a component
• Base HTML contains instructions for locating and fetching additional website
objects like images or scripts
• Depends whether HTTP1.0/1.1 to determine how many per component
• Processing time (Client + Server)
• Non-deterministic, varies dramatically from application to application
Τετάρτη, 11 Ιανουαρίου 2012
Web Performance Best Practices
Every kid on the block has a set of rules and a tool
•Google
•PageSpeed Extension
•http://code.google.com/speed/page-speed/docs/rules_intro.html
•Yahoo
•YSlow Extension
•http://developer.yahoo.com/yslow/help/#guidelines
6 Rules to rule them all
•Reduce page size to < 500kb
•Enable gzip compression
•Minify and merge CSS and javascript files
•Reduce RTTs (<40 per page)
•Structure properly: CSS first, javascript last (not always possible)
•CACHE, CACHE, CACHE, OMG OMG CACHE!!!
If you apply these properly, page download times will
drop by 40-50%
Τετάρτη, 11 Ιανουαρίου 2012
DEMO
YSlow in action
Τετάρτη, 11 Ιανουαρίου 2012
Questions?
Τετάρτη, 11 Ιανουαρίου 2012

More Related Content

What's hot

Debugging WordPress
Debugging WordPressDebugging WordPress
Debugging WordPressMario Peshev
 
Adobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - IntroductionAdobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - IntroductionTekno Point
 
Advance java session 20
Advance java session 20Advance java session 20
Advance java session 20Smita B Kumar
 
Introdcution to Adobe CQ
Introdcution to Adobe CQIntrodcution to Adobe CQ
Introdcution to Adobe CQRest West
 
High performance website
High performance websiteHigh performance website
High performance websiteChamnap Chhorn
 
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra  SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra Sencha
 
Advance java session 15
Advance java session 15Advance java session 15
Advance java session 15Smita B Kumar
 
Servlet and JSP
Servlet and JSPServlet and JSP
Servlet and JSPGary Yeh
 
Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015Alan Lok
 
Krug Fat Client
Krug Fat ClientKrug Fat Client
Krug Fat ClientPaul Klipp
 
Rest api design by george reese
Rest api design by george reeseRest api design by george reese
Rest api design by george reesebuildacloud
 
Piecing Together the WordPress Puzzle
Piecing Together the WordPress PuzzlePiecing Together the WordPress Puzzle
Piecing Together the WordPress PuzzleBusiness Vitality LLC
 
ClubAJAX Basics - Server Communication
ClubAJAX Basics - Server CommunicationClubAJAX Basics - Server Communication
ClubAJAX Basics - Server CommunicationMike Wilcox
 
Using MAMP for Web Development
Using MAMP for Web DevelopmentUsing MAMP for Web Development
Using MAMP for Web DevelopmentEric Greene
 
PLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfPLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfAlfresco Software
 

What's hot (20)

Codeigniter
CodeigniterCodeigniter
Codeigniter
 
Debugging WordPress
Debugging WordPressDebugging WordPress
Debugging WordPress
 
Adobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - IntroductionAdobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - Introduction
 
Advance java session 20
Advance java session 20Advance java session 20
Advance java session 20
 
Introdcution to Adobe CQ
Introdcution to Adobe CQIntrodcution to Adobe CQ
Introdcution to Adobe CQ
 
Web Servers (ppt)
Web Servers (ppt)Web Servers (ppt)
Web Servers (ppt)
 
High performance website
High performance websiteHigh performance website
High performance website
 
Web Fundamental
Web FundamentalWeb Fundamental
Web Fundamental
 
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra  SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
 
Advance java session 15
Advance java session 15Advance java session 15
Advance java session 15
 
Servlet and JSP
Servlet and JSPServlet and JSP
Servlet and JSP
 
19servlets
19servlets19servlets
19servlets
 
Javascript & Jquery
Javascript & JqueryJavascript & Jquery
Javascript & Jquery
 
Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015
 
Krug Fat Client
Krug Fat ClientKrug Fat Client
Krug Fat Client
 
Rest api design by george reese
Rest api design by george reeseRest api design by george reese
Rest api design by george reese
 
Piecing Together the WordPress Puzzle
Piecing Together the WordPress PuzzlePiecing Together the WordPress Puzzle
Piecing Together the WordPress Puzzle
 
ClubAJAX Basics - Server Communication
ClubAJAX Basics - Server CommunicationClubAJAX Basics - Server Communication
ClubAJAX Basics - Server Communication
 
Using MAMP for Web Development
Using MAMP for Web DevelopmentUsing MAMP for Web Development
Using MAMP for Web Development
 
PLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfPLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring Surf
 

Viewers also liked

Ch. 10 custom tag development
Ch. 10 custom tag developmentCh. 10 custom tag development
Ch. 10 custom tag developmentManolis Vavalis
 
Ch. 9 jsp standard tag library
Ch. 9 jsp standard tag libraryCh. 9 jsp standard tag library
Ch. 9 jsp standard tag libraryManolis Vavalis
 
2η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
2η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού2η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
2η διάλεξη Τεχνολογίες Παγκόσμιου ΙστούManolis Vavalis
 
Ch6 conversational state
Ch6   conversational stateCh6   conversational state
Ch6 conversational stateManolis Vavalis
 
1η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
1η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού1η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
1η διάλεξη Τεχνολογίες Παγκόσμιου ΙστούManolis Vavalis
 
3η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
3η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού3η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
3η διάλεξη Τεχνολογίες Παγκόσμιου ΙστούManolis Vavalis
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
 

Viewers also liked (11)

Ch. 12 security
Ch. 12 securityCh. 12 security
Ch. 12 security
 
Ch. 10 custom tag development
Ch. 10 custom tag developmentCh. 10 custom tag development
Ch. 10 custom tag development
 
Ch. 9 jsp standard tag library
Ch. 9 jsp standard tag libraryCh. 9 jsp standard tag library
Ch. 9 jsp standard tag library
 
2η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
2η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού2η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
2η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
 
Ch6 conversational state
Ch6   conversational stateCh6   conversational state
Ch6 conversational state
 
1η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
1η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού1η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
1η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
 
Being a jsp
Being a jsp     Being a jsp
Being a jsp
 
Ch. 7 beeing a jsp
Ch. 7 beeing a jsp     Ch. 7 beeing a jsp
Ch. 7 beeing a jsp
 
Ch. 8 script free pages
Ch. 8 script free pagesCh. 8 script free pages
Ch. 8 script free pages
 
3η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
3η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού3η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
3η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 

Similar to Ch. x web performance

Configuring Apache Servers for Better Web Perormance
Configuring Apache Servers for Better Web PerormanceConfiguring Apache Servers for Better Web Perormance
Configuring Apache Servers for Better Web PerormanceSpark::red
 
Latency - The King of the Mobile Experience
Latency - The King of the Mobile Experience Latency - The King of the Mobile Experience
Latency - The King of the Mobile Experience WardTechTalent
 
Tips for Optimizing Web Performance
Tips for Optimizing Web PerformanceTips for Optimizing Web Performance
Tips for Optimizing Web PerformanceThousandEyes
 
Art and Science of Web Sites Performance: A Front-end Approach
Art and Science of Web Sites Performance: A Front-end ApproachArt and Science of Web Sites Performance: A Front-end Approach
Art and Science of Web Sites Performance: A Front-end ApproachJiang Zhu
 
ConFoo 2017: Introduction to performance optimization of .NET web apps
ConFoo 2017: Introduction to performance optimization of .NET web appsConFoo 2017: Introduction to performance optimization of .NET web apps
ConFoo 2017: Introduction to performance optimization of .NET web appsPierre-Luc Maheu
 
1. web technology basics
1. web technology basics1. web technology basics
1. web technology basicsJyoti Yadav
 
Breaking the Speed Limit: Faster Websites Win
Breaking the Speed Limit: Faster Websites WinBreaking the Speed Limit: Faster Websites Win
Breaking the Speed Limit: Faster Websites WinJonathan Hochman
 
Mtn view sql server nov 2014
Mtn view sql server nov 2014Mtn view sql server nov 2014
Mtn view sql server nov 2014EspressoLogic
 
Measuring CDN performance and why you're doing it wrong
Measuring CDN performance and why you're doing it wrongMeasuring CDN performance and why you're doing it wrong
Measuring CDN performance and why you're doing it wrongFastly
 
Web Architecture and Technologies
Web Architecture and TechnologiesWeb Architecture and Technologies
Web Architecture and TechnologiesFulvio Corno
 
Making it fast: Zotonic & Performance
Making it fast: Zotonic & PerformanceMaking it fast: Zotonic & Performance
Making it fast: Zotonic & PerformanceArjan
 
Site Speed Fundamentals
Site Speed FundamentalsSite Speed Fundamentals
Site Speed FundamentalsMartin Breest
 
Web Performance First Aid
Web Performance First AidWeb Performance First Aid
Web Performance First AidAlan Seiden
 
Optimization of modern web applications
Optimization of modern web applicationsOptimization of modern web applications
Optimization of modern web applicationsEugene Lazutkin
 
introduction to Web system
introduction to Web systemintroduction to Web system
introduction to Web systemhashim102
 
Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"
Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"
Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"Fwdays
 

Similar to Ch. x web performance (20)

Configuring Apache Servers for Better Web Perormance
Configuring Apache Servers for Better Web PerormanceConfiguring Apache Servers for Better Web Perormance
Configuring Apache Servers for Better Web Perormance
 
Latency - The King of the Mobile Experience
Latency - The King of the Mobile Experience Latency - The King of the Mobile Experience
Latency - The King of the Mobile Experience
 
Tips for Optimizing Web Performance
Tips for Optimizing Web PerformanceTips for Optimizing Web Performance
Tips for Optimizing Web Performance
 
Web Performance Optimization (WPO)
Web Performance Optimization (WPO)Web Performance Optimization (WPO)
Web Performance Optimization (WPO)
 
Art and Science of Web Sites Performance: A Front-end Approach
Art and Science of Web Sites Performance: A Front-end ApproachArt and Science of Web Sites Performance: A Front-end Approach
Art and Science of Web Sites Performance: A Front-end Approach
 
ConFoo 2017: Introduction to performance optimization of .NET web apps
ConFoo 2017: Introduction to performance optimization of .NET web appsConFoo 2017: Introduction to performance optimization of .NET web apps
ConFoo 2017: Introduction to performance optimization of .NET web apps
 
Web Fendamentals
Web FendamentalsWeb Fendamentals
Web Fendamentals
 
1. web technology basics
1. web technology basics1. web technology basics
1. web technology basics
 
Breaking the Speed Limit: Faster Websites Win
Breaking the Speed Limit: Faster Websites WinBreaking the Speed Limit: Faster Websites Win
Breaking the Speed Limit: Faster Websites Win
 
Mtn view sql server nov 2014
Mtn view sql server nov 2014Mtn view sql server nov 2014
Mtn view sql server nov 2014
 
Measuring CDN performance and why you're doing it wrong
Measuring CDN performance and why you're doing it wrongMeasuring CDN performance and why you're doing it wrong
Measuring CDN performance and why you're doing it wrong
 
Web Architecture and Technologies
Web Architecture and TechnologiesWeb Architecture and Technologies
Web Architecture and Technologies
 
Web server
Web serverWeb server
Web server
 
Making it fast: Zotonic & Performance
Making it fast: Zotonic & PerformanceMaking it fast: Zotonic & Performance
Making it fast: Zotonic & Performance
 
Site Speed Fundamentals
Site Speed FundamentalsSite Speed Fundamentals
Site Speed Fundamentals
 
Web Performance First Aid
Web Performance First AidWeb Performance First Aid
Web Performance First Aid
 
Optimization of modern web applications
Optimization of modern web applicationsOptimization of modern web applications
Optimization of modern web applications
 
introduction to Web system
introduction to Web systemintroduction to Web system
introduction to Web system
 
Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"
Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"
Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"
 
Otimizando servidores web
Otimizando servidores webOtimizando servidores web
Otimizando servidores web
 

Recently uploaded

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 

Recently uploaded (20)

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 

Ch. x web performance

  • 1. Performance of Web Technologies Thanos Theodoridis @attheodo - http://attheo.do Τετάρτη, 11 Ιανουαρίου 2012
  • 2. What is web performance? Τετάρτη, 11 Ιανουαρίου 2012
  • 3. What is web performance? Τετάρτη, 11 Ιανουαρίου 2012
  • 4. “The delay perceived by the user between an action and a meaningful response” What is web performance? Τετάρτη, 11 Ιανουαρίου 2012
  • 5. What causes the delay? Web technologies are mostly client-server AND/OR server-server architectures over the network Client • bad hardware • front-end (app/website/browser) sucks Server • bad hardware • back-end (operating system, web server, database software, your code) sucks Network • bad hardware (routers, switches, WiFi antennas) • limited availability & bandwidth (ever heard of 3G?) • dodgy ISPs & datacenters Τετάρτη, 11 Ιανουαρίου 2012
  • 6. Why delay matters? Τετάρτη, 11 Ιανουαρίου 2012
  • 7. Why delay matters? Τετάρτη, 11 Ιανουαρίου 2012
  • 8. Why delay matters? It costs money to EVERYONE! Τετάρτη, 11 Ιανουαρίου 2012
  • 9. Why delay matters? Τετάρτη, 11 Ιανουαρίου 2012
  • 10. Why delay matters? Amazon Offline: $1M/hour Τετάρτη, 11 Ιανουαρίου 2012
  • 11. Why delay matters? Amazon Offline: $1M/hour eBay Offline: $90K/hour Τετάρτη, 11 Ιανουαρίου 2012
  • 12. How performance becomes a money issue • Bad UX (you are losing fans) • Bounce Rate sky-rockets (you are losing visitors) • Page Views go down (you are losing Sales) • Conversion Rate goes down (you are losing revenue) • Infrastructure expenses go high (you bleed money) Τετάρτη, 11 Ιανουαρίου 2012
  • 13. 4 Laws of web performance Τετάρτη, 11 Ιανουαρίου 2012
  • 14. The Law of Stickiness If your website performs, users stick with it. If your website disappoints users, they move to another and stick with that. Τετάρτη, 11 Ιανουαρίου 2012
  • 15. The Law of User Perspective Measure performance from the end-userʼs point of view Τετάρτη, 11 Ιανουαρίου 2012
  • 16. The Law of Responsibility Whatever happens, itʼs your fault. Even if hell breaks loose. Τετάρτη, 11 Ιανουαρίου 2012
  • 17. The Law of Expectations Users expect your website to perform at least as well or better that a similar website theyʼve used Τετάρτη, 11 Ιανουαρίου 2012
  • 18. The law of the laws “Premature optimization is the root of all evil.” Τετάρτη, 11 Ιανουαρίου 2012
  • 19. Server-side performance Τετάρτη, 11 Ιανουαρίου 2012
  • 20. Server-side performance • How good you stack components interoperate together • HTTP server • database • frameworks • operating system • How efficiently your code runs on your stack • query tuning / indexes (for the database) • runtime optimizations (compiler flags, configuration/tuning) • resource utilization (multicore CPU) requests / second avg response time / request Most important numbers Τετάρτη, 11 Ιανουαρίου 2012
  • 21. Load Testing ab - Apache HTTP server benchmarking tool $ ab -n 1000 -c 5 http://www.inf.uth.gr [...] Requests per second: 0.59 [#/sec] (mean) Time per request: 1688.597 [ms] (mean) [...] ... or Apache JMeter ... or httperf (HP labs) ... or OpenSTA (heavyweight tool) ... or even cloud services like Blitz.io (paid) Τετάρτη, 11 Ιανουαρίου 2012
  • 22. Application Level (code profiling) - PHP - XDebug, PECL APD Extension - Python - cProfile, timeit - Java Servlets - JProfiler - ....Good old gettime(); Database Level (optimize queries) - MySQL mysql> SET profiling=1; SELECT * FROM `table_name`; mysql> SHOW PROFILES; - MongoDB mongostat Operating System Level (resource monitoring) ./top (general) ./vmstat (Virtual Memory Statistics, paging, block I/O) ./iostat (disk I/O) Networking Level - tcpdump - netstat Τετάρτη, 11 Ιανουαρίου 2012
  • 23. Client-side performance Τετάρτη, 11 Ιανουαρίου 2012
  • 24. Client-side performance • How good is your front-end • Browser (you canʼt really do anything about it) • HTML syntax (standards compliant?) • CSS (standards compliant?) • Javascript code • How well all the above play together Most important numbers Initial Render Time Page (completely) Load time ~ 3-4 seconds < 700-1000ms < 3s Τετάρτη, 11 Ιανουαρίου 2012
  • 25. Client-side performance • 0.1 seconds gives the feeling of instantaneous respone • 1 second keeps the userʼs flow of thought constant • 10 seconds keeps the userʼs attention • Most of the page load time is spent outside your hosting datacenter • Optimize your front-end • Optimize the interaction bertween the end-userʼs browser and your server • Fine tune the way the browser processes client-side elements HTML CSS Javascript Images Browser HTTP TCP/IP Τετάρτη, 11 Ιανουαρίου 2012
  • 26. How a website loads Τετάρτη, 11 Ιανουαρίου 2012
  • 27. Page Load Time Page Load Time = (RTT x Turns) + Server Processing Time + Client Processing Time + Page Size/Bandwidth • Page Size • HTML filesize + Stylesheets size + Javascripts size + images size + 3rd party banners + ... • RTT • latency between sending of a request to the Web server and the receipt of the first bytes • Turns • The number of TCP connections required to download a component • Base HTML contains instructions for locating and fetching additional website objects like images or scripts • Depends whether HTTP1.0/1.1 to determine how many per component • Processing time (Client + Server) • Non-deterministic, varies dramatically from application to application Τετάρτη, 11 Ιανουαρίου 2012
  • 28. Web Performance Best Practices Every kid on the block has a set of rules and a tool •Google •PageSpeed Extension •http://code.google.com/speed/page-speed/docs/rules_intro.html •Yahoo •YSlow Extension •http://developer.yahoo.com/yslow/help/#guidelines 6 Rules to rule them all •Reduce page size to < 500kb •Enable gzip compression •Minify and merge CSS and javascript files •Reduce RTTs (<40 per page) •Structure properly: CSS first, javascript last (not always possible) •CACHE, CACHE, CACHE, OMG OMG CACHE!!! If you apply these properly, page download times will drop by 40-50% Τετάρτη, 11 Ιανουαρίου 2012
  • 29. DEMO YSlow in action Τετάρτη, 11 Ιανουαρίου 2012