SlideShare a Scribd company logo
1 of 68
AJAX for ScalabilityErik SchultinkPHP Barcelona – 30 Oct, 2009
AJAX What is AJAX? “Asynchronous JavaScript and XML” Paradigm for client-server interaction Change state on client, without loading a complete HTML page
Traditional HTML Browsing User clicks link Browser sends request Server receives, parses request, generates response Browser receives response and begins rendering Dependent objects (images, js, css) load and render Page appears
AJAX Browsing User clicks link Browser sends request Server receives, parses request, generates response Browser receives response and begins rendering Dependent objects (images, js, css) load and render Page appears
Why Asynchronous? Not always necessary to wait for server response Most of response is predictable
Scalability? Through-put, not speed Ideally, capacity is linear function of machines In practice, linear below some boundary
What is Tuenti.com?
Tuenti.com Started 2007 More than 20 billion pageviews/month More than 20k/second at peak Based in Madrid ~80 employees, 40 engineers
How does Tuenti use AJAX? Only pageloads are login and home page Loader pulls in all JS/CSS Afterwards stay within one HTML page, rotating canvas area content
How does Tuenti use AJAX? PHOTO UPLOAD
How does Tuenti use AJAX? CHAT
How does Tuenti use AJAX? CHAT
How does Tuenti use AJAX?
How does Tuenti use AJAX?
Traditional Systems Architecture www.tuenti.com Load Balancer Web server farm Web server farm Web server farm
Traditional Systems Architecture www.tuenti.com 12.45.34.179 12.45.34.178 Load Balancer Load Balancer Web server farm Web server farm Web server farm Web server farm
Client-side Routing www.tuenti.com wwwb3.tuenti.com wwwb2.tuenti.com wwwb1.tuenti.com wwwb4.tuenti.com Load Balancer Load Balancer Load Balancer Load Balancer Web server farm Web server farm Web server farm Web server farm Linearly scalable …
Client-side Routing www.tuenti.com wwwb3.tuenti.com wwwb2.tuenti.com wwwb1.tuenti.com wwwb4.tuenti.com Load Balancer Load Balancer Load Balancer Load Balancer Web server farm Web server farm Web server farm Web server farm Linearly scalable … except for top level
Client-side Routing www.tuenti.com wwwb3.tuenti.com wwwb2.tuenti.com wwwb1.tuenti.com wwwb4.tuenti.com Load Balancer Load Balancer Load Balancer Load Balancer Web server farm Web server farm Web server farm Web server farm lots of content creation  = lots of dynamic data
Client-side Routing www.tuenti.com wwwb3.tuenti.com wwwb2.tuenti.com wwwb1.tuenti.com wwwb4.tuenti.com Load Balancer Load Balancer Load Balancer Load Balancer Web server farm Web server farm Web server farm Web server farm Cache Farm  lots of dynamic data  = lots of cache  = internal network traffic
Client-side Routing www.tuenti.com wwwb3.tuenti.com wwwb2.tuenti.com wwwb1.tuenti.com wwwb4.tuenti.com Load Balancer Load Balancer Load Balancer Load Balancer Web server farm Web server farm Web server farm Web server farm Cache Farm Cache Farm Cache Farm Cache Farm Partition cache Route requests to a farm near cache needed to respond
Internal network savings
Balancing Load Top-level requests to www.tuenti.com Each request tells client which farm it should be using, based on a mapping Mapping can be changed to balance load, perform maintenance, etc
Robust Browsing Don’t tightly couple layers Client and server are separate layers
Robust Browsing Client-side code should be robust against server-side failures What can go wrong? Client loses connectivity Server-side error Web server overloaded Entire server farm overloaded Server farm loses connectivity
Robust Browsing Options: Retry (carefully) Switch to alternate farm (carefully) Detect error, give user feedback
Caching Think like server-side scalability Cache data that is likely to be requested in the future Doesn’t have consistency issues Doesn’t change
Cache Data in Client Browser More responsive for user Fewer requests to your servers
Some details Lots of dependencies to load initially Loading can be brittle and slow Browser performance
Some details Beware of external libraries Google JS lib are not static, not indefinitely cacheable
Some details Friends do have consistency issues Add/remove friends Change avatar (rare)
Image Serving Tuenti serves ~2.5 billion images/day At peak, this is >6 Gbps and >70k hits/sec We use CDNs
What is a CDN? Content Delivery Network
What is a CDN? Examples: Akamai, Limelight also dozens more, including Amazon Big distributed, object cache Pay per use  either per request, per TB transfer, or per peak Mbps
What is a CDN? Advantages: Outsource dev and infrastructure Geographically distributed Economies of scale Disadvantages: High cost Less control and transparency Commitments
What affects image load time? Client internet connection Response time of CDN CDN cache hit rate Response time of Origin
What affects image load time? Client internet connection Response time of CDN CDN cache hit rate Response time of Origin
Monitor Performance from Client Closer to performance experienced by end-user Only way to get view of network issues faced by users (ie last mile)
Good Monitoring Percentiles > averages  Less noise, more stable Comparable to SLA terms Establish baselines  performance relative to past more important than absolute Avoid false positives
How to fix slow ISP? Choose better transit provider Set-up peering (or get CDN too) Traffic management
What affects image load time? Client internet connection Response time of CDN CDN cache hit rate Response time of Origin
Quality of End-User Experience vs. Cost
We use multiple CDNs, and shift content based on price/performance.
Know your content
Know your content
Know your content
Know your content 30 75 200
Know your content 600
Know your content 120
Know your content
Pre-fetch Content Exploit predictable user behavior Ex: clicking to next photo in an album Simple solution – load next image hidden Client browser will cache it (next response < 100 ms) Increase tolerance for slow response time
Pre-fetch Content More complex solution Pre-fetch next canvas (full html), render in background – rotate in on Next Even more complex Instantiate HTML template w/ data  on client Pre-fetch data X photos in advance, render Y templates in advance with this data
Pre-fetch Content Problems: Rendering still takes time Increases browser load Need to set cache headers correctly
Image delivery Small images: High request, low volume Most cost-effective to cache in memory Large images: High volume, low requests, greater tolerance for latency
What affects image load time? Client internet connection Response time of CDN CDN cache hit rate Response time of Origin
Monitor Performance from Client cold servers online
What affects image load time? Client internet connection Response time of CDN CDN cache hit rate Response time of Origin
Deploy cache layers (squid, varnish) Optimize web servers for static content delivery More machines Avoid RAID, file system Improve Origin Response
Summary Cache and pre-fetch content Client-side routing Client-side monitoring
General caveats Be careful with browser performance Look carefully at what’s in the worst 5% Don’t assume that high values are incorrect
More jobs.tuenti.com Presentation Saturday 14:20 Challenge (win a PS3) Talk: Continuous Integration DavideMendolia, Saturday 12:00
More? Ask us!
More? Ask us!
Q & A

More Related Content

What's hot

Cache Optimization with Akamai
Cache Optimization with AkamaiCache Optimization with Akamai
Cache Optimization with Akamai
Blake Crosby
 
Php & web server performace
Php & web server performacePhp & web server performace
Php & web server performace
Tuyển Đoàn
 

What's hot (20)

Measuring Web Performance
Measuring Web Performance Measuring Web Performance
Measuring Web Performance
 
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
 
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
 
Cloud Hosting Services
Cloud Hosting ServicesCloud Hosting Services
Cloud Hosting Services
 
Why Use a Content Delivery Network (CDN)?
Why Use a Content Delivery Network (CDN)?Why Use a Content Delivery Network (CDN)?
Why Use a Content Delivery Network (CDN)?
 
Scalability -
Scalability - Scalability -
Scalability -
 
WordPress Optimization Tips for Performance & Speed
WordPress Optimization Tips for Performance & SpeedWordPress Optimization Tips for Performance & Speed
WordPress Optimization Tips for Performance & Speed
 
Presentation1
Presentation1Presentation1
Presentation1
 
Client-side Website Optimization
Client-side Website OptimizationClient-side Website Optimization
Client-side Website Optimization
 
Stress Test Drupal on Amazon EC2 vs. RackSpace cloud
Stress Test Drupal on Amazon EC2 vs. RackSpace cloudStress Test Drupal on Amazon EC2 vs. RackSpace cloud
Stress Test Drupal on Amazon EC2 vs. RackSpace cloud
 
Ajax Patterns : Periodic Refresh & Multi Stage Download
Ajax Patterns : Periodic Refresh & Multi Stage DownloadAjax Patterns : Periodic Refresh & Multi Stage Download
Ajax Patterns : Periodic Refresh & Multi Stage Download
 
Caching and Its Main Types
Caching and Its Main TypesCaching and Its Main Types
Caching and Its Main Types
 
Web performance
Web performanceWeb performance
Web performance
 
Speed Up WordPress Websites - Part 1 - WordPress Cairo Meetup
Speed Up WordPress Websites - Part 1 - WordPress Cairo MeetupSpeed Up WordPress Websites - Part 1 - WordPress Cairo Meetup
Speed Up WordPress Websites - Part 1 - WordPress Cairo Meetup
 
Web performance Talk
Web performance TalkWeb performance Talk
Web performance Talk
 
HTTP/2 Prioritization
HTTP/2 PrioritizationHTTP/2 Prioritization
HTTP/2 Prioritization
 
Caching 101
Caching 101Caching 101
Caching 101
 
Resource loading, prioritization, HTTP/2 - oh my!
Resource loading, prioritization, HTTP/2 - oh my!Resource loading, prioritization, HTTP/2 - oh my!
Resource loading, prioritization, HTTP/2 - oh my!
 
Cache Optimization with Akamai
Cache Optimization with AkamaiCache Optimization with Akamai
Cache Optimization with Akamai
 
Php & web server performace
Php & web server performacePhp & web server performace
Php & web server performace
 

Viewers also liked

OC 4H Fact Sheet 20
OC 4H Fact Sheet 20OC 4H Fact Sheet 20
OC 4H Fact Sheet 20
Tim Pehlke
 
Organisational Development Paper Sascha Michel
Organisational Development Paper Sascha MichelOrganisational Development Paper Sascha Michel
Organisational Development Paper Sascha Michel
Sascha Michel
 

Viewers also liked (11)

SSC Marksheet
SSC MarksheetSSC Marksheet
SSC Marksheet
 
Beauty barometer cv-2015
Beauty barometer cv-2015Beauty barometer cv-2015
Beauty barometer cv-2015
 
Plaquette de présentation
Plaquette de présentationPlaquette de présentation
Plaquette de présentation
 
OC 4H Fact Sheet 20
OC 4H Fact Sheet 20OC 4H Fact Sheet 20
OC 4H Fact Sheet 20
 
Data analytics and SEO to grow your international business | John Caldwell | ...
Data analytics and SEO to grow your international business | John Caldwell | ...Data analytics and SEO to grow your international business | John Caldwell | ...
Data analytics and SEO to grow your international business | John Caldwell | ...
 
Maxima Experiential Marketing India Pvt Ltd
Maxima Experiential Marketing India Pvt LtdMaxima Experiential Marketing India Pvt Ltd
Maxima Experiential Marketing India Pvt Ltd
 
Organisational Development Paper Sascha Michel
Organisational Development Paper Sascha MichelOrganisational Development Paper Sascha Michel
Organisational Development Paper Sascha Michel
 
Réseaux Sociaux et Stratégie BtoB
Réseaux Sociaux et Stratégie BtoBRéseaux Sociaux et Stratégie BtoB
Réseaux Sociaux et Stratégie BtoB
 
Branding From Below: costruire brand di successo
Branding From Below: costruire brand di successo Branding From Below: costruire brand di successo
Branding From Below: costruire brand di successo
 
Anypoint Studio Visual Overhaul
Anypoint Studio Visual OverhaulAnypoint Studio Visual Overhaul
Anypoint Studio Visual Overhaul
 
Les stratégies Médias sociaux dans un contexte BtoB d’affaires
Les stratégies Médias sociaux dans un contexte BtoB d’affairesLes stratégies Médias sociaux dans un contexte BtoB d’affaires
Les stratégies Médias sociaux dans un contexte BtoB d’affaires
 

Similar to AJAX for Scalability

Tips for a Faster Website
Tips for a Faster WebsiteTips for a Faster Website
Tips for a Faster Website
Rayed Alrashed
 
How to build CDN for your website
How to build CDN for your websiteHow to build CDN for your website
How to build CDN for your website
Martin Kulov
 

Similar to AJAX for Scalability (20)

Scale Your Application while Improving Performance and Lowering Costs (SVC203...
Scale Your Application while Improving Performance and Lowering Costs (SVC203...Scale Your Application while Improving Performance and Lowering Costs (SVC203...
Scale Your Application while Improving Performance and Lowering Costs (SVC203...
 
Tips for a Faster Website
Tips for a Faster WebsiteTips for a Faster Website
Tips for a Faster Website
 
I Can Haz More Performanz?
I Can Haz More Performanz?I Can Haz More Performanz?
I Can Haz More Performanz?
 
Shopzilla - Performance By Design
Shopzilla - Performance By DesignShopzilla - Performance By Design
Shopzilla - Performance By Design
 
Jax Ajax Architecture
Jax Ajax  ArchitectureJax Ajax  Architecture
Jax Ajax Architecture
 
How to build CDN for your website
How to build CDN for your websiteHow to build CDN for your website
How to build CDN for your website
 
Template tuning for high performance
Template tuning for high performanceTemplate tuning for high performance
Template tuning for high performance
 
Performance engineering
Performance engineeringPerformance engineering
Performance engineering
 
IWMW 2003: C7 Bandwidth Management Techniques: Technical And Policy Issues
IWMW 2003: C7 Bandwidth Management Techniques: Technical And Policy IssuesIWMW 2003: C7 Bandwidth Management Techniques: Technical And Policy Issues
IWMW 2003: C7 Bandwidth Management Techniques: Technical And Policy Issues
 
5 critical-optimizations.v2
5 critical-optimizations.v25 critical-optimizations.v2
5 critical-optimizations.v2
 
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
 
Cdn
CdnCdn
Cdn
 
Magento Performance Improvements with Client Side Optimizations
Magento Performance Improvements with Client Side OptimizationsMagento Performance Improvements with Client Side Optimizations
Magento Performance Improvements with Client Side Optimizations
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
 
Oracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance TuningOracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance Tuning
 
AWS Pop-up Loft Berlin: Cache is King - Running Lean Architectures: Optimizin...
AWS Pop-up Loft Berlin: Cache is King - Running Lean Architectures: Optimizin...AWS Pop-up Loft Berlin: Cache is King - Running Lean Architectures: Optimizin...
AWS Pop-up Loft Berlin: Cache is King - Running Lean Architectures: Optimizin...
 
AWS Summit London 2014 | Dynamic Content Acceleration (300)
AWS Summit London 2014 | Dynamic Content Acceleration (300)AWS Summit London 2014 | Dynamic Content Acceleration (300)
AWS Summit London 2014 | Dynamic Content Acceleration (300)
 
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
 
Ajax
AjaxAjax
Ajax
 
Client Side Performance @ Xero
Client Side Performance @ XeroClient Side Performance @ Xero
Client Side Performance @ Xero
 

More from Tuenti

Tuenti - de la idea a la web
Tuenti -  de la idea a la webTuenti -  de la idea a la web
Tuenti - de la idea a la web
Tuenti
 
Tuenti release process
Tuenti release processTuenti release process
Tuenti release process
Tuenti
 
DTS s03e02 Handling the code
DTS s03e02 Handling the codeDTS s03e02 Handling the code
DTS s03e02 Handling the code
Tuenti
 
Tuenti Tech Teams. Frontend, Backend, Systems and more, working together
Tuenti Tech Teams. Frontend, Backend, Systems and more, working togetherTuenti Tech Teams. Frontend, Backend, Systems and more, working together
Tuenti Tech Teams. Frontend, Backend, Systems and more, working together
Tuenti
 

More from Tuenti (11)

Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1
 
Tu: Telco 2.0 at FICOD 2011
Tu: Telco 2.0 at FICOD 2011Tu: Telco 2.0 at FICOD 2011
Tu: Telco 2.0 at FICOD 2011
 
Tuenti - de la idea a la web
Tuenti -  de la idea a la webTuenti -  de la idea a la web
Tuenti - de la idea a la web
 
Tuenti Mobile Development
Tuenti Mobile DevelopmentTuenti Mobile Development
Tuenti Mobile Development
 
Tuenti: Web Application Security
Tuenti: Web Application SecurityTuenti: Web Application Security
Tuenti: Web Application Security
 
Tuenti Release Workflow
Tuenti Release WorkflowTuenti Release Workflow
Tuenti Release Workflow
 
Tuenti release process
Tuenti release processTuenti release process
Tuenti release process
 
Tuenti - tu entidad
Tuenti -  tu entidadTuenti -  tu entidad
Tuenti - tu entidad
 
DTS s03e02 Handling the code
DTS s03e02 Handling the codeDTS s03e02 Handling the code
DTS s03e02 Handling the code
 
DTS s03e04 Typing
DTS s03e04 TypingDTS s03e04 Typing
DTS s03e04 Typing
 
Tuenti Tech Teams. Frontend, Backend, Systems and more, working together
Tuenti Tech Teams. Frontend, Backend, Systems and more, working togetherTuenti Tech Teams. Frontend, Backend, Systems and more, working together
Tuenti Tech Teams. Frontend, Backend, Systems and more, working together
 

AJAX for Scalability

  • 1. AJAX for ScalabilityErik SchultinkPHP Barcelona – 30 Oct, 2009
  • 2. AJAX What is AJAX? “Asynchronous JavaScript and XML” Paradigm for client-server interaction Change state on client, without loading a complete HTML page
  • 3. Traditional HTML Browsing User clicks link Browser sends request Server receives, parses request, generates response Browser receives response and begins rendering Dependent objects (images, js, css) load and render Page appears
  • 4. AJAX Browsing User clicks link Browser sends request Server receives, parses request, generates response Browser receives response and begins rendering Dependent objects (images, js, css) load and render Page appears
  • 5. Why Asynchronous? Not always necessary to wait for server response Most of response is predictable
  • 6. Scalability? Through-put, not speed Ideally, capacity is linear function of machines In practice, linear below some boundary
  • 8. Tuenti.com Started 2007 More than 20 billion pageviews/month More than 20k/second at peak Based in Madrid ~80 employees, 40 engineers
  • 9. How does Tuenti use AJAX? Only pageloads are login and home page Loader pulls in all JS/CSS Afterwards stay within one HTML page, rotating canvas area content
  • 10. How does Tuenti use AJAX? PHOTO UPLOAD
  • 11. How does Tuenti use AJAX? CHAT
  • 12. How does Tuenti use AJAX? CHAT
  • 13. How does Tuenti use AJAX?
  • 14. How does Tuenti use AJAX?
  • 15. Traditional Systems Architecture www.tuenti.com Load Balancer Web server farm Web server farm Web server farm
  • 16. Traditional Systems Architecture www.tuenti.com 12.45.34.179 12.45.34.178 Load Balancer Load Balancer Web server farm Web server farm Web server farm Web server farm
  • 17. Client-side Routing www.tuenti.com wwwb3.tuenti.com wwwb2.tuenti.com wwwb1.tuenti.com wwwb4.tuenti.com Load Balancer Load Balancer Load Balancer Load Balancer Web server farm Web server farm Web server farm Web server farm Linearly scalable …
  • 18. Client-side Routing www.tuenti.com wwwb3.tuenti.com wwwb2.tuenti.com wwwb1.tuenti.com wwwb4.tuenti.com Load Balancer Load Balancer Load Balancer Load Balancer Web server farm Web server farm Web server farm Web server farm Linearly scalable … except for top level
  • 19. Client-side Routing www.tuenti.com wwwb3.tuenti.com wwwb2.tuenti.com wwwb1.tuenti.com wwwb4.tuenti.com Load Balancer Load Balancer Load Balancer Load Balancer Web server farm Web server farm Web server farm Web server farm lots of content creation = lots of dynamic data
  • 20. Client-side Routing www.tuenti.com wwwb3.tuenti.com wwwb2.tuenti.com wwwb1.tuenti.com wwwb4.tuenti.com Load Balancer Load Balancer Load Balancer Load Balancer Web server farm Web server farm Web server farm Web server farm Cache Farm lots of dynamic data = lots of cache = internal network traffic
  • 21. Client-side Routing www.tuenti.com wwwb3.tuenti.com wwwb2.tuenti.com wwwb1.tuenti.com wwwb4.tuenti.com Load Balancer Load Balancer Load Balancer Load Balancer Web server farm Web server farm Web server farm Web server farm Cache Farm Cache Farm Cache Farm Cache Farm Partition cache Route requests to a farm near cache needed to respond
  • 23. Balancing Load Top-level requests to www.tuenti.com Each request tells client which farm it should be using, based on a mapping Mapping can be changed to balance load, perform maintenance, etc
  • 24. Robust Browsing Don’t tightly couple layers Client and server are separate layers
  • 25. Robust Browsing Client-side code should be robust against server-side failures What can go wrong? Client loses connectivity Server-side error Web server overloaded Entire server farm overloaded Server farm loses connectivity
  • 26. Robust Browsing Options: Retry (carefully) Switch to alternate farm (carefully) Detect error, give user feedback
  • 27. Caching Think like server-side scalability Cache data that is likely to be requested in the future Doesn’t have consistency issues Doesn’t change
  • 28. Cache Data in Client Browser More responsive for user Fewer requests to your servers
  • 29. Some details Lots of dependencies to load initially Loading can be brittle and slow Browser performance
  • 30. Some details Beware of external libraries Google JS lib are not static, not indefinitely cacheable
  • 31. Some details Friends do have consistency issues Add/remove friends Change avatar (rare)
  • 32. Image Serving Tuenti serves ~2.5 billion images/day At peak, this is >6 Gbps and >70k hits/sec We use CDNs
  • 33. What is a CDN? Content Delivery Network
  • 34. What is a CDN? Examples: Akamai, Limelight also dozens more, including Amazon Big distributed, object cache Pay per use either per request, per TB transfer, or per peak Mbps
  • 35. What is a CDN? Advantages: Outsource dev and infrastructure Geographically distributed Economies of scale Disadvantages: High cost Less control and transparency Commitments
  • 36. What affects image load time? Client internet connection Response time of CDN CDN cache hit rate Response time of Origin
  • 37. What affects image load time? Client internet connection Response time of CDN CDN cache hit rate Response time of Origin
  • 38.
  • 39. Monitor Performance from Client Closer to performance experienced by end-user Only way to get view of network issues faced by users (ie last mile)
  • 40.
  • 41. Good Monitoring Percentiles > averages Less noise, more stable Comparable to SLA terms Establish baselines performance relative to past more important than absolute Avoid false positives
  • 42. How to fix slow ISP? Choose better transit provider Set-up peering (or get CDN too) Traffic management
  • 43. What affects image load time? Client internet connection Response time of CDN CDN cache hit rate Response time of Origin
  • 44.
  • 45.
  • 46. Quality of End-User Experience vs. Cost
  • 47. We use multiple CDNs, and shift content based on price/performance.
  • 51. Know your content 30 75 200
  • 55. Pre-fetch Content Exploit predictable user behavior Ex: clicking to next photo in an album Simple solution – load next image hidden Client browser will cache it (next response < 100 ms) Increase tolerance for slow response time
  • 56. Pre-fetch Content More complex solution Pre-fetch next canvas (full html), render in background – rotate in on Next Even more complex Instantiate HTML template w/ data on client Pre-fetch data X photos in advance, render Y templates in advance with this data
  • 57. Pre-fetch Content Problems: Rendering still takes time Increases browser load Need to set cache headers correctly
  • 58. Image delivery Small images: High request, low volume Most cost-effective to cache in memory Large images: High volume, low requests, greater tolerance for latency
  • 59. What affects image load time? Client internet connection Response time of CDN CDN cache hit rate Response time of Origin
  • 60. Monitor Performance from Client cold servers online
  • 61. What affects image load time? Client internet connection Response time of CDN CDN cache hit rate Response time of Origin
  • 62. Deploy cache layers (squid, varnish) Optimize web servers for static content delivery More machines Avoid RAID, file system Improve Origin Response
  • 63. Summary Cache and pre-fetch content Client-side routing Client-side monitoring
  • 64. General caveats Be careful with browser performance Look carefully at what’s in the worst 5% Don’t assume that high values are incorrect
  • 65. More jobs.tuenti.com Presentation Saturday 14:20 Challenge (win a PS3) Talk: Continuous Integration DavideMendolia, Saturday 12:00
  • 68. Q & A

Editor's Notes

  1. JavaScript and XML are just technologies; “Asynchronous” is what’s important – the shift in thinking from web browsing as serial page by page to more fluid navigation that’s wholly contained within the same HTML page. I’m not going to go much into implementation, etc – it’s a lot of detail, and talking about cross-browser compatibility isn’t so fun or interesting. Focus on approaches – what we’ve learned from scaling on the server side can be applied to client side.
  2. Using AJAX in application design, allows 1-6 to collapse a bit
  3. Using AJAX in application design, allows 1-6 to collapse a bit
  4. ComScore numbers show that we have more traffic than all Google properties combined. ComScore estimates 1 in 6 web pages viewed in Spain is from Tuenti. ComScore numbers are lower than our internal measurements.
  5. Consider breaking into slides that illustrate this process
  6. Not just well structure
  7. Not just well structure
  8. Not just well structure
  9. Not just well structure
  10. Not just well structure
  11. Not just well structure
  12. Not just well structure
  13. Competitive market – only 2 (Akamai and Limelight) are financially very healthy – and Limelight is losing money if you consider investments