Struggling with slow file uploads in Nextcloud? You’re not alone. Whether it’s a sudden stall or a slow drag, sluggish file transfers can mess up workflows and annoy users. But don’t worry, fixing this usually involves tweaking a few settings here and there.

In this guide, I’ll lay out some real-world steps to help you out. We’ll tackle PHP limits and other key factors that can slow down your upload speeds. Soon enough, you’ll be able to adjust these settings confidently and enjoy faster file transfers on Nextcloud.

Understanding Slow Uploads in Nextcloud

If your file uploads are crawling instead of cruising, there are usually some technical gremlins at play. Often, it’s down to PHP settings or less-than-ideal server configurations that choke file transfers. Fixing them means taking a closer look at your setup.

The Role of PHP Limits

Nextcloud relies heavily on PHP to handle files, being a PHP-based app and all. Two limits you need to keep an eye on are:

  • upload_max_filesize: Caps the largest single file the server will accept.
  • post_max_size: Limits the total size of post data, including files.

If these are set too low, big file uploads might fail or freeze randomly. I’ve seen servers out of the box with limits like 2MB or 8MB, which isn’t practical if you’re dealing with larger files like media.

Signs of Slow Uploads

  • Files take forever, often creeping up at a low speed.
  • Uploads give up halfway with no warning.
  • Nextcloud flashes timeouts or “connection lost” messages.
  • High CPU or memory spikes during uploads.
  • Big files never seem to finish uploading.

These point to PHP limits, or server timeouts and memory constraints being too tight.

Time to peek at your PHP environment using phpinfo(); in a file or command line tools. This shows current settings for upload_max_filesize, post_max_size, max_execution_time, and memory_limit.

Here’s what I usually aim for:

ParameterRecommended MinimumWhy It Matters
upload_max_filesizeAt least 100MAllows bigger file uploads
post_max_sizeSame as upload_max_filesizeEnsures file data fits in POST requests
max_execution_time300 seconds or moreKeeps scripts from timing out on big uploads
memory_limit256M or higherHandles PHP’s memory needs properly

Below these thresholds, you’re likely to hit slow upload or failure issues.

Adjusting PHP Limits

Typically, you’ll find PHP limits in a php.ini file. Here’s how I often set these for Nextcloud on a Linux server:

upload_max_filesize = 200M
post_max_size = 200M
max_execution_time = 360
memory_limit = 512M

Make sure to restart your web server (like Apache or Nginx) for changes to stick. If PHP-FPM is in play, restart its service too.

Boosting Upload Speed Through Nextcloud Configurations

PHP limits are one part, but tweaking Nextcloud can also ramp up upload speeds.

Enable Upload Chunking

Chunking breaks large files into smaller pieces for uploading. This helps evade timeouts and manages memory better.

In your Nextcloud config folder, check config.php for these lines:

'upload_chunksize' => 10485760, // 10 MB chunks

Default is 10MB, but adjust based on your server’s strength. Chunking cuts down on slow uploads, particularly with shaky networks.

Use Redis for File Locking and Caching

Nextcloud uses locking to avoid file conflicts, which can slow things down if sluggish. Set up Redis for caching and locking to boost performance.

Add this to config.php:

'memcache.locking' => '\OC\Memcache\Redis',
'redis' => [
  'host' => 'localhost',
  'port' => 6379,
],

This move can significantly bump up upload speeds. I’ve seen around a 20-30% lift in medium-sized setups just by adding Redis.

Network and Server Considerations

Beyond PHP and Nextcloud, network and server hardware can limit upload speeds.

Bandwidth and Latency

Your available network bandwidth impacts max upload speed, but latency (communication delays) and jitter can lead to slow uploads or restarts.

If everything software-wise checks out, assess:

  • Your server’s network bandwidth (both ways).
  • Any network congestion on server or user’s end.
  • If ISP or firewall is throttling traffic.

Tools like speedtest-cli can help measure network speed directly from the server.

Disk I/O Performance

Nextcloud uploads involve writing temporary and permanent files, so slow disks can bottleneck your uploads.

Consider upgrading to SSDs or tuning your disk IO scheduler. Tools like iotop and iostat show disk activity during uploads.

Web Server Configurations

Web server settings like buffer sizes, timeouts, and max request sizes also come into play.

For instance, in Nginx:

client_max_body_size 200M;
client_body_timeout 60s;

Ensure these are in sync with your adjusted php.ini and Nextcloud settings.

Case Study: Solving Slow Uploads in a Medium-Sized Office

In a 50-person company using Nextcloud for file sharing, big uploads took ages. Here’s what we found:

  • PHP upload_max_filesize was at 16M
  • post_max_size was also 16M
  • max_execution_time set at a mere 30
  • Chunked uploads? Nope.
  • Redis? Not used.

Here’s what we did:

  1. Upped upload_max_filesize and post_max_size to 200M.
  2. Set max_execution_time to 360 seconds.
  3. Turned on chunked uploads, using 10MB parts.
  4. Added Redis for caching.
  5. Tweaked Nginx and firewall settings.
  6. Checked and bumped up network bandwidth.

Outcome: Uploads for 100MB files went under 3 minutes, with no errors or timeouts. Users reported smoother, consistent speeds without hiccups.

Keeping Security in Mind

While you work on speeding things up, don’t forget about security.

  • Always use HTTPS for safe data transit.
  • Set file upload limits and scan for any malware.
  • Regularly update Nextcloud and PHP with security patches.
  • Watch your server logs for any odd uploading activity.

Security remains vital; it guards data without slowing it down.

Quick Summary: Fix Your Slow Nextcloud Upload Issues

  1. Raise PHP limits (upload_max_filesize, post_max_size, etc.).
  2. Turn on upload chunking in Nextcloud.
  3. Set up Redis for caching and file locking.
  4. Optimize your web server’s request sizes and timeouts.
  5. Monitor and improve network bandwidth.
  6. Check that disk storage is up to task.
  7. Ensure security as you make changes.

Conclusion

Slow uploads in Nextcloud are often due to set adjustments—mainly PHP limits, server, and networking tweaks. With a bit of tuning, you’ll get back to the speeds you need. I’ve seen excellent results by following these straightforward steps.

Need a detailed setup guide or more insights? Check out resources or support forums like Dhabaka for practical expertise.

Fixing slow uploads doesn’t mean spending big or overhauling complex systems. It’s about tweaking the right settings and confirming the impact.


Ready to give your Nextcloud uploads a boost? Start by diving into those PHP limits and tweaking Nextcloud’s chunking settings. Get these sorted, then enhance your server and network. Your users will notice the change.

Get in Touch