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.
Install new hardware
- (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.
- 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.
- 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.
phpMyAdmin and / or php cannot operate with two MariaDB versions located on different volumes.
If you need to retain version 5 you must include it in the transfer process.
In these instructions wherever I mention MariaDB or MariaDB10, I also mean that to include MariaDB 5.
b) Select the box that says "Check the backup can be restored"
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.
b)Select the box that says "Check the backup can be restored"
Move MariaDB to new volume
- 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
- Now reinstall them.
- The Package Center installation process will prompt you for the volume on which installation should take place.
- Choose the SSD volume.
- Use Hyper Backup to restore the database content.
- At this stage your websites should be functioning again.
- 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
This step is essential because WordFence writes the volume name to various files including .htaccess. Unless these modifications are reversed any WordPress sites that use WordFence will return a fatal error because they will refer to the old volume.
The error message will be something like this:
"Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0 Fatal error Unknown: Failed opening required '/volume1/web/xxxxxx/wordfence-waf. php‘ (include_path=7) in Unknown on line 0"
- Stop the various services that use the /web folder.
- If you’re not sure which services are affected then the simplest way to find out is try to move the folder.
- The process will pause and tell you which services need to be stopped.
- 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.
- Here is a sequenced list of the services I had to stop (your list might differ):
- Apache 2.2
- Apache 2.4
- Web Station
- php 5.6
- To move the folder follow this path:
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
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.
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.