Presentation is loading. Please wait.

Presentation is loading. Please wait.

Key Algorithms in a Content Delivery System Akamai Technologies and Carnegie Mellon University Bruce Maggs.

Similar presentations


Presentation on theme: "Key Algorithms in a Content Delivery System Akamai Technologies and Carnegie Mellon University Bruce Maggs."— Presentation transcript:

1 Key Algorithms in a Content Delivery System Akamai Technologies and Carnegie Mellon University Bruce Maggs

2 Akamai Services and Products http://www.google.com www.google.com http://www.yahoo.com www.yahoo.com http://windowsupdate.microsoft.com/ windowsupdate.microsoft.com/ http://www.apple.com/quicktime/qtv/mwsf04/ www.apple.com/quicktime/qtv/mwsf04/ http://www.protectedsite.gov www.protectedsite.gov

3 Embedded Image Delivery (e.g., Yahoo!) <html><head> Welcome to xyz.com! Welcome to xyz.com! </head><body> <img src=“ Welcome to our Web site! Welcome to our Web site! Click here to enter Click here to enter </body></html> http://www.xyz.com/logos/logo.gif”> http://www.xyz.com/jpgs/navbar1.jpg”> Embedded URLs are Converted to ARLs ak

4 End User Akamai DNS Resolution Akamai High-Level DNS Servers 10 g.akamai.net 1 Browser’s Cache OS 2 Local Name Server 3 xyz.com’s nameserver 6 ak.xyz.com 7 a212.g.akamai.net 9 15.15.125.6 16 15 11 20.20.123.55 Akamai Low-Level DNS Servers 12 a212.g.akamai.net 30.30.123.5 13 14 4 xyz.com.com.net Root (InterNIC) 10.10.123.55 akamai.net8 select cluster select servers within cluster

5 Three Algorithms Consistent hashingConsistent hashing Leader electionLeader election Stable marriage with tree constraintsStable marriage with tree constraints

6 Hashing E.g., h(x) = (((a x + b) mod P) mod |B|), where P is prime, P > |U| a,b chosen uniformly at random from Z P x is a serial number Universe U of all possible objects, set B of buckets. object: set of web objects with same serial number bucket: web server Hash function h: U  B Assigns objects to buckets

7 f(d) = d + 1 mod 5 Difficulty changing number of buckets 5 7 10 11 27 29 36 38 40 43 4321043210 bucket object f(d) = d + 1 mod 4

8 Consistent Hashing Idea: Map both objects and buckets to unit circle. object bucket Assign object to next bucket on circle in clockwise order. new bucket

9 Complication – Different Views select servers within cluster Low-level DNS servers act independently and may have different ideas about how many and which servers are alive. a212.g.akamai.net Akamai Low-Level DNS Servers 12 30.30.123.5 13

10 Properties of Consistent Hashing Monotonicity: When a bucket is added/removed, the only objects affected are those that are/were mapped to the bucket. Balance: Objects are assigned to buckets “randomly”. -- can be improved by mapping each bucket to multiple places on unit circle Load: Objects are assigned to buckets evenly, even over a set of views. Spread: An object should be mapped to a small number of buckets over a set of views.

11 Actual low-level load-balancing alg. a212: 10.10.10.1 10.10.10.4 10.10.10.3 10.10.10.2 a213: 10.10.10.3 10.10.10.4 10.10.10.2 10.10.10.1 a214: 10.10.10.1 10.10.10.2 10.10.10.3 10.10.10.4 a215: 10.10.10.2 10.10.10.1 10.10.10.4 10.10.10.3 random permutations of servers Why? To spread load for one serial number.

12 Leader Election Example All low-level name servers for a cluster compute the hash table. One is elected leader and distributes its table to the others.All low-level name servers for a cluster compute the hash table. One is elected leader and distributes its table to the others.

13 And now, some slides from Michel Goemans (high-level load balancing)

14 Stable Marriages Assignment of men and womenAssignment of men and women -Each man ranks each woman and vice versa -Marriage stable if no pair (m,w) unmatched where m prefers w to his “wife” and w prefers m to her “husband” 3 2 4 2

15 Residents-Hospitals Extension Residents-HospitalsResidents-Hospitals -results + algorithm extends to case in which hospital j can accept c(j) residents -In use since 1951 by National Intern Matching Program

16 Multi-Dimensional Load Not a single constraining resource!Not a single constraining resource! Can be:Can be: -Bandwidth -CPU usage (e.g. key signing for https) -Disk usage (e.g. for cache misses, auction sites) -Memory (e.g. EdgeJava) -Threads (e.g. EdgeJava) -Number of licenses in Realaudio

17 Stable Allocations With Tree Constraints [G ’00]:[G ’00]: -resources 1,…,k -Supply item j has rooted tree T(j) of constraints V(T(j))={1,…,k} Every node v of T has capacity c(j,v) -Demand item i has basic resource b(i) and demand d(i) When x units mapped to supply j, uses x units of each resource on path in T(j) from b(i) to root of T(j) -Stability as before

18 Instance of Problem Demand items: (groups of IPs, rule for mapping)Demand items: (groups of IPs, rule for mapping) m=hundreds of thousands m=hundreds of thousands Supply items: cluster of serversSupply items: cluster of serversn=thousands (Incomplete) preference lists for demands based on performance + contract rules(Incomplete) preference lists for demands based on performance + contract rules (Implicit) preference lists for supplies based on alternate choices, contract rules, …(Implicit) preference lists for supplies based on alternate choices, contract rules, … Tree of constraints model various resource constraintsTree of constraints model various resource constraints

19 [9,9] [0,9] [7,9] [2,9][7,9] [9,9] 2 3 Algorithm for Tree Constraints Demand items request unassigned demands in order of preferenceDemand items request unassigned demands in order of preference When demand i requests x units from j, repeat:When demand i requests x units from j, repeat: -Find lowest (in tree) tight constraint, say node v -Dispose demands (up to x) of lower preference than i and using resources in subtree rooted at v Demand = 2 3 5 5 8 [0,8] [0,9] [0,6] [0,12] [0,5] [0,7] [load,cap] [2,6] [2,9] [2,12] [3,5] [5,12] [5,7] [10,12] 2 [2,8] [4,9] [12,12] [0,6] [2,9] [10,12] 4 [4,9] [12,12] [4,8] 1 [1,7] [5,9] [8,12] 8 [8,8] [8,9] [12,12]

20 Rich areas for research Providing database scalabilityProviding database scalability -Efficiency -Consistency -Security Securing a system with physically insecure serversSecuring a system with physically insecure servers


Download ppt "Key Algorithms in a Content Delivery System Akamai Technologies and Carnegie Mellon University Bruce Maggs."

Similar presentations


Ads by Google