12
Architectural Decisions Serving the Thundering Herd Supreet Sethi @djinn

[Srijan Wednesday Webinars] Architectural Decisions: Serving the Thundering Herd

Embed Size (px)

Citation preview

Page 1: [Srijan Wednesday Webinars] Architectural Decisions: Serving the Thundering Herd

Architectural DecisionsServing the Thundering Herd

Supreet Sethi @djinn

Page 2: [Srijan Wednesday Webinars] Architectural Decisions: Serving the Thundering Herd

We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil- Donald Knuth

Page 3: [Srijan Wednesday Webinars] Architectural Decisions: Serving the Thundering Herd

Stats

l 28000 requests per minutel Page load of 7s including imagesl 14th most visited site in India

Page 4: [Srijan Wednesday Webinars] Architectural Decisions: Serving the Thundering Herd

Sizing and planning

lPlan forlnetworkltraffic split on different pageslIOPSlCPU/RAMlUnderstand the beast

Page 5: [Srijan Wednesday Webinars] Architectural Decisions: Serving the Thundering Herd

Toolset and Services

lMemcachelRedislMCRouterlMessage Queues (AMQP, Kafka)lVarnishlAWS ServiceslCDNslCouchBaselAerospike

Page 6: [Srijan Wednesday Webinars] Architectural Decisions: Serving the Thundering Herd

All site features are not used equally

Discover services on top of the funnel and optimize first

lJabong funnel viewlHome pagelCatalog PagelProduct pagel80% of traffic gravitates to these pages

Following structured design changes

will optimize key pages on top of the funnel. It will contribute also in speeding other pages by reducing resource consumption.

Speed - relation to funnel

Page 7: [Srijan Wednesday Webinars] Architectural Decisions: Serving the Thundering Herd

Programming Strategy

lDefine bottlenecklFind candidate solutions

lTest each candidate one at a timelDeploy in productionlRinse and Repeat

Page 8: [Srijan Wednesday Webinars] Architectural Decisions: Serving the Thundering Herd

Unit Testing

lClear plan to test every piece of platformlSeparating web-handler from business LogiclTesting with and without web-handlersl Abstract Request and Response interfaces very useful

Page 9: [Srijan Wednesday Webinars] Architectural Decisions: Serving the Thundering Herd

Staging and Deployment

lLog capture on load balancelReplay the logs on staging server for load testlFormal verification of code

Page 10: [Srijan Wednesday Webinars] Architectural Decisions: Serving the Thundering Herd

Lessons Learnt

lThings will fail.lScale surfaces bugs.l Key to success is understanding what the system is actually doing. Know if your system is in a healthy state or about to crash.l Have a strategy

Page 11: [Srijan Wednesday Webinars] Architectural Decisions: Serving the Thundering Herd

Lessons Learnt …

lMake it work.lMake it visible.lMake it DevOps.

Page 12: [Srijan Wednesday Webinars] Architectural Decisions: Serving the Thundering Herd

Supreet Sethi@djinn

Thank You!