56
Life on the Edge with ESI Kit Chan ([email protected] ) Custom Branded Experiences Yahoo!

Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Life on the Edge with ESI Kit Chan ([email protected])

Custom Branded Experiences Yahoo!

Page 2: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

World Cup Penalty Shootout

Page 3: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Royal Wedding

Page 4: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Cybergeddon

Page 5: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Life on the Edge

Source: http://img.shockblast.net/2012/01/ShockBlast-4-803109.jpg

Page 6: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Agenda

  Introduction  Use Cases   Performance Characteristics   Future  Q&A

Page 7: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Agenda

  Introduction  Use Cases   Performance Characteristics   Future  Q&A

Page 8: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Edge Computing/CDN Source: http://www.excitingip.com/wp-content/uploads/2011/01/contentdeliverynetworkblockdiagram.jpeg

Page 9: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Edge Computing in Yahoo!

- Pages: avg 120K req/s, 16% cache ratio - Assets: avg 20Gb/s, 95% cache ratio

User Location Latency - 100K file in US Through Y! Edge California, USA 0.2s 0.02s Singapore 2s 0.02s Korea 1.3s 0.02s Ireland 1.2s 0.2s Switzerland 1.0s 0.2s

Page 10: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Edge Computing in Yahoo!

- Pages: avg 120K req/s, 16% cache ratio - Assets: avg 20Gb/s, 95% cache ratio

User Location Latency - 100K file in US Through Y! Edge California, USA 0.2s 0.02s Singapore 2s 0.02s Korea 1.3s 0.02s Ireland 1.2s 0.2s Switzerland 1.0s 0.2s

Page 11: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

ESI can help!

Page 12: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

ESI Support in Proxy Server – Proven & Popular

Page 13: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

ESI Support in Proxy Software – New or Unproven

Page 14: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

ESI Support in CDN Vendor

Page 15: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Agenda

  Introduction  Use Cases   Performance Characteristics   Future  Q&A

Page 16: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Use Case 1 - Content Assembly

 Markup in Response <esi:include src=http://xyz.com/content.html/>

Page 17: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Content Assembly – Error Handling

 Can handle response error and timeout <esi:try><esi:attempt> <esi:include src=http://xyz.com/content.html/ > </esi:attempt><esi:except> Sorry there is an error! </esi:except></esi:try>

Page 18: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Content Assembly

Page 19: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Content Assembly

Page 20: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Content Assembly

Page 21: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Content Assembly

Page 22: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Why? Performance! No server cache + No ESI

Server cache + No ESI

YTS Cache + ESI modules

Scenario

Origin Server Handling Full Page requests each time and executing every module every time.

Origin Server handling full page requests, only executing non cacheable modules

Origin Server only serving requests for non cacheable modules

FE throughput per box

45 queries per second

140 queries per second

190 queries per second

Server latency 900 ms per request 80 ms per page 55 ms per page

Page 23: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

More on Availability

 Why it goes down? - Releases - Outage  How ESI Help? - Template cached - Fallback for each ESI module

Page 24: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Why? Legacy Module Support

Page 25: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Use Case 2 - Automatic Fallback

 “Always On” - 100% availability for “existing” pages  Serve static pages when origin servers are down or too slow

 No change needed on origin servers

Page 26: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Automatic Fallback

26

Page 27: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Automatic Fallback

Page 28: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Automatic Fallback

Page 29: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Automatic Fallback

Page 30: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Automatic Fallback – Subsequent Request

Page 31: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Automatic Fallback – Subsequent Request

Page 32: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Automatic Fallback – Subsequent Request

Page 33: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Use Case 3 - Timely Launch

Page 34: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Before Launch

Page 35: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

After Launch

Page 36: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Timely Launch – Before Launch

36 Confidential

Page 37: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Timely Launch – Before Launch

Page 38: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Timely Launch – After Launch

Page 39: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Timely Launch – After Launch

Page 40: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Conclusion - Usage Pattern

Client Proxy Server/

CDN

ESI Service

Origin Server for ESI Include

Page 41: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Agenda

  Introduction  Use Cases   Performance Characteristics   Future  Q&A

Page 42: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Concurrent Requests

Page 43: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

First Byte Flush

Page 44: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

ESI Support in Varnish

 No concurrent requests for includes  First Byte Flush Support

Page 45: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

ESI Support in Apache Traffic Server

 Concurrent requests for includes  No First Byte Flush Support (Coming soon)

Page 46: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Agenda

  Introduction  Use Cases   Performance Characteristics   Future  Q&A

Page 47: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Future

 The spec (ESI 1.0) is published over 10 years ago. - W3C spec - Editor - Mark Nottingham from Akamai

Mark Nottingham http://www.mnot.net/

Page 48: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Future – Manipulating Requests/Responses

Client Proxy Server Supporting

ESI

Origin Server returing ESI Document

Origin Server for ESI Include

Page 49: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Future – Manipulating Requests/Responses

Client Proxy Server Supporting

ESI

Origin Server returing ESI Document

Origin Server for ESI Include

Final response header to user can be changed

Page 50: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Future – Manipulating Requests/Responses

Client Proxy Server Supporting

ESI

Origin Server returing ESI Document

Origin Server for ESI Include

Final response header to user can be changed

Request Header, method, timeout can be changed for includes

Page 51: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Future – Manipulating Requests/Responses

Client Proxy Server Supporting

ESI

Origin Server returing ESI Document

Origin Server for ESI Include

Request/Response Header can be retrieved as variables

Final response header to user can be changed

Request Header, method, timeout can be changed for includes

Page 52: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Future – Smart Assembly

One request for multiple includes (e.g. one Ad call fetching multiple ad position)

Page 53: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Future – More Use cases

 Device Detection  Bucket Testing

http://illusionmedia.com/wp-content/uploads/2012/03/mobileDevices1-300x200.jpg

https://doazrm3qeh7n2.cloudfront.net/images/features/quick-a-vs-b-testing.jpg

Page 54: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Agenda

  Introduction  Use Cases   Performance Characteristics   Future  Q&A

Page 55: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Q & A

谢谢 [email protected]

Page 56: Velocity china2012kit life on edge —— 如何使用 esi 完成任务

Reference   ESI Language Specification – http://www.w3.org/TR/esi-lang   Edge Architecture Specification - http://www.w3.org/TR/edge-arch   ATS ESI plugin -

https://github.com/apache/trafficserver/blob/master/plugins/experimental/esi/README   Varnish ESI - https://www.varnish-cache.org/docs/3.0/tutorial/esi.html   Akamai ESI - http://www.akamai.com/dl/technical_publications/akamai_esi_extensions.pdf   F5 -

http://support.f5.com/kb/en-us/products/wa/manuals/product/wa9_4policy/WA_Policy_9_4-19-1.html