Slow loading on first access

Nextcloud version (eg, 12.0.2):14.04
Operating system and version (eg, Ubuntu 17.04): 16.04
Apache or nginx version (eg, Apache 2.4.25): 2.4.18
PHP version (eg, 7.1): 7.0.32

The issue you are facing:
On first acces the site after a while, it takes 30 sec up to one minute to load.
Is there a reliable way in nextcloud, what module is waiting?

Is this the first time you’ve seen this error? (Y/N): n

Steps to replicate it:

  1. wait about a day
  2. access site
  3. look at loading

the only what i see is in the apachelog:
Unknown parameter encountered: “SO_RCVBUF”

It seems to refer to my samba share, but is there a tool inside nextcloud to check on what is waiting or working?
Accessing the Sambashare itself works normal too with the filemanager.

I have phpcache and redis in use, after the first wait, the site is working ok.

Not that easily. You can try to increase logging, check the browser tools to see what resources take a long time. Check the processes on your server. In your case, I’d perhaps start with a simply local user without samba or other external shares.
Do you use external authentication (against smb, imap, ldap, …)?

You enabled system cron for background jobs, right? Not that default AJAX is in use which makes your Nextcloud do all stacked background jobs on next web UI access.

I am not sure how this is handled in samba, but might it be possible otherwise that the drive on samba server needs to spin up from idle when accessing after a while? But this should then be the same when accessing the samba share outside of Nextcloud of course. Next idea is Nextcloud scanning external share for file changes, not sure if this is done in background or might delay web UI access as well.

Yes I am using cron for the background jobs, I have a Sambashare and the Mailclient running,
altough isn’t samba only asyncronously connecting if you access the File-Viewer?