It is always good to have a fast site, and because we're aiming also at performance tuning with Yireo, having top-notch technology with our own Yireo site is a must. Currently we have switched to PHP 7 and HTTP 2, and we are happy to share some of its details.
HTTP/2 with Nginx 1.9.5
Our site runs on top of CentOS Linux and for years we were running the Nginx server installed from the default RPM packages available. When Nginx 1.8 (?) came out, SPDY support was introduced - the predecessor of HTTP/2 - and because we wanted to make sure SPDY clients (at that time only Chrome) were served quickly, we compiled Nginx from source to allow for SPDY support to be integrated.
Compiling from source makes it harder to maintain up-to-date (well, not if you're a UNIX god), so all along we have been on the lookout for RPMs as well. Some time ago the Nginx company has started to distribute their server package in RPMs as well. And while the CentOS distribution still only offers Nginx 1.8 (with SPDY, without HTTP2), we were able to update to Nginx 1.9.5 which added HTTP/2 support, using the RPM packages of the Nginx site itself.
Switching from SPDY to HTTP/2 is dead-easy. Simply replace the keyword
spdy (provided it is there) with
http2, or otherwise append
http2 to your
listen 443 ssl http2
We have not measured results that much, but do know that are site is served superfast to a wide range of clients that support HTTP/2.
PHP 7 with Joomla and Magento
Another step forward we made was with PHP 7. Our site runs Joomla and Magento, and our backends (Joomla Administrator, Magento Admin Panel) are served via separate URLs and separate PHP-FPM instances. Following from this, there are 4 PHP-FPM instances that serve our site (Joomla/Magento backend/frontend) and this allowed us to migrate slowly to PHP 7. First we switched PHP 7 on within the Magento frontend (where it mattered most). Next we switched it on for the Joomla frontend. It is still switched off for the Joomla backend because of some session issues we had in the past, while the Magento backend was switched about a month ago.
On our server, PHP 7 and PHP 5.6 are both installed. The default of our CentOS distribution is PHP 5.4 (ouch). To install PHP 7 and PHP 5.6 we used the Yum repository of
remi. The default PHP-FPM instance connects to the default PHP install (PHP 5.6), while we simply created a new PHP-FPM service (init style, not Systemd yet) to also offer PHP 7 but on a different port: Not port 9000 but port 9703 (to also identify that we are actually running PHP 7.0.3). Additionally, we use UNIX sockets.
Joomla 3.5 and Magento 1.9 with Inchoo patch
To prepare Joomla for PHP 7 support, we tried to hack our way with Joomla 3.4 but faced the issue that
String is a reserved word in PHP 7 while it is also used as class-name in Joomla 3.4. Instead of rewriting too many things, we are simply running Joomla 3.5 since the first beta came out: It's also a great test to see if Joomla 3.5 is stable and in our opinion it is (though it isn't).
As for Magento 1.9, there are various patches to make it compatible with PHP 7. We prefer the
Inchoo_PHP7 module which installs smoothly and simply works.
Switching off FastCGI cache
Currently with PHP 7, pages are loading fast - the default for many Joomla / Magento pages is around 500-1000ms per page (TTFB, in other words the HTML document). Our site still suffers from a cold cache issue in Zend OPCache (don't how to fix this yet) leading to pages around 300 ms but dropping down to 100-150ms when served with full Zend OPcache.
Earlier, we implemented additionally a Full Page Cache mechanism using FastCGI caching in Nginx. This was great with loading times around 20-30ms, but it sucked in its configuration: The FastCGI cache needed to be configured within Nginx, and the Nginx syntax is simply not that intuitive and flexible. Since we are now loading faster pages anyway with PHP 7, we decided to turn off the FastCGI cache, leading to yet slower pages.
We are still planning to implement Varnish somewhere this year, leading again to results even faster than with FastCGI caching, but also with a much more flexible syntax to configure things (VCL).
Hope you enjoyed this overview and hope you can use it to your own advantage!