Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

25
!"#$%"&&’#( $*+ ,--’./"#0 !"#$ &’()*)"# +,’ -)(./01 2/$3 4"5)()3"6 7 $3" 894& -$(): 1"234’# 54’6 7+2%8 9:; ;%"-4.$< ;< =>.? ;@@A B C-DCE ;@@AF 4"5)()3"6

description

Dynamic consumer content on the Web is straining the LAMP stack and demands a new caching tier for maximum scale. Take a hit of Memcached and the sky&#x27;s the scalability limit, but be careful not to overdose. This presentation offers best practices and gotcha&#x27;s for scaling LAMP-based sites with open technologies like Memcached.

Transcript of Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

Page 1: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

!"#$%"&&'#()$*+),--'./"#0)!"#$%&'()*)"#%+,'%-)(./01%2/$3%

4"5)()3"6%7%$3"%894&%-$():%%

1"234'#)54'6)

7+2%8)

9:;);%"-4.$<)

;<%=>.?%;@@A% B%C-DCE%;@@AF%4"5)()3"6%

Page 2: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

=*+)>+?0)>*2$@<)!*2#(+-A)

BG! &,H>.(*,0%

;G! I'(J)%

<G! D,0$"0$%7%9HH./)(*,0#%

;<%=>.?%;@@A% C-DCE%;@@AF%4"5)()3"6% ;%

Page 3: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

>+?)7%"B$*0);"C4&2/"#)

•! K,''"#$"'F%;G;%L/../,0%H",H."%,0./0"%1.,L(..?%L?%;@B<%

;<%=>.?%;@@A% <%C-DCE%;@@AF%4"5)()3"6%

Page 4: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

>+?)7%"B$*0)=%2D.)

!'<."0))

•! M,##42&)(&"?2&)E;)$%2D.)

B'&&)+F.++-)$B"G$*'%-<)"H)2)

6+I2?J$+)K88L)+F2?J$+<M)'#)

H"4%)J+2%<)KNOPQMR)

–! !"#$%&'"#()*&+,-.%/0"12&

314,56&7&8(1,&9::7&

;<%=>.?%;@@A% C-DCE%;@@AF%4"5)()3"6% N%

Page 5: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

>+?)7%"B$*0),CC&'.2/"#)S)!"#$+#$)

;<%=>.?%;@@A% C-DCE%;@@AF%4"5)()3"6% O%

Page 6: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

7%"B$*).2#)?+)C2'#H4&)

PQRSTU%

;<%=>.?%;@@A% C-DCE%;@@AF%4"5)()3"6% V%

Page 7: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

>+?),%.*'$+.$4%+)

DWE%

D./"0$#%

X0$"'0"$%

-$,'(1"%

E"$%

X0$"'+()"%

&',Y?%

8,(6%

!(.(0)"'%

Z"L%-$():%

Z"L%-"'["

'#%9H()3"\%E

1/0Y\%8/1

3]H6%

9HH%-"'["

'#%&^&\%=(

[(\%S

(/.#\%D

\%&"'.\%

&?$3,0%

W($(L(#"%

4?-_8\%&

,#$1

'"-_8%%

!!%4,#$%#/$"#%P,["'%VO`U%L(#"6%,0%894&%,'%=9Q9%%

!!%X06>#$'?%#$(06('6%#"'["'#%'"H.()"6%H',H'/"$('?%-4&%

!!%-3/a%$,%W?0(5/)%D,0$"0$%H>$#%#$'(/0%,0%,'/1/0%#/$"#%

;<%=>.?%;@@A% b%C-DCE%;@@AF%4"5)()3"6%

Page 8: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

>*2$)$")-"A)

D()3"%

D9D^R%

D9D^Rc%

;<%=>.?%;@@A% C-DCE%;@@AF%4"5)()3"6% d%

Page 9: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

T+B)!2.*'#(),%.*'$+.$4%+)

H"%)U.2&'#()V4$))

DWE%

D./"0$#%

X0$"'0"$%

-$,'(1"%

E"$%

X0$"'+()"%

&',Y?%

8,(6%

!(.(0)"'%

Z"L%-$():%

Z"L%-"'["

'#%9H()3"\%E

1/0Y\%8/1

3]H6%

9HH%-"'["

'#%&^&\%=(

[(\%S

(/.#\%D

\%&"'.\%

&?$3,0%

W($(L(#"%

4?-_8\%&

,#$1

'"-_8%%

D()3"%-"'["'#%5"5)()3"6%

;<%=>.?%;@@A% A%C-DCE%;@@AF%4"5)()3"6%

Page 10: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

W+X.2.*+-0);'&&2%)"H)>+?)NYO)

,%.*'$+.$4%+)

MR["'?$3/01%'>0#%+',5%

4"5,'?%/0%Z"L%;G@e%

–! R[(0%Z"(["'\%I2/]"'\%4(')3%;@@A%

;<%=>.?%;@@A% C-DCE%;@@AF%4"5)()3"6% B@%

Page 11: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

=*+)Z'F0)W+X.2.*+-)

M4"5)()3"6%/#%(%3/13fH"'+,'5(0)"\%6/#$'/L>$"6%

5"5,'?%,Lg")$%)()3/01%#?#$"5\%1"0"'/)%/0%

0($>'"\%L>$%/0$"06"6%+,'%>#"%/0%#H""6/01%>H%

6?0(5/)%2"L%(HH./)(*,0#%L?%(.."[/(*01%

6($(L(#"%.,(6e%h%6(01(G),5%

;<%=>.?%;@@A% C-DCE%;@@AF%4"5)()3"6% BB%

Page 12: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

>*2$)W+X.2.*+-)'<)TV=0)

•! 9%H"'#/#$"0$%6($(%#$,'"%

•! 9%6($(L(#"%

•! 9HH./)(*,0%#H")/i)%

•! D.>#$"'"6%

•! 9%.('1"%,Lg")$%)()3"%

;<%=>.?%;@@A% C-DCE%;@@AF%4"5)()3"6% B;%

Page 13: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

,)[F).2#)?+."X+)2#)2--'./"#)

;<%=>.?%;@@A% B<%C-DCE%;@@AF%4"5)()3"6%

Page 14: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

BN%

9\"&4/"#)"H)2)]J#2X'.)U'$+)^P);&4)<&"1&-=,&*">,&%>&)&2/%."12&.,?&#,/@"$,)

•! R["0$F%-/$"%3(#%1',2$3%/0%0>5L"'%,+%>#"'#j#"##/,0#jH(1"%[/"2#j(HH#%

)(>#/01%"Y)"##/["%'"(6%.,(6%,0%W!%

•! 9)*,0F%S"H./)($"%W($(L(#"%P(06j,'%(66%5,'"%(HH%#"'["'#U%

4?-_8%

9HH%-"'["'% 9HH%-"'["'% 9HH%-"'["'%

write!

4?-_8%

9HH%-"'["'% 9HH%-"'["'% 9HH%-"'["'%

write!

4?-_8%

write! k%

9HH%-"'["'% 9HH%-"'["'% 9HH%-"'["'%

;<%=>.?%;@@A% C-DCE%;@@AF%4"5)()3"6%

Page 15: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

;<%=>.?%;@@A% C-DCE%;@@AF%4"5)()3"6% BO%

9\"&4/"#)"H)2)]J#2X'.)U'$+)^N);&4)<&"1&-=,&*">,&%>&)&2/%."12&.,?&#,/@"$,)

•! R["0$F%314"@"4()*&$)$=,#%,0%$3"%(HHj6L%#"'["'#%('"%,["'23".5"6%+',5%

)3(,*)j0,0f6"$"'5/0/#*)%),0$"0$%())"##%

•! 9)*,0F%966%5"5)()3"6%#"'["'%,0%#"'["'#%2/$3%>06"'>*./l"6%5"5,'?%

'"#,>')"#k%'"#>.$#%/0%"["0%+"2"'%'"(6#%$,%6L%

4?-_8%

9HH%-"'["'% 9HH%-"'["'% 9HH%-"'["'%

write!

4?-_8%

write! k%

9HH%-"'["'% 9HH%-"'["'% 9HH%-"'["'%

4?-_8%

9HH%-"'["'% 9HH%-"'["'% 9HH%-"'["'%

write!

4?-_8%

write! k%

9HH%-"'["'% 9HH%-"'["'% 9HH%-"'["'%5"5)()3"6% 5"5)()3"6% 5"5)()3"6%

5"5)()3"6% 5"5)()3"6% 5"5)()3"6%

Page 16: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

;<%=>.?%;@@A% C-DCE%;@@AF%4"5)()3"6% BV%

9\"&4/"#)"H)2)]J#2X'.)U'$+)^Q);&4)<&"1&-=,&*">,&%>&)&2/%."12&.,?&#,/@"$,)

•! R["0$F%4"5)()3"6%0""6#%5,'"%5"5,'?%'"#,>')"#%$3(0%23($%/#%([(/.(L."%

,0%,$3"'%P#3('"6U%#"'["'#%

•! 9)*,0F%4,["%5"5)()3"6%#"'["'#%$,%6"6/)($"6%#"'["'#%

4?-_8%

9HH%-"'["'% 9HH%-"'["'% 9HH%-"'["'%

write!

4?-_8%

write!

k%

9HH%-"'["'% 9HH%-"'["'% 9HH%-"'["'%

4?-_8%

9HH%-"'["'% 9HH%-"'["'% 9HH%-"'["'%

write!

4?-_8%

write! k%

9HH%-"'["'% 9HH%-"'["'% 9HH%-"'["'%5"5)()3"6% 5"5)()3"6% 5"5)()3"6%

5"5)()3"6% 5"5)()3"6%

5"5)()3"6% 5"5)()3"6% 5"5)()3"6%

5"5)()3"6%

k%

Page 17: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

;"C4&2%)_<+)!2<+<)

•! 4?-_8%6/#$'/L>$"6%)()3"%

–!`=*+)?+<$)B2J)$")<C++-)4C)WJUab)'<)#"$)$")4<+)'$R)]+H+#<'"%

•! &',i."%)()3"%

–!&',[/6"%'(H/6%),0$"0$%$('1"*01%

•! -"##/,0%)()3"%

–!->HH,'$#%'(H/6%/0$"'()*["%(HH./)(*,0#%PX4U%

•! ^I48%)()3"%

–!W"./["'#%m>/):%#/$"%'"06"'/01%

;<%=>.?%;@@A% C-DCE%;@@AF%4"5)()3"6% Bb%

Page 18: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

_<+)!2<+)9F2XC&+0)U+<<'"#)W2#2(+X+#$)

•! N5n%6(/.?%[/#/$,'#%

•! BO:%3/$#j#")%

•! V:%>H6($"#j#")%

•! I"0#%,+%$3,>#(06#%),0)>''"0$%),00")*,0#%

•! -"##/,0%$'():"6%(06%(6#%('"%H.()"6%/0%()),'6(0)"%$,%#"##/,0%

Page 19: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

^(6,,H%

S"),55"06(*,0#%,0%

o#"'%2"LH(1"#%

8,(6%!(.(0)"'%8,(6%!(.(0)"'%

8,(6%!(.(0)"'%

Z"L#"'["'%j%H3H%

o#"'%I('1"*01%-"'[/)"%

I3/0j+(#$%5"5)()3"%

D./"0$%.(?"'%P'"(6#U%

oH6($"%H',)"##/01%

P2'/$"#U%

o#"'%I('1"*01%-"'[/)"%

I3/0j+(#$%5"5)()3"%

D./"0$%.(?"'%P'"(6#U%

oH6($"%H',)"##/01%

P2'/$"#U%

o#"'%I('1"*01%-"'[/)"%

I3/0j+(#$%5"5)()3"%

D./"0$%.(?"'%P'"(6#U%

oH6($"%H',)"##/01%

P2'/$"#U%

4(HjS"6>)"%=,L#%

W($(%H',)"##/01%

o#"'%H',i."%>H6($"#%

96f^,)%90(.?#/#%

4"5)()3"%'"H,H>.(*,0%

PL>.:%>H6($"#\%'"),["'?U%

o#"'%$('1"*01%6($(%

K',5%.,1#%(06%,$3"'%

#?#$"5#%

M8(l?e%oH6($"#%

!>.:jL($)3%

>H6($"#%

_<+)!2<+)9F2XC&+0)_<+%)=2%(+/#()9#('#+)

;<%=>.?%;@@A% C-DCE%;@@AF%4"5)()3"6% BA%

4"5)()3"6%

H,,.%

S"H,'$#%

Page 20: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

_<+H4&)W+X.2.*+-)=""&<)

advanced reporter!

wireshark!

brutis!

statsproxy!

cacti!Graph and analyze Memcached statistics!

View bu"ered Memcached stats in your browser!

Size and test changes to memcache clusters!

Dissect and analyze Memcached network tra#c!

Track hot keys and clients in Memcached!

;<%=>.?%;@@A% ;@%C-DCE%;@@AF%4"5)()3"6%

Page 21: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

U$2$<C%"FJ)c)!2./)=+XC&2$+<)

I,%>#"%$3"%)()*%

$"5H.($"#%+,'%

5"5)()3"6%2/$3%

#$($#H',Y?\%?,>%"/$3"'%

0""6%$,%5,6/+?%$3"%

$"5H.($"#%$,%>#"%H,'$%

d@d@%,'%)3(01"%$3"%

#$($#H',Y?%),0i1%$,%

>#"%H,'$%BB;BB%

;<%=>.?%;@@A% ;B%C-DCE%;@@AF%4"5)()3"6%

Page 22: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

W+X.2.*+-0)d+<$);%2./.+<)

•! o#"%2/$3%4?-_8%FfU%

•! o#"%,0%VN%L/$%#"'["'#%

•! D()3"%M"YH"0#/["%,H"'(*,0#e%

•! D()3"%L/f6/'")*,0(..?%PSjZU%

•! W"#/10%$,%2/$3#$(06%+(/.>'"#%1'()"+>..?%

•! o#"%),0#/#$"0$%3(#3/01%

•! D('"+>.%2/$3%0>5L"'#%,+%),00")*,0#%

–! &"(:%

–! I'(0#/*,0#%

•! R[/)*,0#%

–! -"15"0$%4"5)()3"6%6($(%/0$,%#"H('($"%H,,.#%

•! CH*5/l"%#/l/01F%X0#$(0)"#%(06%H,,.#%

•! X0#$'>5"0$(*,0%

;<%=>.?%;@@A% C-DCE%;@@AF%4"5)()3"6% ;;%

Page 23: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

•! First and leading provider $of Memcached solutions!

•! Memcached solution including!

•! High Availability!

•! High density!

•! Advanced memory $management!

•! Enhanced reporting $capabilities !

•! Support for multi-tenancy!

•! Disruption free $software upgrades!

•! 100% client compatible!

;<%=>.?%;@@A% ;<%C-DCE%;@@AF%4"5)()3"6%

Page 24: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

=*2#e<)

=,(m>/0%p($q%1"('V%p6,$q%),5%

;<%=>.?%;@@A% C-DCE%;@@AF%4"5)()3"6% ;N%

Page 25: Controlling the Addiction: Best Practices for Scaling with Memcached and the LAMP Stack

5+<"4%.+<)S)5+H+%+#.+<)

•! W(01(G),5%

•! ^/13#)(.(L/./$?G),5%

•! W"[G1"('VG),5%

•! r',>H#G1,,1."G),5j1',>Hj5"5)()3"6%

•! D,6"G1,,1."G),5jHj5"5)()3"6%

•! I2/]"'G),5j1"('#/Y%

•! D()*G0"$%

•! Z/'"#3(':G,'1%

;<%=>.?%;@@A% C-DCE%;@@AF%4"5)()3"6% ;O%