ZendCon 2008

advertisement
ZendCon 2008
Or:
How I learned to stop
worrying and love the PHP.
Keynote
 Many companies replacing Java with
PHP






Zero9
Orange UK (Telecom)
BNP Paribas (French Bank)
IGN
Yahoo
DFW Airport
 New stuff from Zend






Framework Cert.
AppCelerator
Magento(ecommerce)
Zend Studio 6.1
Partnership w/ Adobe
Adobe => Flex
 Zend Studio
 PHPUnit (testing)
 Flex
 AMF (Flash
ActionScript)
 Dojo (javascript
components/widgets)
Join-Fu
 Slides in X drive
Analysis @ Ning
 Tools
 Oprofile
 Dtrace extension
 System tap
 www.sklar.com/blog/
 Slides on X:
PECL Picks (PHP Extens.)
 Opcode Caching
 APC
 Memcached
 Image Manipulation
 Imagick
 Curl Replacement
 Pecl_Http
 Upload Progress - UploadProgress







PDF – PDF, Haru
Version Control – svn
Database – PDO*, PDO_User (netezza?)
I18n – Translit
Diffs – xdiff
Search – Sphinx
Doing “bad” things
 Runkit, funcall, intercept, operator
 Type Hinting – spl_types
 Params - params
 Debugging – Xdebug
 Language Embedding
 Java, Lua, Perl, Python
 Other
 Ssh2
 AMF
 Elizabethmariesmith.com
 Slides on X:
Knight Rider Methodology
 Eli White
 Tripadvisor, travelpod, eliw.com
 All about the tools
 Editor – notepad, studio, ide, etc…
 Profiling – APD, wincachegrind, webgrind,
xdebug
 Load testing – http_load, siege,
apachebench
 Performance – APC, memcached,
gearman (batch processing)
 Code Libraries – Pecl, pear, js – jquery
etc
 Debugging – xdebug, dbg, zstudio, apd,
firebug, dev toolbar
 Testing – simpletest, phpt, phpunit,
selenium (js)
 Multi-tier servers – Dev, Integration,
Testing, Staging, Production
 Errors – E_ALL && E_STRICT
Version Control – SVN, CVS, GIT
Lint (suspicious code) – php –l, phplint
Code Sniff – check coding standards
GUIs – DB – aqua data studio,
squirrelsql; version control –
subcommander, smartsvn
 Little things (commands) – rsync, grep,
find, sed, cut
 Hardware – acquire what will help
 Social networking – Community!




Zend Studio Secrets
 F-Keys







Ctrl-f8 = switch persepctives
Ctrl-f7 = switch panes
Ctrl-f6 = switch files, alt-left, alt-right
Ctrl-m = max/minimize panes
Ctrl-l = show shortcuts
Ctrl-r = open file
Ctrl-k = show next find
 Can be config’d to show white space
 Wizards – PHPUnit
Rich UIs w/ ZF + Dojo
 Webinar @
http://www.zend.com/en/resources/webin
ars/
 Matthew Weier O’Phinney
Keynote Wednesday
 Magento












OOP
Zend Framework
170 Extensions
Powering Poster.com, fiesta bowl
Modular, flexible
Connect – extension site
Customize user experience
Iphone optimized
Layered Navigation
Ratings, reviews, tags, feeds
Call center functionality
Promotion engine





ZF – Less Training
NewBSD License
Design packages (themes)
Pear channel
SOAP, XMLRPC APIs
Web Services w/ Z Frame.
 Matthew Turling – ishouldbecoding.com
 HTTP_Auth
 Zend_Server_Interface
 Zend_Server_Reflection
 Zend_Server_Abstract
 REST
 Zend_Rest_Server – not ideal
 Zend_Rest_Client
 Book: Restufl web services, isbn: 059652…
 Controller
 contextSwitchHelper
 Content Negotiation
 XMLRPC
 Zend_XmlRpc_Server, _Request, _Response, _Server_Fault,
_Server_Cache (not ready), _Client, _Client_Serverproxy
(allows xmlrpc as native php object)
 Boxcarring – allow multiple calls on single request
 JSON-RPC
 Zend_Json_Server, _Server_smd, _Server_Request,
_Server_error
 SOAP
 Zend_Soap_Server
 Verbose, enumerators, complex, namespaces, user-defined
data types
RIA w/ ZF + Flex + Air
 John Coggeshall – Automotive Computer
Services
 Air – Allows access to local services on
client
 Zend Studio
 Flex Builder Plugin
 Log_Watcher plugin
 Adobe Actionscript3 + Flex w/ PureMVC
extension (puremvc.org)
Enterprise PHP
 Ivo Jansch
 Know customer wants vs needs
 Wireframes – Axure (www.axure.com)
$500 for 5 seats
 CruiseControl, PHPUnderControl
Scaling Mozilla’s Websites




Laura Thomson
Mozilla.com runs on Drupal
Services – Bouncer (load balancing)
Addons.mozilla.com = “AMO”
 72M hits, 4M page views, 1M user sessions
 Runs on CakePHP
 Infrastructure
 3 datacenters (San Jose, Amsterdam, China)
 Net Scaler hardware (Citrix)
 Web Servers -> memcached, db cluster (my,pg)
 12 nodes each for static, dynamic
 Scaling SUMO (support.mozilla.org)









KB, Forum, wiki (tikiwiki)
Initially only 5 reqs/second
Architecture analysis
Load Tests
Profiling (xdebug + kcachegrind)
270 Queries / page load!
Reduce includes
Now up to 12 reqs/second
DB





Caching, move to innodb
Fix slow queries, add indexes
Now down to 19 queries/page
Duplication – Send selects to slaves, other to master
Logic to make post-update selects on master
 Memcached – Whole-page, sessions
 Scaling SUMO contd.
 Use cron jobs instead of rolling up on certain
pages
 Load Testing (now at 22 reqs/sec)
 Millenium
 Log replay
 https://svn.mozilla.org/projects/webtest
 Peak Download Day Stats





14Gb/s
2Gb/s web traffic
300x spike
Turned off AMO to help
One net scaler failed
Testing With Selenium
 Stefan Priebsch
 Testing – Unit, system, acceptance, integration,
performance, load, usability, security
 Selenium IDE – ide.openqa.org – firefox plugin
 Assertions
 Plugins
 Selenium RC – Remote control, seleniumrc.openqa.org
 PHPUnit integration
 PHPUnit_Extensions_selenium_testcase (can set up using
xvfb)
 Can be fired via Cruisecontrol (phpUnderControl for mgmt),
Continuum, Xinc
 Virtual Machines – Snapshot mgmt
 Side note – Red hat switching to KVM from XEN.
Scaling PHP Application
 Maurice Kherlakian – Bell Canada
 Scalability
 Performance vs High Availability
 Load Balancers – Soft vs hardware
 Session Persistence – Sticky, Sharing
(memcached), Session Clusting in Z. Platform
 Synchronization – Rsync –avz
 Static Content Separation
 Memory consumption
 Use low-memory http server (lighttpd, thttpd) or cdn
 Database





Master-slave, dual master, replication
DRDB = master-slave, HA, no perf gain
Mysql cluster
Partitioning, sharding
Tools – mysql_sla, slow query log, monyog
 Code Acceleration




XCache, APC, eAccelerator, Zend Platform
DB Requests
HTML Caching
Client side – etags, expire headers
 Code Design
 Standards, Zend Framework
 Plan Plan Plan!
 Ensure Compatibility
Final Keynote
 Mark deVisser – American Cancer
Society




Social network for cancer stories
www.sharinghope.tv
VMIX for video back end
“Code Against Cancer” requesting help
Download