Heroku (Shield) and Amazon S3 timeout issues

I have installed nextcloud successfully on heroku, and then to heroku shield. Because of Heroku’s ephemeral drives, we have to use Amazon S3 for file storage and storage of the data directory.

So far, everything seems to work. I can create many users, link external storage (to S3).

However, the overall usage is slow, pausing, and mainly timing out. I’m suspecting its a speed issue with communicating from Heroku to S3.

I’ve tried a number of things, each making it a bit better, a bit faster, less timeouts, but overall still pausing, and timing out.

I’ve tried:

  • switching S3 regions: us-west-2 to us-east-1
  • external Storage, setting ‘check for changes’ to never
  • running php occ files:scan --all ahead of time before usage.
  • using PostgreSQL
  • increasing the dynos from 1-4.
  • added APCu for cache storage
  • adding to .htaccess:
<IfModule mod_php7.c>
  php_value upload_max_filesize 768M
  php_value post_max_size 768M
  php_value memory_limit 1024M
  php_value mbstring.func_overload 0
  php_value default_charset 'UTF-8'
  php_value output_buffering 0
  <IfModule mod_env.c>
    SetEnv htaccessWorking true
  </IfModule>
</IfModule>
  • adding to .user.ini:
upload_max_filesize=2G
post_max_size=2G
memory_limit=2G
mbstring.func_overload=0
always_populate_raw_post_data=-1
default_charset='UTF-8'
output_buffering=0
  • adding to fpm_custom.conf:
php_value[upload_max_filesize] = 2G
php_value[post_max_size] = 2G
php_value[memory_limit] = 2G
php_value[mbstring.func_overload] = 0
php_value[default_charset] = 'UTF-8'
php_value[output_buffering] = 0

php_value[apc.enable_cli] = 1
  • and of course the Procfile reads
web: vendor/bin/heroku-php-apache2 -F fpm_custom.conf server/

I’m not getting any nextcloud errors that can help me to better diagnosis (or, I’m not sure where to get them coming from heroku) other than the fact that it, times-out

I was fairly sure that I did not have this issue using regular heroku, but I don’t believe it was tested long enough to know for sure. It might be a heroku-shield issue.

Thanks for any help!

Eric

I’m not familiar with your specific setup but recommend to setup Redis for holding the file locks. It saw an overall better performance after enabling that function. You will find some more tips here:

https://docs.nextcloud.com/server/14/admin_manual/configuration_server/server_tuning.html