duty now for the future

Post on 07-Aug-2015

39 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Duty Now for the Future

In the past this information has been suppressed

but now it can be told

We're all Devo

We're all Devs

Let's look to the future

The futch

PHP 7

PHP 7 BetaJune 2015

PHP 7 ReleaseNovember 2015

(Probably)

There's a PHP 7 Vagrant

Vagrant is a tool for building complete development

environments. With an easy-to-use workflow and focus on automation,

Vagrant lowers development environment setup time, increases development/production parity,

and makes the "works on my machine" excuse a relic of the past.

— About Vagrant

Caveat

PHP version adoption stinks(Especially at the host level)

Let's look at PHP 5 adoption

The Majority 1• PHP 5.3 — 41.4%

• Release Date: June 30, 2009

• End of Life: August 14, 2014

• PHP 5.4 — 30.1%

• Release Date: March 1, 2012

• End of Life: September 12, 2015

1 Numbers from w3Techs as of June 2, 2015.

Let that sink in...

71.5% of all PHP sitesare powered by versions

that will be deadby the end of Summer 2015

Legacy PHP bad

The Minority 1• PHP 5.5 — 9.3%

• Release date: June 20, 2013

• End of Life: June 20, 2016

• PHP 5.6 — 1.5%

• Release Date: August 28, 2014

• End of Life: August 28, 2017

1 Numbers from w3Techs as of June 2, 2015.

PHP 5.5 will be

End of Life'dby this time next year

How long will it beuntil enough hosts support PHP 7?

How long can we wait?

There is another

HHVM

How is HHVM better?HHVM compiles PHP to an intermediate bytecode. The bytecode then gets translated to machine code by a just-in-time (JIT) compiler. Doing this removes the usual interpreted execution bottlenecks that come with using native PHP.

On top of that, HHVM analyzes your code as it runs. After it collects enough data, HHVM performs optimizations on what it considers to be frequently invoked and expensive pieces of code.

TL;DR: It's fast. And smart.

But how much faster?WordPress 4.1.x with 20 concurrent users.• Requests per second

• PHP 5.5: 256

• PHP 7: 627

• HHVM 3.7: 666

• Latency

• PHP 5.5: 78 milliseconds

• PHP 7: 32 milliseconds

• HHVM 3.7: 30 milliseconds

So what's the catch?• The HHVM compiler is strict.

• If you're using poorly written code, things can go sideways. Fast.

• The occasional memory leak.

• Long running PHP processes can chew up tons of RAM.

• Scheduled restarts of HHVM processes are not uncommon.

But don't let that scare you

There are large companies already using HHVM in production

• Facebook

• Wikipedia

• Etsy

• Box

HHVM-ready Hosts• WP Engine

• DreamHost

• Pagely

• SiteGround

• Kinsta

There's an HHVM VagrantAnd it's made for WordPress development

HGVhttps://github.com/wpengine/hgv

Built by WP Enginefor our Mercury platform

No matter where you host your site,you can use HGV to test your code

HGV• Built with members of the 10up team

• Work on your code under PHP 5.5 & HHVM at the same time

• Debugging & benchmarking tools

• Xdebug

• XHProf

• Siege

• query-monitor

• debug-objects

• debug-bar

Installing HGV is easyish

Prerequisites• Git

• VirtualBox or VMware

• Vagrant

• The Vagrant::Hostsupdater plugin

https://goo.gl/KpA928

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"brew install gitbrew install caskroom/cask/brew-caskbrew cask install vagrantbrew cask install virtualboxvagrant plugin install vagrant-hostsupdater

Installgit clone --recursive https://github.com/wpengine/hgv.gitcd hgvvagrant up

While HGV installs, make yourself a drinkIt should only take about 30 minutes

Get to work• Local file access

• Use your favorite text editor!

• [HGV_dir]/hgv_data/sites/[hhvm|php]/

• [HGV_dir]/hgv_data/sites/[hhvm|php]/wp-content/

[plugins|themes]/

• SSH

• vagrant ssh

• phpMyAdmin

• admin.hgv.dev/phpmyadmin/

Coming Soon in HGV 1.3• One Vagrant to rule them all

• Configure multiple installs & domains

• Adds the domains to your hosts file

• Provisioned via a YML file

--- enviro: trunk hhvm_domains: - hhvm.trunk.hgv.dev php_domains: - trunk.hgv.dev

So we've got that goin' for us,

which is nice

Questions?

It's time to go beyond the normal thing.It's time to do the super thing.Follow @boogah on Twitter.

top related