scalable php
TRANSCRIPT
Scalable PHPCal Henderson
geekSessions 2
Oh hai
geekSessions 3
Does PHP scale?
geekSessions 4
Yes!
geekSessions 5
No!
geekSessions 6
Stupid question!
geekSessions 7
Languages don’t scale
geekSessions 8
Architectures scale
geekSessions 9
geekSessions 10
geekSessions 11
Universe of marshy force. Field senseshallows the hatchery saying Hello,. World!. Hydro. Power spring sometimes; snowmelt powers snowmelt always.
geekSessions 12
It’s all about the salmon
And trees
geekSessions 13
But PHP sucks
geekSessions 14
No namespaces
geekSessions 15
Random function names
geekSessions 16
No quantum superpositions
geekSessions 17
People whining
geekSessions 18
Best of a bad bunch
geekSessions 19
Ok, scaling
What makes something
scalable?
geekSessions 20
Bigger dataset
More traffic
Maintainable
geekSessions 21
NOT about performance
geekSessions 22
But PHP is slow!
geekSessions 23
geekSessions 24
Who cares?
geekSessions 25
PHP is not your
bottleneck
geekSessions 26
More traffic
Push issues down the stack
geekSessions 27
Horizontal
vs
Vertical
geekSessions 28
Scale out
vs
Scale up
geekSessions 29
Scale out (horizontal) ftw
geekSessions 30
PHP sessions == bad
/var/notshared
geekSessions 31
Sessions in a DB
geekSessions 32
geekSessions 33
No sessions at all
geekSessions 34
Sessions in cookies
geekSessions 35
Bigger dataset
Not really a PHP issue
geekSessions 36
Pass big data by
function foo(&$big){}
reference
geekSessions 37
Don’t serialize()
big things
geekSessions 38
All arrays are sparse
So that’s ok
geekSessions 39
Don’t keep much in
memory
geekSessions 40
Maintainable
Small logical blocks
include()
geekSessions 41
Sucks about namespaces
geekSessions 42
Classes are like namespaces
kinda
geekSessions 43
Many includes == bad
geekSessions 44
APC + full paths + nostat == awesome
geekSessions 45
Set root path via
.htaccess ENV
Or whatever
geekSessions 46
deploy-time rollups
also good
geekSessions 47
Consistency
is king
geekSessions 48
# Comments
# Also useful
# (who knew?)
geekSessions 49
The bottom line:
PHP is used for
big things
geekSessions 50
Beauty is lessimportant
Than just working
geekSessions 51
Photos!• http://flickr.com/photos/isolano/423026153/• http://flickr.com/photos/liberato/171610084/• http://flickr.com/photos/thomashawk/422057690/• http://flickr.com/photos/puja/138469909/• http://flickr.com/photos/stuckincustoms/177496023/• http://flickr.com/photos/maurymccown/289932747/• http://flickr.com/photos/lij/122525716/• http://flickr.com/photos/thomashawk/44667887/• http://flickr.com/photos/mr_fabulous/2033276270/• http://flickr.com/photos/re_verse/58362878/• http://flickr.com/photos/auntiep/3990731/• http://flickr.com/photos/arild_storaas/966725616/• http://flickr.com/photos/magnesaxegaard/1351464888/• http://flickr.com/photos/hughes_leglise/530542920/• http://en.wikipedia.org/wiki/Image:John_McCarthy_Stanford.jpg
geekSessions 52
Moar Photos!• http://flickr.com/photos/bonnieshulman/566022330/• http://flickr.com/photos/hamed/155343130/• http://flickr.com/photos/pandiyan/186171830/• http://flickr.com/photos/fish_at_taipei/198024832/• http://flickr.com/photos/cdell/472665280/• http://flickr.com/photos/robh/142742990/• http://flickr.com/photos/neilw/204239787/• http://flickr.com/photos/big-e-mr-g/152643684/• http://flickr.com/photos/ozyman/155517365/• http://flickr.com/photos/ucumari/580865728/• http://flickr.com/photos/twob/8741933/• http://flickr.com/photos/ashclements/248887492/• http://flickr.com/photos/mr-outdoorguy/2100813932/• http://flickr.com/photos/good_day/450356635/• http://flickr.com/photos/thomashawk/72597356/
geekSessions 53
Even Moar Photos!• http://flickr.com/photos/dcjohn/74907741/• http://flickr.com/photos/carplips/439902567/• http://flickr.com/photos/bretarnett/180654760/• http://flickr.com/photos/bunchofpants/27151349/• http://flickr.com/photos/stuckincustoms/870325399/• http://flickr.com/photos/cruzan/84636294/• http://flickr.com/photos/cayusa/384187184/• http://flickr.com/photos/mrclean/371372515/• http://flickr.com/photos/radiofree/113944690/• http://flickr.com/photos/fortphoto/320676608/• http://flickr.com/photos/hurleygurley/4338767/
find these slides online
iamcal.com/talks