KEMBAR78
Scalable PHP | PPS
Scalable PHP Cal Henderson
Oh hai
Does PHP scale?
Yes!
No!
Stupid question!
Languages don’t scale
Architectures scale
 
 
Universe of marshy force. Field sense shallows the hatchery saying Hello,. World!.  Hydro. Power spring  sometimes; snowmelt       powers   snowmelt always.
It’s all about the salmon And trees
But PHP sucks
No namespaces
Random function names
No quantum superpositions
People whining
Best of a bad bunch
Ok, scaling What  makes something scalable?
Bigger dataset More traffic Maintainable
NOT about performance
But PHP is slow!
 
Who cares?
PHP is not your bottleneck
More traffic Push issues down  the stack
Horizontal vs Vertical
Scale out vs Scale up
Scale out (horizontal) ftw
PHP sessions == bad /var/notshared
Sessions in a DB
 
No sessions at all
Sessions in cookies
Bigger dataset Not really a PHP issue
Pass big data by  function foo(&$big){} reference
Don’t serialize() big things
All arrays are sparse So that’s ok
Don’t keep much in memory
Maintainable Small logical blocks include()
Sucks about  namespaces
Classes are like  namespaces kinda
Many includes == bad
APC + full paths +  nostat == awesome
Set root path via .htaccess ENV Or whatever
deploy-time rollups also good
Consistency is king
# Comments # Also useful # (who knew?)
The bottom line: PHP is used for big things
Beauty is less important Than just working
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
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/
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

Scalable PHP