Talk Nerdy to Me: Optimizing big websites

2,145 views
1,747 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,145
On SlideShare
0
From Embeds
0
Number of Embeds
23
Actions
Shares
0
Downloads
16
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Talk Nerdy to Me: Optimizing big websites

  1. Optimizing big websites Talk Nerdy to Me December 8th, 2010 Andreas Creten
  2. Hi, I’m Andreas
  3. We are madewithlove, so are our products.
  4.  
  5. Big websites
  6.  
  7.  
  8. Efficient? I don’t think so
  9. wireframes back-end design support front-end hosting concept
  10. Concept Realistic?
  11. Wireframes Not to complex? How many information do we need to show?
  12. Design Fast vs. fancy
  13. Front-end Requests and Kb’s
  14. Framework
  15. Sprites
  16.  
  17.  
  18.  
  19.  
  20. Compress, merge, minify
  21.  
  22.  
  23. 336 Bytes 133 Bytes
  24. Avoid external requests
  25. Back-end Execution time
  26. Less is more
  27. Keep it simple
  28. Caching Performing a lot of queries on a database server might overload it, especially when a lot of users are using the application. Server Can you give me an overview of all our clients? Yeah, sure! I’ll load them from the database. Pff, I’ll get me a coffee in meanwhile. Database Dude, calm down, I’m still getting the first one! Database, can you give me client 1? Database, can you give me client 2? Database, can you give me client 3? Database, can you give me client 4? Database, can you give me client 5? Database, can you give me client 6? It’s getting hot in here The database gets overloaded
  29. Caching By storing the results from the database in a temporary in-memory cache we reduce the number of database request and decrease the page load time. Server Can you give me an overview of all our clients? Yeah, sure! I’ll check if I can remember them, otherwise I’ll load them from the database. Wow, I’ll have to call my secretary to bring some coffee. Database Database, can you give me client 4? Database, can you give me client 6? I’m bored Client 1 Client 2 Client 3 Client 5 Client 6 Client 4
  30. Background workers When a user performs a server intensive action it might slow down the whole server. By executing the tasks in the background we off-load the server. Ex: the user request a zip file of all the photos he uploaded.
  31. Background workers When a user performs a server intensive action it might slow down the whole server. By executing the tasks in the background we off-load the server. Server Can you send me all my photo’s in a zip archive? Yeah, sure! But it might take a while. Dude, this takes for hours! And the site is super slow now! I told you. I can’t do everything at once.
  32. Background workers When a user performs a server intensive action it might slow down the whole server. By executing the tasks in the background we off-load the server. Server Can you send me all my photo’s in a zip archive? Yeah, sure! I’ll send it to a worker, come back in 10 mins. Hey, thanks, that was fast! Worker Ok, I’ll do it straight away I’m ready, that was an easy one!
  33. Review your code
  34. Hosting Scalability
  35. Fine-tuning
  36. Clusters When a user logs in, a session file is created on the server. This file us used as a temporary store. Ex: it enables us to keep a user logged in while browsing a site.
  37. Cluster support The first time a user opens a site we store a session cookie containing his session id. When they navigate to the next page they send us the session id and we know which session to load. Server Session 3 Session 2 Session 1 I want to see my account page Cool, who are you? I’m that guy from Session 1 Ok, there you go!
  38. Cluster support On a cluster the users are send to servers based on the server load. Server Server Load balancer I want to see my account page Ok, you can do it. Hey, I’ve nothing to do!
  39. Cluster support So their next request might get handled by another server Server Server Load balancer I want to see the homepage page Ok, you can do it. Hey, I’ve nothing to do!
  40. Cluster support Since the sessions are stored on the server, the second server doesn’t know about the user’s session. Server Server Load balancer I want to see my account page What’s your session id? Session 1 My session has id 1 Hmm, I don’t know about that session
  41. Cluster support Since the sessions are stored on the server, the second server doesn’t know about the user’s session. Server Server Load balancer I want to see my account page Session 1 Hmm, I don’t know about that session The second server is not aware of the session on the first one
  42. Cluster support We solve this problem by storing the sessions into a central database. Database Server Server Load balancer I want to see my account page What’s your session id? My session has id 1 Let me check for that session in the database There you go Session 1
  43. Hosted vs. Managed vs. Cloud vs. In-house
  44. Reverse-proxy caching
  45. 3th party services
  46. Team/company Picking the right people
  47. wireframes back-end design support front-end hosting concept
  48. Interns To do the impossible
  49.  
  50.  
  51.  
  52.  
  53. Thanks. Any questions? [email_address] - @andreascreten
  54.  

×