Jack Wallen offers tips on configuring Nextcloud for performance that should better meet your demands.
Nextcloud is, hands down, the best on-premise cloud server platform on the market. Not only is it easy to deploy, it’s also reliable and expandable. However, out of the box, you might find the platform’s performance doesn’t quite meet your expectations.
Fear not, there are ways you can eke out a bit more performance from the platform.
Let me offer you up a few tips.
SEE: Managing the multicloud (ZDNet/TechRepublic special feature) | Download the free PDF version (TechRepublic)
What you’ll need
In order to tune Nextcloud, you’ll need a running instance of the platform. These tips should work with any iteration of Nextcloud from 16 on. You’ll also need a user with sudo privileges.
How to enable caching
The first tip is to enable caching on your Nextcloud server. I’ve already covered this in my piece “How to enable caching on Nextcloud 16.” With caching enabled, you increase performance by storing frequently requested objects in memory for faster retrieval. This should be one of the first configurations you take care of, in order to squeeze out as much performance as possible. Do take care, as enabling caching is a bit tricky.
How to enable HTTP2
HTTP2 is the latest HTTP protocol and allows web browsers to send multiple, simultaneous requests to a server. HTTP2 is well supported by Apache, so it’s not at all challenging to enable. This is another issue I’ve tackled before, so you can easily enable HTTP2 on Apache by following the tutorial, “How to enable HTTP/2 Protocol on Ubuntu 16.04.”
How to optimize PHP-FPM
The default PHP-FPM installation on your server might be the cause of excessive load times for Nextcloud–each request for an element is handled by a separate PHP-FPM process. By allowing numerous PHP-FPM processes to run, you should gain a considerable increase in performance. Here’s what you need to do.
Open the necessary configuration file for editing with the command:
sudo nano /etc/php/7.X/fpm/pool.d/www.conf
Where X is your current installed version of PHP.
In that file, you’ll need to look for the following lines:
pm = dynamic pm.max_children = 120 pm.start_servers = 12 pm.min_spare_servers = 6 pm.max_spare_servers = 18
The above configuration changes will work for a server that has 4 GB of RAM and a 1 GB MySQL cache. Edit the above options and save and close the file. Restart apache with the command:
sudo systemctl restart apache2
Once you’ve taken care of the above optimizations, you should find that Nextcloud performs considerably better. As my last bit of advice, you might want to run these on a non-production environment, to ensure you nail the configurations. Once you see the increase in performance, you can then make the changes on your production environment.
Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.