Who's online, how they're using the Web, and what they're accessing have changed significantly over the last few years. All these factors are straining websites, and their outdated architectures. This presentation covers these changes by the numbers and looks at the emergence of a Web scale architecture that takes advantage of Memcached to improve performance and scalability of today's dynamic websites. The recorded webinar is now available at: http://bit.ly/aPe2T.
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Memcached and the Rise of the Dynamic Web
1. Presented by:
Bill Takacs – Director, Product Management
September 2009
2. Agenda
•!Rise of the dynamic web!
•!The web architecture!
•!The evolution of a dynamic site and Memcached!
•!Gear6 solution!
2 : Copyright 2009 Gear6 Inc.
3. The Web: What’s Changed?
•!Population!
•!Tra"c!
•!Content and applications!
3 : Copyright 2009 Gear6 Inc.
4. Web Growth: Population
Forrester: 2.2 billion people online globally by 2013
4 : Copyright 2009 Gear6 Inc.
5. Web Growth: Traffic
Cisco: “Annual global IP traffic
will exceed two-thirds of a zettabyte
(667 exabytes) in four years”
[by 2013]
Source: Cisco Visual Networking Index,
9 June 2009
5 : Copyright 2009 Gear6 Inc.
6. Web Growth: Application & Content
Entertainment
!
Social Networking!
Media
!
Communication
!
Community-generated content
!
6 : Copyright 2009 Gear6 Inc.
8. Web Architecture
!! Most sites (over 65%) based on LAMP or JAVA
!! Industry standard servers replaced proprietary SMP
!! Shift to Dynamic Content puts strain on origin sites
Web Stack Net
Interface
Storage Clients
PHP, Java, Rails, C,
Database!
Internet
Apache, Nginx,
Servers!
Servers#
Perl, Python!
PostgreSQL !
Lighttpd!
MySQL,
Web
App
Proxy
CDN!
Load
Balancer
8 : Copyright 2009 Gear6 Inc.
10. New Caching Architecture
for Scaling Out
Web Stack Net
Interface
Storage Clients
PHP, Java, Rails, C,
Database!
Internet
Apache, Nginx,
Servers!
Servers#
Perl, Python!
PostgreSQL !
Lighttpd!
MySQL,
Web
App
Proxy
CDN!
Load
Balancer
Cache Servers
memcached
10 : Copyright 2009 Gear6 Inc.
11. Memcached: Pillar of Web 2.0 Architecture
“Everything runs#
from memory#
in Web 2.0”
!
Evan Weaver, Twitter, March 2009!
11 : Copyright 2009 Gear6 Inc.
12. The Fix: Memcached
“A high performance, distributed memory object
caching system, generic in nature, but intended for
use in speeding up dynamic web applications by
alleviating database load”!
•! Big hash table!
•! Created by Danga Interactive for LiveJournal!
•! Significantly reduced database load!
•! Perfect for web sites with high database load!
•! In use by Facebook, Twitter, MyYearbook, others!
12 : Copyright 2009 Gear6 Inc.
13. Evolution of a Dynamic Site #1
A day in the life of a growing web service
•! Event: Site has growth in number of users/sessions/page
views/apps causing excessive read load on DB!
•! Action: Replicate Database (and/or add more app servers)!
App Server App Server App Server
App Server App Server App Server App Server App Server App Server
write!
write! write!
…
MySQL MySQL
MySQL
13 : Copyright 2009 Gear6 Inc.
14. Evolution of a Dynamic Site #2
A day in the life of a growing web service
•! Event: Individual caches on the app/db servers are
overwhelmed from chaotic/non-deterministic content access!
•! Action: Add memcached server on servers with underutilized
memory resources… results in even fewer reads to database!
memcached memcached memcached
App Server App Server App Server App Server App Server App Server
memcached memcached memcached
App Server App Server App Server
App Server App Server App Server
write! write! write! write!
… …
MySQL MySQL MySQL MySQL
14 : Copyright 2009 Gear6 Inc.
15. Evolution of a Dynamic Site #3
A day in the life of a growing web service
•! Event: Memcached needs more memory resources than
what is available on other (shared) servers!
•! Action: Move memcached servers to dedicated servers!
memcached memcached memcached
App Server App Server App Server App Server App Server App Server
memcached memcached memcached
App Server App Server App Server App Server App Server App Server
memcached memcached … memcached
write! write! write! write!
… …
MySQL MySQL MySQL MySQL
15 : Copyright 2009 Gear6 Inc.
16. What Memcached is NOT:
A persistent data store!
A database!
Application-specific!
A large object cache!
Fault-tolerant or highly available!
16 : Copyright 2009 Gear6 Inc.
17. Memcached: Best Practices
•!Use with MySQL :-)! •!Careful with
•!Use on 64-bit numbers of
servers! connections!
•!Cache “expensive »! Peak!
operations”! »! Transitions!
•!Cache bi- •!Evictions!
directionally (R/W)! »! Segment Memcached
data into separate pools
!
•!Design to withstand
•!Optimize sizing:
failures gracefully!
Instances and pools!
•!Use consistent
•!Instrumentation!
hashing!
17 : Copyright 2009 Gear6 Inc.
18. Memcache Use Cases
Site Type Repeatable Use
Social networking Profile caching
Content aggregation HTML/page caching
Ad targeting Cookie/profile tracking
Gaming and entertainment Session caching
Location-based services DB query scaling
Relationship Session caching
E-commerce Session and HTML caching
18 : Copyright 2009 Gear6 Inc.
19. Use Case Example:
Session Management
•! 4m+ daily visitors!
•! 15k hits/sec!
•! 6k updates/sec!
•! Tens of thousands
concurrent connections!
•! Session tracked and ads
are placed in accordance
to session!
19 : Copyright 2009 Gear6 Inc.
20. Use Case Example:
User Targeting Engine
Recommendations on
User webpages
User Targeting Service
User Targeting Service
Memcached
User Targeting Service
Thin/fast memcache
pool!
Client layer memcache
Thin/fast (reads)
Client layer memcache
Thin/fast (reads)
Client layer (reads)
Update processing
Webserver / php (writes)
Update processing Bulk/batch
Load Balancer (writes) updates
Update processing
Load Balancer
Load Balancer (writes)
Hadoop!
“Lazy” Updates
Map/Reduce Jobs
Data processing
User targeting data
From logs and other User profile updates
systems
Reports! Ad-Hoc Analysis
Memcache repopulation
(bulk updates, recovery)
20 : Copyright 2009 Gear6 Inc.
21. Useful Memcached Tools
advanced reporter!
Track hot keys and clients in Memcached!
wireshark!
Dissect and analyze Memcached network tra"c!
brutis!
Size and test changes to memcache clusters!
statsproxy!
View bu$ered Memcached stats in your browser!
cacti!
Graph and analyze Memcached statistics!
21 : Copyright 2009 Gear6 Inc.
22. Statsproxy + Cacti Templates
To use the cacti
templates for
memcached with
statsproxy, you
either need to
modify the
templates to use
port 8080 or
change the
statsproxy config to
use port 11211
22 : Copyright 2009 Gear6 Inc.
23. •! First and leading provider#
of Memcached solutions!
•! Memcached solution including!
•! High density!
•! High Availability!
•! Advanced memory#
management!
•! Enhanced reporting#
capabilities !
•! Support for multi-tenancy!
•! Disruption free#
software upgrades!
•! 100% client compatible!
23 : Copyright 2009 Gear6 Inc.
24. Questions?
Thank you for attending our webinar
!
“Memcached and the Rise of the New Dynamic Web”!
and please visit our web site at:
!
www.gear6.com!
24 : Copyright 2009 Gear6 Inc.