Upload
tomislav-raseta
View
384
Download
0
Tags:
Embed Size (px)
Citation preview
Upgrading to PHP 5.6TOMISLAV RAŠETA@TRASETA
Why upgrading (I)
Why upgrading (II)
On your marks
• task: upgrade PHP 5.3 -> 5.6
• get client approval• engage your social skills
• “why fix if it ain’t broken” is not a satisfactory response
• website speed impacts Google search ranking
• show’em the graphs! :)
• approval granted, one client requirement: minimum downtime and minimum error rate
Get Set
• server-side: add additional application servers to your staging environment with the new PHP 5.6 along the old 5.3 app servers
• use LB in front to ensure that you can balance requests between 5.3 and 5.6 application servers
• migration guides – read them all• 5.3 -> 5.4
• 5.4 -> 5.5
• 5.5 -> 5.6
• ensure the time availability for system architects, devops, sysadmins and lead developers, it’s a timely process
Ready
• fix what you can from migration guides in advance, watch out for deprecated methods *and* not yet deprecated
• parse your production access logs with URLs
• add Sentry (www.getsentry.com)
• siege your staging with URLs gathered from access logs
• if you have unit tests, even better :)
• our siege was run for 72 hours (Fri-Mon)
• click everywhere! (you have a test-team, right?)
Sentry (I)
• Sentry is a realtime event logging and aggregation platform
• one-stop shop for all your application errors
Sentry (II)
• tip: add php version tag
• filter it out afterwards
Go!
• ensure there are no more version specific errors on Sentry
• route minimal traffic to one 5.6 app server at start to minimize end-user errors (if they emerge for some reason)
• keep one eye on Sentry, another at end-user reports
• slightly increase traffic to 5.6 app servers and keep it in production for at least 24h
• if successful, upgrade everything!
• if not, fix it :)
Results
Metric Improvement
Memory footprint(per apache process)
-5%
CPU usage(median across all app servers)
-3%
Response time(New Relic)
-10%
PHPNG
• refactored core
• improved performance
• smaller memory footprint
• yes, even faster than PHP 5.6
PHPNG – Need for Speed (I)
PHPNG – Need for Speed (II)
Conclusion
Thanks!
• benchmarks from Dmitry Stogov (Zend) talk at ZendCon 2014
• https://drive.google.com/file/d/0B3UKOMH_4lgBUTdjUGxIZ3l1Ukk/view?usp=sharing
• PHPNG (next generation)
• https://wiki.php.net/phpng
• questions?