• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » HHVM WordPress (Nginx Ubuntu Server) Tweaks

By Abhishek Ghosh January 5, 2015 8:09 pm Updated on January 5, 2015

HHVM WordPress (Nginx Ubuntu Server) Tweaks

Advertisement

Here are some special HHVM WordPress (Nginx Ubuntu Server) Tweaks for Page Speed optimization, Compatibility of WordPress Themes and Plugins. PHP is itself quite pathetic performer and together with MySQL and WordPress uses peculiar outdated database in more odd way. To run a website with WordPress with 5K+ posts is not quite cost effective. Apache2 is not actually very bad web software, Apache itself has own Free Software License with huge documentation, Nginx entered for less need of complicated backend configuration for optimal page speed at somewhat budget. Additionally, Nginx plays better for websites with HSTS.

 

HHVM WordPress (Nginx Ubuntu Server) Tweaks : Basics

 

We have written about the theoretical part of HipHop Virtual Machine (HHVM). We have published guide on how to install WordPress with HHVM and Nginx backend on Ubuntu Cloud Server.

We prefer separate database server for WordPress. We use XCache and W3 Total Cache.

Advertisement

---

Ultimately, all need to use a Cache plugin, even after huge tweak on the part of MySQL. So, at minimum; we are using :

01 x 8GB server (front end web server) plus 01 x 4GB server (Application / database server) for a HSTS website with 100K hits per month.

The need of higher RAM of front end web server is to increase the number of virtual cores to quickly write the HTML files after flashing the W3TC cache (all cache). Most Cloud Computing IaaS providers has number of cores for 2GB and 4GB instances except IBM / Softlayer. For a blog, the cost is sadly too high. HHVM actually does not really decrease any running cost, compared to PHP5-FPM. But it significantly a better compilation than default PHP5-FPM.

The developers of WordPress, including Matt Mullenweg actually fight with handing traffic load. We have not spend enough time with the new version of HHVM, but it is apparently better than native PHP5-FPM. With our previously linked guide, which is minimally optimized, you will get a speed like this :

Vim
1
2
http://www.webpagetest.org/result/150105_8P_YCQ/1/details/
# Hosting is HP Cloud

PHP-FPM actually win in the real life high concurrency test for WordPress.
Some WordPress Plugins and Theme Framework can fail, we need some basic tweaks on WordPress part.

Advantages of HHVM can be summarized as :

  1. Has Hacks
  2. Native JIT Compilation Support
  3. FastCGI Support
  4. Most PHP Frameworks We Ever Need For WordPress Actually Works

 

If you install HHVM-Nginx-WordPress in our way, switching back to Nginx-PHP5-FPM is just commenting two lines, uncommenting one line and running service nginx reload command. In the /etc/nginx/sites-available/default you need to comment out the include hhvm.conf line and PHP to listen to port 9000. Uncommenting is for listening to PHP UNIX socket and reload Nginx – thats enough to switching back to Nginx-PHP5-FPM. Yeah, both are actually quite closer.

 

HHVM WordPress (Nginx Ubuntu Server) Tweaks

 

HHVM WordPress (Nginx Ubuntu Server) Tweaks

Basic cheat sheet is to edit this file :

Vim
1
./wp-includes/wp-db.php

wp-db.php has a bug with HipHop for WordPress. WordPress (pseudo) Gurus know it, but kept it :

Vim
1
https://core.trac.wordpress.org/changeset/27377

That object, if written in various ways, can have 3 variations. So, for the newest version; you will get something like :

Vim
1
2
define( 'OBJECT', 'OBJECT' );
define( 'object', 'OBJECT' );

It is nearly within first few blocks, you can find by simple scrolling. We comment out in PHP in this way :

Vim
1
2
//define( 'OBJECT', 'OBJECT' );
//define( 'object', 'OBJECT' );

And add this block :

Vim
1
2
3
define('OBJECT', 'OBJECT');
define('Object', 'OBJECT');
define('object', 'OBJECT');

Yes, you can add only define('Object', 'OBJECT');, but; you can later forget what you have changed. This will have to be done anytime you update WordPress. Sad. If you have JQuery or TinyMCE (where we write the post – post editor) giving error, you will add this at the end of wp-config.php :

Vim
1
define('SCRIPT_DEBUG', true);

Recursively CHMOD wp-content directory :

Vim
1
sudo chmod 775 /check/path/to/your/wp-content -R

Cache Plugin, Nginx and HHVM all probably start thinking a bit more if only we keep with root:www-data CHOWN value. It makes the Cache writing faster with huge number posts. A bit wider open value probably decreases the needed amount of logical work by the virtual processor. You can test to check with webpagetest.org. Insane logic but works. Basically – Nginx, HHVM, MySQL are not written for WordPress, if WordPress developers do not think to freshly write for the database, neither interested for changing from PHP to a some practical language like Ruby or Python, these sadness will continue.

Thats why for smaller blogs, OctoPress or Jekyll are better. There are Python based web softwares too, which are kind of closer to WordPress.

WordPress beats at user Interface – everyone can use. But, practically changing from WordPress site with 5K posts to kind of closer to WordPress, closer to Django is not practical, so these hundreds of tweaks will continue until a stable option arrives. We are actually serving HTML pages with the cache plugins but obviously if the PHP scripts are NOT executed, you will get 500 server error or 502 server error. 25% or may be lesser part for a cached pageHp part at fontend. Non cached page will be slower as expected, PHP or PHP like, is not really Python. If Facebook knew how to automatically change PHP made material to Python, they would not develop HHVM! So, if we keep an eye on Facebook, we can speed up WordPress. Facebook is C, D, P -> C++, D Language and PHP. That PHP went to HHVM, because they were fighting with increasing capability of their Datacenter! But, essentially Google never needed to change the way. Blogger is written in Python and 100% closed source software.

Tagged With wordpress nginx optimization , speed up wordpress nginx , nginx hhvm wordpress

This Article Has Been Shared 185 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to HHVM WordPress (Nginx Ubuntu Server) Tweaks

  • Cloud Server Hosting in a NutShell

    Cloud Server Hosting is nothing but a part of Cloud Computing which is delivered from a cluster Cloud Server. Let us see various points of Cloud Server Hosting.

  • Install QR Code Generator on Rackspace Cloud Sites

    Install QR Code Generator on Rackspace Cloud Sites of your own on Rackspace Cloud Sites within few minutes. Who needs a third party to generate QR Code again !

  • Cloud Server, Bandwidth, Storage and Network

    Cloud Server, Bandwidth, Storage and Network ideally should be delivered as API based fully scalable separate services. These are important to choose provider.

  • Keyless Door Unlocking Mobile Cloud Based Apps : Gaining More Interest

    Keyless Door Unlocking Mobile Cloud Based Apps like Lockitron, ShareKey are growing interest from both the developers and the users. Let us have a deeper look.

  • Zend Opcache Optimization for Nginx Ubuntu (HP Cloud)

    Here is Full Guide to Zend Opcache Optimization for Nginx PHP5-FPM for Ubuntu Server Running on HP Cloud. We Suggest to Use Zend Opcache over APC.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Cyberpunk Aesthetics: What’s in it Special January 27, 2023
  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023
  • What is Vehicular Ad-Hoc Network? January 24, 2023
  • Difference Between Panel Light, COB Light, Track Light January 21, 2023

About This Article

Cite this article as: Abhishek Ghosh, "HHVM WordPress (Nginx Ubuntu Server) Tweaks," in The Customize Windows, January 5, 2015, January 29, 2023, https://thecustomizewindows.com/2015/01/hhvm-wordpress-nginx-ubuntu-server-tweaks/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT