15
Upgrading to PHP 5.6 TOMISLAV RAŠETA @TRASETA

Upgrading to PHP 5.6

Embed Size (px)

Citation preview

Page 1: Upgrading to PHP 5.6

Upgrading to PHP 5.6TOMISLAV RAŠETA@TRASETA

Page 2: Upgrading to PHP 5.6

Why upgrading (I)

Page 3: Upgrading to PHP 5.6

Why upgrading (II)

Page 4: Upgrading to PHP 5.6

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

Page 5: Upgrading to PHP 5.6

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

Page 6: Upgrading to PHP 5.6

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?)

Page 7: Upgrading to PHP 5.6

Sentry (I)

• Sentry is a realtime event logging and aggregation platform

• one-stop shop for all your application errors

Page 8: Upgrading to PHP 5.6

Sentry (II)

• tip: add php version tag

• filter it out afterwards

Page 9: Upgrading to PHP 5.6

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 :)

Page 10: Upgrading to PHP 5.6

Results

Metric Improvement

Memory footprint(per apache process)

-5%

CPU usage(median across all app servers)

-3%

Response time(New Relic)

-10%

Page 11: Upgrading to PHP 5.6

PHPNG

• refactored core

• improved performance

• smaller memory footprint

• yes, even faster than PHP 5.6

Page 12: Upgrading to PHP 5.6

PHPNG – Need for Speed (I)

Page 13: Upgrading to PHP 5.6

PHPNG – Need for Speed (II)

Page 14: Upgrading to PHP 5.6

Conclusion

Page 15: Upgrading to PHP 5.6

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?