Timeout / Hang when accessing folders or syncing using client

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2): NextCloud 13.0.4
Operating system and version (eg, Ubuntu 17.04): Ubuntu 16.04.4 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.18 (Ubuntu)
PHP version (eg, 7.1): 7.0

The issue you are facing: My nextcloud timeout whenever i access folders or sync using the nextcloud client. I’m not sure if its my hardware issue because i never have this problem. There are about 7 users accessing it.

describe hadrware please … cpu/ram/disks

bandwith / provider / …

also,

  • apache2 site-enables conf
  • ssl conf
  • php-fpm conf

I am using my own server with Intel® Xeon® CPU E5-2603 v2 @ 1.80GHz, total of 16GB of Ram and at least 3TB of disk.

apache2 site-enabled.conf:

<VirtualHost *:80>
 DocumentRoot "/var/www/nextcloud"
 ServerName cloud.myserver.com

 ErrorLog ${APACHE_LOG_DIR}/error.log
 CustomLog ${APACHE_LOG_DIR}/access.log combined

<Directory /var/www/nextcloud/>
  Options +FollowSymlinks
  AllowOverride All

 <IfModule mod_dav.c>
  Dav off
 </IfModule>

 SetEnv HOME /var/www/nextcloud
 SetEnv HTTP_HOME /var/www/nextcloud

</Directory>

RewriteEngine on
RewriteCond %{SERVER_NAME} =cloud.myserver.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

ssl conf:

<IfModule mod_ssl.c>
<VirtualHost *:443>
 DocumentRoot "/var/www/nextcloud"
 ServerName cloud.myserver.com

 ErrorLog ${APACHE_LOG_DIR}/error.log
 CustomLog ${APACHE_LOG_DIR}/access.log combined

<Directory /var/www/nextcloud/>
  Options +FollowSymlinks
  AllowOverride All

 <IfModule mod_dav.c>
  Dav off
 </IfModule>

 SetEnv HOME /var/www/nextcloud
 SetEnv HTTP_HOME /var/www/nextcloud

</Directory>

<IfModule mod_headers.c>
     Header always set Strict-Transport-Security "max-age=15768000; preload"
</IfModule>
Include /etc/letsencrypt/options-ssl-apache.conf
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/privkey.pem
</VirtualHost>
</IfModule>

so far so good…

php-fpm ?

i did not install php-fpm. is it the reason for the timeout?

Well, php-fpm is not mandatory.

PHP-FPM is PHP’s FastCGI implementation. FastCGI is a “better CGI” - CGI is known to be slow, Fast CGI is a different approach with much faster results:

PHP-FPM runs as a standalone FastCGI server and Apache connects to the server using Apache’s module, usually mod_fcgid or mod_fastcgi; I personally think this is much better than running as mod_php, but it depends on your requirements and is also a little more complex. But usually, it is said that php-fpm can boost a website and make it 350% more responsive.

Your “timeout” can be due to slow scripts within nextcloud. Witch definitely can be “accelerated” by using php-fpm.

Otherwise, check your boot journal to see if there is any error concerning your IDE/SATA
Then, do a smart check of your harddrive.

All the standard configuration from the docs is for mod_php, so it should be good to run it. And with apache, there shouldn’t be huge problems regarding performance either (the main critical point is that is runs with default webserver-permissions but if it is the only service on the webserver it shouldn’t be a problem either.

If there is a timeout, we need more information you can probably find in some of your logfiles (webserver, nextcloud, php, mysql). It is important to know why there is a timeout, it might a time span being too short (connection timeout, script running time, …) but it could also indicate to a different issue that e.g. your database cache is too small, or you haven’t enabled caching (redis, apcu), …

my log files do not show any error. nextcloud hands whenever i sync on my desktop client. the desktop client will says checking files. Then it stops and then connection timeout. in the logs, there will be lots of PROPFIND request and it stops after connection timeout.

this is my config.php for nextcloud.

  <?php
    $CONFIG = array (
      'instanceid' => '**',
      'passwordsalt' => '**',
      'secret' => '**',
      'trusted_domains' =>
      array (
        0 => 'ip address',
        1 => 'cloud.domain.com',
      ),
      'datadirectory' => '/var/lib/nextcloud/data',
      'overwrite.cli.url' => 'https://cloud.domain.com',
      'htaccess.RewriteBase' => '/',
      'dbtype' => 'mysql',
      'version' => '13.0.4.0',
      'dbname' => 'nextcloud',
      'dbhost' => 'localhost',
      'dbport' => '',
      'dbtableprefix' => 'oc_',
      'dbuser' => 'nextclouduser',
      'dbpassword' => 'password',
      'installed' => true,
      'memcache.distributed' => '\\OC\\Memcache\\Redis',
      'memcache.local' => '\\OC\\Memcache\\Redis',
      'memcache.locking' => '\\OC\\Memcache\\Redis',
      'redis' =>
      array (
        'host' => '/var/run/redis/redis.sock',
        'port' => 0,
        'timeout' => 0.0,
      ),
      'maintenance' => false,
      'theme' => '',
      'loglevel' => 4,
      'updater.release.channel' => 'stable',
    );