WordPress on NGINX + HHVM with Heroku Buildpacks WordPress on NGINX + HHVM It’s been a year since I last
made any major changes to my WordPress on Heroku build and in tech years that’s a lifetime. Since then Heroku has
released a new PHP buildpack with nginx and HHVM built in. Much progress have also been made both HHVM and
WordPress to make both compatible with each other. So it seems like now is as good a time as any to update the
stack this site is running on. So without further ado I like to introduce: Heroku WP — A template for HHVM powered
WordPress served by nginx. The Goal There are numerous other templates out there for running WordPress on
Heroku and my main goals for this templates are: It should be simple — use the default buildpack provided by Heroku
so there’s no other 3rd party dependency to implicitly trust or to maintain. It should be fast — use the latest
technologies available to squeeze every last ounce of performance out of each Heroku Dyno. It should be secure —
security is not an add-on, admin pages should be secure by default and database connections needs to be
encrypted. It should scale — just because we can serve millions of page hits a day off a single Heroku Dyno does not
mean we’ll stop there. The template should be made with cloud architecture in mind so that the number of Dynos can
scale up and down without breaking. The Stack Standing on the shoulder of giants I was able to use the latest Heroku
buildpack and get WordPress running on: NGINX — An event driven web server that was engineered for the modern
day to replace Apache. This high performance web server is preferred by more top 1,000 sites then any other and it’s
what’s used by the largest WordPress install out there, WordPress.com. HHVM — HipHop Virtual Machine, a JIT (just
in time) compiler developed by Facebook to run PHP scripts which when tested with WordPress showed up to a 2x
improvement. I have yet to run any statical analysis on performance however antidotally it feels a lot faster navigating
WP admin and page generation times looks much better. I’m looking forward to running more tests and performance
tuning this build in the coming weeks. Update: While still not a head-to-head test looking at the response times as
reported by StatusCake for this site running on Heroku-WP and a mirror of this site that is running on the old Heroku
LAMP stack with no load other then StatusCake pings shows a dramatic improvement:
Slide 12
Slide 12 text
SELECT COUNT(*)
FROM wp_posts
WHERE post_content LIKE "%WordPress%"
SELECT COUNT(*)
FROM wp_posts
WHERE post_content LIKE "%on%"
SELECT COUNT(*)
FROM wp_posts
WHERE post_content LIKE "%NGINX%"
…
SELECT COUNT(*)
FROM wp_posts
WHERE post_content LIKE "%improvement%"
WordPress on NGINX + HHVM with Heroku Buildpacks WordPress on NGINX + HHVM It’s been a year since I last
made any major changes to my WordPress on Heroku build and in tech years that’s a lifetime. Since then Heroku has
released a new PHP buildpack with nginx and HHVM built in. Much progress have also been made both HHVM and
WordPress to make both compatible with each other. So it seems like now is as good a time as any to update the
stack this site is running on. So without further ado I like to introduce: Heroku WP — A template for HHVM powered
WordPress served by nginx. The Goal There are numerous other templates out there for running WordPress on
Heroku and my main goals for this templates are: It should be simple — use the default buildpack provided by Heroku
so there’s no other 3rd party dependency to implicitly trust or to maintain. It should be fast — use the latest
technologies available to squeeze every last ounce of performance out of each Heroku Dyno. It should be secure —
security is not an add-on, admin pages should be secure by default and database connections needs to be
encrypted. It should scale — just because we can serve millions of page hits a day off a single Heroku Dyno does not
mean we’ll stop there. The template should be made with cloud architecture in mind so that the number of Dynos can
scale up and down without breaking. The Stack Standing on the shoulder of giants I was able to use the latest Heroku
buildpack and get WordPress running on: NGINX — An event driven web server that was engineered for the modern
day to replace Apache. This high performance web server is preferred by more top 1,000 sites then any other and it’s
what’s used by the largest WordPress install out there, WordPress.com. HHVM — HipHop Virtual Machine, a JIT (just
in time) compiler developed by Facebook to run PHP scripts which when tested with WordPress showed up to a 2x
improvement. I have yet to run any statical analysis on performance however antidotally it feels a lot faster navigating
WP admin and page generation times looks much better. I’m looking forward to running more tests and performance
tuning this build in the coming weeks. Update: While still not a head-to-head test looking at the response times as
reported by StatusCake for this site running on Heroku-WP and a mirror of this site that is running on the old Heroku
LAMP stack with no load other then StatusCake pings shows a dramatic improvement:
Slide 16
Slide 16 text
WordPress on NGINX + HHVM with Heroku Buildpacks WordPress on NGINX + HHVM It’s been a year since I last
made any major changes to my WordPress on Heroku build and in tech years that’s a lifetime. Since then Heroku has
released a new PHP buildpack with nginx and HHVM built in. Much progress have also been made both HHVM and
WordPress to make both compatible with each other. So it seems like now is as good a time as any to update the
stack this site is running on. So without further ado I like to introduce: Heroku WP — A template for HHVM powered
WordPress served by nginx. The Goal There are numerous other templates out there for running WordPress on
Heroku and my main goals for this templates are: It should be simple — use the default buildpack provided by Heroku
so there’s no other 3rd party dependency to implicitly trust or to maintain. It should be fast — use the latest
technologies available to squeeze every last ounce of performance out of each Heroku Dyno. It should be secure —
security is not an add-on, admin pages should be secure by default and database connections needs to be
encrypted. It should scale — just because we can serve millions of page hits a day off a single Heroku Dyno does not
mean we’ll stop there. The template should be made with cloud architecture in mind so that the number of Dynos can
scale up and down without breaking. The Stack Standing on the shoulder of giants I was able to use the latest Heroku
buildpack and get WordPress running on: NGINX — An event driven web server that was engineered for the modern
day to replace Apache. This high performance web server is preferred by more top 1,000 sites then any other and it’s
what’s used by the largest WordPress install out there, WordPress.com. HHVM — HipHop Virtual Machine, a JIT (just
in time) compiler developed by Facebook to run PHP scripts which when tested with WordPress showed up to a 2x
improvement. I have yet to run any statical analysis on performance however antidotally it feels a lot faster navigating
WP admin and page generation times looks much better. I’m looking forward to running more tests and performance
tuning this build in the coming weeks. Update: While still not a head-to-head test looking at the response times as
reported by StatusCake for this site running on Heroku-WP and a mirror of this site that is running on the old Heroku
LAMP stack with no load other then StatusCake pings shows a dramatic improvement:
Slide 17
Slide 17 text
SELECT *
FROM wp_posts
WHERE
post_content LIKE "%WordPress%" OR
post_content LIKE "%NGINX%" OR
post_content LIKE "%HHVM%" OR
post_content LIKE "%Heroku%" OR
post_content LIKE "%performance%"
Slide 18
Slide 18 text
SELECT *
FROM wp_posts
WHERE
post_content LIKE "%WordPress%" OR
post_content LIKE "%NGINX%" OR
post_content LIKE "%HHVM%" OR
post_content LIKE "%Heroku%" OR
post_content LIKE "%performance%"
ORDER BY
!?
Elasticsearch Filters & Queries
Filters Queries
Speed Fast Slow(er)
Cached Yes, With Bitsets! No
Matching Boolean Yes/No Relevancy Score
Slide 85
Slide 85 text
Relevancy Score?
TF-IDF
Slide 86
Slide 86 text
Relevancy Score?
Term Frequency
×
Inverse Document Frequency
Slide 87
Slide 87 text
Relevancy Score?
Term Frequency
×
Inverse Document Frequency
Slide 88
Slide 88 text
Relevancy Score?
Term Frequency
×
Inverse Document Frequency
Slide 89
Slide 89 text
Relevancy Score?
Term Frequency
×
Inverse Document Frequency
Slide 90
Slide 90 text
Relevancy Score?
Filter to Reduce Possible Documents
then
Query to Calculate Match Relevancy
Slide 91
Slide 91 text
WordPress on NGINX + HHVM with Heroku Buildpacks WordPress on NGINX + HHVM It’s been a year since I last
made any major changes to my WordPress on Heroku build and in tech years that’s a lifetime. Since then Heroku has
released a new PHP buildpack with nginx and HHVM built in. Much progress have also been made both HHVM and
WordPress to make both compatible with each other. So it seems like now is as good a time as any to update the
stack this site is running on. So without further ado I like to introduce: Heroku WP — A template for HHVM powered
WordPress served by nginx. The Goal There are numerous other templates out there for running WordPress on
Heroku and my main goals for this templates are: It should be simple — use the default buildpack provided by Heroku
so there’s no other 3rd party dependency to implicitly trust or to maintain. It should be fast — use the latest
technologies available to squeeze every last ounce of performance out of each Heroku Dyno. It should be secure —
security is not an add-on, admin pages should be secure by default and database connections needs to be
encrypted. It should scale — just because we can serve millions of page hits a day off a single Heroku Dyno does not
mean we’ll stop there. The template should be made with cloud architecture in mind so that the number of Dynos can
scale up and down without breaking. The Stack Standing on the shoulder of giants I was able to use the latest Heroku
buildpack and get WordPress running on: NGINX — An event driven web server that was engineered for the modern
day to replace Apache. This high performance web server is preferred by more top 1,000 sites then any other and it’s
what’s used by the largest WordPress install out there, WordPress.com. HHVM — HipHop Virtual Machine, a JIT (just
in time) compiler developed by Facebook to run PHP scripts which when tested with WordPress showed up to a 2x
improvement. I have yet to run any statical analysis on performance however antidotally it feels a lot faster navigating
WP admin and page generation times looks much better. I’m looking forward to running more tests and performance
tuning this build in the coming weeks. Update: While still not a head-to-head test looking at the response times as
reported by StatusCake for this site running on Heroku-WP and a mirror of this site that is running on the old Heroku
LAMP stack with no load other then StatusCake pings shows a dramatic improvement:
Slide 92
Slide 92 text
WordPress on NGINX + HHVM with Heroku Buildpacks WordPress on NGINX + HHVM It’s been a year since I last
made any major changes to my WordPress on Heroku build and in tech years that’s a lifetime. Since then Heroku has
released a new PHP buildpack with nginx and HHVM built in. Much progress have also been made both HHVM and
WordPress to make both compatible with each other. So it seems like now is as good a time as any to update the
stack this site is running on. So without further ado I like to introduce: Heroku WP — A template for HHVM powered
WordPress served by nginx. The Goal There are numerous other templates out there for running WordPress on
Heroku and my main goals for this templates are: It should be simple — use the default buildpack provided by Heroku
so there’s no other 3rd party dependency to implicitly trust or to maintain. It should be fast — use the latest
technologies available to squeeze every last ounce of performance out of each Heroku Dyno. It should be secure —
security is not an add-on, admin pages should be secure by default and database connections needs to be
encrypted. It should scale — just because we can serve millions of page hits a day off a single Heroku Dyno does not
mean we’ll stop there. The template should be made with cloud architecture in mind so that the number of Dynos can
scale up and down without breaking. The Stack Standing on the shoulder of giants I was able to use the latest Heroku
buildpack and get WordPress running on: NGINX — An event driven web server that was engineered for the modern
day to replace Apache. This high performance web server is preferred by more top 1,000 sites then any other and it’s
what’s used by the largest WordPress install out there, WordPress.com. HHVM — HipHop Virtual Machine, a JIT (just
in time) compiler developed by Facebook to run PHP scripts which when tested with WordPress showed up to a 2x
improvement. I have yet to run any statical analysis on performance however antidotally it feels a lot faster navigating
WP admin and page generation times looks much better. I’m looking forward to running more tests and performance
tuning this build in the coming weeks. Update: While still not a head-to-head test looking at the response times as
reported by StatusCake for this site running on Heroku-WP and a mirror of this site that is running on the old Heroku
LAMP stack with no load other then StatusCake pings shows a dramatic improvement: