Are the WordPress sites on your Synology DiskStation a bit sluggish? In this article I describe how I migrated mine to an SSD volume to inject some extra speed.

I run several WordPress sites on my DS916+.  All are WordPress.org installations – I don’t use the official Synology Package because updates take too long to arrive.

I needed to inject some more pace into page loading, especially into the back-end editor, but front-end page loads were also slow at up to 6 seconds.  I could have migrated the sites to hosted locations but where’s the fun and challenge in that?

The DSM resource monitor showed that CPU, RAM and LAN were under no pressure but during WordPress page load, Volume access was maxing out for about seven seconds.  I decided to install some SSDs to reduce the bottleneck.

I originally intended to repurpose a spare DS716+II that I use as a test rig, and dedicate it to running WordPress.  However, all attempts to duplicate the sites to subdomains or Synology DDNS addresses, for testing were unsuccessful because it was not possible to route the traffic to a second DiskStation using Web Station.  It isn’t designed to handle multiple DiskStations.  I decided to cut to the chase and do a straight upgrade on the DS916+.  This is how I did it.

The process

Preparation

Install new hardware

  1. (optional) Install Expansion Unit – a DX513 in my case as I am running a 916+.  Check on Synology.com for the correct unit for your Disk Station.  Make sure the eSATA cable is firmly screwed into place.  That connection needs to be very secure.
  2. Install SSDs.  I chose 2 x 500GB Crucial MX500, based on the Synology compatibility list.  500GB is overkill for my needs because of each of my WordPress sites is only approx 0.6GB but I have bought small in the past, and regretted it later.
  3. Create new volume in DSM > Storage Manager.  I use SHR.  Format the disks using Ext4 format instead of btrfs – it’s more suitable for SSDs.  Leave the volume to complete its parity checks on the drives.  It won’t take long on 2 x 500GB SSDs.

 

Trim folders and databases

Before you start moving large volumes of content,do some housekeeping.

1. Carry out a one-off Hyper Backup of your web folder and MariaDB application in preparation for the next steps.  You can combine the two sources in one backup task.

2.  In File Station, go to your /web folder and look for unwanted WordPress and other web applications.  Delete them.

3. In phpMyAdmin, check for unwanted Users/Databases and drop them.

4. Carry out a new one-off Hyper Backup of your web folder and MariaDB application using a different backup task from step 1 so that we have two restore points, just in case.  It’s essential insurance;  you probably won’t need the earlier one, but will regret it if something happens and you don’t have it.  You will definitely need the later one;  do not proceed any further without it.

Move MariaDB to new volume

  1. This is where it gets a bit scary, because the first thing you need to do is delete the MariaDB package(s) from your DiskStation
  2. Now reinstall them.
    1. The Package Center installation process will prompt you for the volume on which installation should take place.
    2. Choose the SSD volume.
  3. Use Hyper Backup to restore the database content.
  4. At this stage your websites should be functioning again.
  5. You may already notice a performance improvement because the database is running on the SSDs.  However if your website is php based then it’s likely that the large numbers of small php file reads will limit the improvement.

 

Move /web folder to new volume

  1. Stop the various services that use the /web folder.
    1. If you’re not sure which services are affected then the simplest way to find out is try to move the folder. 
    2. The process will pause and tell you which services need to be stopped. 
    3. But the list you are given is not the complete list; some are dependent on other services which must also be stopped.  And they have to be stopped in the correct sequence.  A bit of trial and error is required, and you should make a list of them, because you will need to re-enable them later.
    4. Here is a sequenced list of the services I had to stop (your list might differ):
      1. phpMyAdmin
      2. Apache 2.2
      3. Apache 2.4
      4. Web Station
      5. Calendar
      6. php 5.6
  2. To move the folder follow this path:
How to move a folder between Synologyvolumes

3. Using the list you created in Step 1, re-enable the services in reverse order.

4. Finally, you will need to adjust Web Station’s settings because the virtual host definitions will have lost their link to the correct folders

Synology Web Station - Resetting the virtual hists to use correct folder.

And that’s it, job done!

My page load tines reduced by about 2 seconds, which is a considerable improvement over the near 7 second response I was getting before.  There is more to do, for example upgrading the php version, which will benefit all users.  I am also looking at creating a local DNS server to benefit users on the LAN, so that requests to my domain names can be resolved locally.

Contributors

This guide is based on considerable input from Nathan Poulos from the Synology Admins & Users Facebook group.  If you're not a member you really should join.

Synology Admins & Users Facebook group

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>