Benchmarking the CPU of a cloud server

With a virtual or cloud server you get very little information on how fast the processor actually is. A fast processor is an important factor in a fast WordPress site where hundreds of thousands of lines of PHP code need to be executed.

You can gain a rough idea by timing the CPU performing an intensive task like calculating prime numbers or in this instance calculating Pi to 5000 decimal places.

Run the following:

time echo "scale=5000; 4*a(1)" | bc -l

Results:
Ionos VPS L, 4 vCores,  8 GB: 16.660s, 16.775s, 16.804s
DigitalOcean Basic (Cloudways) 1 vCPU, 2 GB: 21.117s, 19.791s, 20.939s
DigitalOcean Basic, 1 vCPU, 2 GB: 23.525s, 26.642s, 29.319s
DigitalOcean Premium, 2 vCPU, 4 GB: 21.384s, 22.779s, 21.587s

ServerPilot Pagespeed Message History

To enable Message History in Pagespeed on a server managed with ServerPilot – useful if you need to diagnose if there are any problems. You need to create a global level config file – adding it for a particular vhost isn’t good enough.

Create a file pagespeed.conf in /etc/nginx-sp/http.d

pagespeed on;
pagespeed MessageBufferSize 100000;
pagespeed FileCachePath /var/cache/pagespeed;
pagespeed Statistics on;
pagespeed StatisticsLogging on;
pagespeed LogDir /var/log/pagespeed;

Create the folder to hold the logs at:

mkdir /var/log/pagespeed;
chmod 755 /var/log/pagespeed;
chown www-data /var/log/pagespeed

This enables Pagespeed for all the sites on the server so if there are any that shouldn’t be using it, you’ll need to add pagespeed off; to a config file in that particular vhost folder.

WordPress WooCommerce SagePay mcrypt

WordPress WooCommerce SagePay Form extension https://woocommerce.com/products/sage-pay-form/ requires the PHP mcrypt extension to operate.

If your site uses this extension and one day stops going through the full checkout process be aware of the following:

mcrypt has been deprecated as of PHP 7.1.0 and will be moved to PECL as of PHP 7.2.0 – this is because it relies upon libmcrypt which is dead and unmaintained since 2007 http://php.net/manual/en/intro.mcrypt.php.

Your host may have disabled the mcrypt extension.

I’ve heard that the WooCommerce SagePay Form extension is currently being updated to use openssl_encrypt so there may be an update soon to rectify this.