Updated : links to the new home for the linaro based server image and nginx armhf debs.
In science being able to reproduce results outside of the lab is essential. I thought I would try and reproduce the performance results of this blog post about a high performance word press server using an ARM device. I’ve made updates based on Linaro images, and have prebuilt armhf debs for nginx besides a few setup things.
In my case I’m using a Panda ES which is of course a dual core cortex A-9 omap4 4460 with 1 Gig of RAM.
Let’s get started.
- Download the lnmp-server image from here.
- Boot the image
- apt-get update
- apt-get install mysql-server (but sure to set the server password and remember it!)
- Download nginx-common_1.2.1-0ubuntu0ppa1~precise_all.deb and nginx-full_1.2.1-0ubuntu0ppa1~precise_armhf.deb from here.
- dpkg -i nginx-common_1.2.1-0ubuntu0ppa1~precise_all.deb nginx-full_1.2.1-0ubuntu0ppa1~precise_armhf.deb
- apt-get install -f (this will pull in various deps that nginx needs)
- mysql -u root -p
- Enter CREATE DATABASE wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO “wp_user”@”localhost” IDENTIFIED BY “ENTER_A_PASSWORD”;
- apt-get install php5-fpm php-pear php5-common php5-mysql php-apc
- edit /etc/php5/fpm/php.ini
- add to the bottom
[apc] apc.write_lock = 1 apc.slam_defense = 0
- edit /etc/php5/fpm/pool.d/www.conf
listen = 127.0.0.1:9000
listen = /dev/shm/php-fpm-www.sock
- and then add
listen.owner = www-data listen.group = www-data listen.mode = 0660
- edit /etc/nginx/nginx.conf
- In the http section add
# server_names_hash_bucket_size 64;
- edit /etc/nginx/conf.d/drop and place the contents of this link into the file
- edit /etc/nginx/conf.d/default.conf and place the contents of this link into the file
- Within the same file, change all instances of domainname.com to your appropriate domain.
- mkdir -p /var/www/
chmod 775 /var/www
- service nginx start
- service php5-fpm restart
cd /tmp wget http://wordpress.org/latest.tar.gz tar xfz latest.tar.gz mv wordpress/* /var/www/
- cp /var/www/wp-config-sample.php /var/www/wp-config.php
- edit /var/www/wp-config.php
- Visit this link and replace the fields in file with the values produced by the web page
- In the same file replace the following
define('DB_NAME', 'wordpress'); define('DB_USER', 'wp_user'); define('DB_PASSWORD', 'whatever you entered for a password');
- Visit http://www.yourdomainname.com/wp-admin/install.php
- Fill in the fields appropriately
- Afterwords, log in
- Go to settings -> permalinks, select custom structure and enter
Then hit “Save Changes”
Now we are to a point where you can run your system by creating a first post and doing some testing with ab. I did so and at this point found the numbers weren’t that great.
Time to start to enable caches. Goto the admin page, select plugins, and then install new plugin. Search for the “W3 Total Cache” plugin and install it. After this is complete click on active plugin.
Now select the performance menu on the left on side. For all the entries, if you have an option to choose “PHP APC” do so. You’ll also need to specifically enable:
Database Cache Object Cache
Save all settions, and the select deploy.
Again at this point you can run ab and collect performance data. I can see from my data that things are much improved and replicating nicely. Data and pretty graphs tomorrow. But I’m far from being done yet. Stay tuned!