andreas
November 21, 2019, 8:38am
1
I’ve been running NC15 on Debian9 with PHP7.0-fpm and Apache with HTTP/2, working fine. Two weeks ago, I upgraded the machine to Debian10 with PHP7.3-fpm and NC17, and since then everything takes a lot longer. I’ve got some long-term monitoring, so I can tell that the usual cpu usage on the web server (4 cores) was 1.5% avg before the update, and is up to 20% now (including night time). Simple changing directory in the files app will take about 1 second now, htop shows php-fpm processes creating high cpu usage.
settings/admin/overview shows no problems, memcache.local is APCu, Redis for memcache.locking, no fancy add-ons, nothing in the logs.
Any hints what to inspect next?
Regards,
Andreas
You should probably check if the opcache is active. It could be down to tuning the opcache.
kesselb
November 21, 2019, 11:23am
3
Probably https://github.com/nextcloud/server/issues/17447 (infinite loop with searchdav requests)
Also good to read: https://github.com/nextcloud/server/issues/17241
I would try to patch the instance like in the first issue and check the monitoring. Feel free to join the other issue if that does not work.
andreas
November 21, 2019, 12:04pm
4
Probably not a dav problem, because all requests that don’t involve dav are slow as well.
opcache is enabled and configured as recommended.
Checked: the searchdav-fix doesn’t fix this issue.
andreas
November 21, 2019, 4:52pm
5
One more observation:
The memory usage was around 600MB for php-fpm processes, and is now down to 300MB. Total cpu around 100-200% (but not a single process at 100% stuck, load is coming and going), while it was avg 50% when users are busy.
A test file with phpinfo() shows me healtly opcache values (up&running, very few cache misses, 30% memory used).
TP75
November 21, 2019, 5:56pm
6
Why do you stick to php-fpm
and could you provide a rationale for this, if I may?
Please choose libapache2-mod-php7.3 over php-fpm as a home user certainly.
Happy hacking.
andreas
November 22, 2019, 7:17am
7
mod-php is supported by mpm-prefork only. mpm-worker is required to support http/2
1 Like
Php-fpm is normally much faster than mod_php/cgi versions because the PHP engine remains loaded between each request.
1 Like
TP75
November 22, 2019, 1:32pm
9
IMHO one could do some more thorough research and I posted some links to more background info in this forum already.
However, you are correct and this is a free world.
One could make a connection, I presume.
Furthermore, one could reconsider if:
the “much faster” is a requirement worth the apparent CPU load
the apparent “easy to set up, requires less config” is a positive or a negative
BTW keep it safe, keep it simple is an accepted requirement for a stable system setup, I presume.
Some background info and discussion was provided in two post of same thread:
IMHO installing a sustainable and efficient server is not a simple endeavour. This may not matter most in small scaled service groups and for home users.
“Too many cooks spoil the broth .” & Beware of “quick and dirty.”
First, keep it small and keep it simple. Consider if your Nextcloud installation actualy needs the ‘php-fm’ module as this is the NC home user forum, if I may recall. Trust the true experts in the background and there is good reason for an advice like "Note that most Ap…
Please be aware I have no expertise of my own with NextcloudPi, unfortunately. However, some general advice in the following.
Your system may be without the nginx server and happily away from the a.m. ‘NGINX/php-fpm’ issue. Check for your active webserver with:
sudo systemctl status apache2
This should show your Apache 2.4 on the job or some other info.
You may consult the below article for background information.
Why NextCloudPi uses Apache and not Nginx
Consult the NCP docs on the proje…
Hope this helps.
Happy hacking.
TP75:
Why do you stick to php-fpm
and could you provide a rationale for this, if I may?
Please choose libapache2-mod-php7.3 over php-fpm as a home user certainly.
Happy hacking.
Please provide your rationale. php-fpm is more flexible, the only reason to use mod php is because it’s easy to set up, requires less config.
1 Like
andreas
November 22, 2019, 4:35pm
11
This thread has somewhat diverged from the original topic…
I’d still appreciate hints on how to trace down the problem of the NC installation/code.
kesselb
November 22, 2019, 4:42pm
12
Have you tried to debug php-fpm with gdb/strace? Check https://github.com/nextcloud/server/issues/17241 for some advice.
andreas
November 22, 2019, 5:26pm
13
Didn’t try gdb/strace so far, but just tried the slowdebug with request_slowlog_timeout=1, and getting a lot of hits. Quite often:
password_verify() /var/www/nextcloud/lib/private/Security/Hasher.php:156
which is seems to be the same issue as https://github.com/nextcloud/server/issues/17241 , so I’ll close this and continue there.
3 Likes