Server hangs completely every 10min - not even the mouse moves (solved)

Nextcloud brought down my entire server in a way that even the mouse in the physical machine refused to move.

Configuration:

  • Nextcloud 21 on stock Debian Buster (php 7.3)
  • running in LXD Linux Container on a Ubuntu 20.04 server
  • ACPu configured

Observed:

  • every 10 min - when the cron.php runs - memory consumption and CPU on one processor surged and a couple of seconds later, the machine froze. Sometimes it thawed a couple of seconds later, sometimes not.

  • Though the machine has 32G of RAM it got exhausted by the cron.php job

  • limiting the memory for php cli caused cron.php to crash:

      www-data@nextcloud-lxd:~/nextcloud$ php -f /var/www/nextcloud/cron.php 
      PHP Fatal error:  Allowed memory size of 17179869184 bytes exhausted (tried to allocate 20480 bytes) in /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php on line 133
    
  • Disabling ACUp brought help but slowed Nextcloud down

Solution:

Add the following line to /etc/php/7.3/mods_available/apcu.ini

apc.enable_cli=1

That did the job and both Nextcloud and the server run smoothly

PS: wisdom from here: [NC 21] OCC Update error: allowed memory size exhausted · Issue #25742 · nextcloud/server · GitHub

1 Like