OOM on Beaglebone Black (BBB)

Nextcloud version (eg, 12.0.2): 13.0.3
Operating system and version (eg, Ubuntu 17.04): Debian 9 (stretch)
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.25
PHP version (eg, 7.1): 7.0.27

Hi all,

Is there a small RAM config that will best fit my use case?

I am experiencing OOM killers on my BBB. I have a 4 TB WD easystore connected to the BBB. I use the nextcloud app on 2 iphones to sync photos to the server. I haven’t touched the server recently, but I noticed in the apps that there were several errors, and none of my pictures were being uploaded. I can see progress being made on the upload, but then it says there was an error and keeps trying again with the same files.

Tonight I monitored htop on the server and noticed there were over 10 instances of mysql (mariadb) and over 10 instances of apache2 present. I could see the ram get eaten up while a picture was being uploaded, and then one of the processes would get killed.

Checking the status of mysql shows that it was OOM killed.

What’s puzzling to me is that when I first uploaded my picture library (3000+ photos), I didn’t have any errors.

Looking at the pictures that have yet to be uploaded, it looks like this has been going on for about 2 weeks.

The BBB has 512 MB of RAM and I am currently at ~30GB of data storage used.

The output of your Nextcloud log in Admin > Logging:

Most of the errors in this log come down to "General error: 2006 MySQL server has gone away"

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' =>
  array (
    0 => 'mysite.org',
  ),
  'datadirectory' => '/mnt/CloudVirtual/www/nextcloud-data',
  'overwrite.cli.url' => 'https://mysite.org',
  'dbtype' => 'mysql',
  'version' => '13.0.3.2',
  'dbname' => 'mydb_name',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_masteruser',
  'dbpassword' => '',
  'installed' => true,
  'maintenance' => false,
);

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

There is the NextcloudPi project which was focused on the Raspberry Pi but made it available also on other ARM boards:
https://ownyourbits.com/2018/05/29/nextcloudpi-brings-nc13-0-2-automatic-nc-upgrades-rock64-and-banana-pi-support-armbian-integration-chinese-language-and-more/

I am not sure if that works on the Beagle-Bone-Black (check the forum here a bit, perhaps someone tested it already). If you just want some inspiration on the configuration, you can check the source here:

Thank you for the reply. I checked out the source code for the project but didn’t see anything that stood out.

However, I did find out that my apache2 configuration was using the default values for ram and connections, so I changed it to the following and have not had any issues:

# Global configuration
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# ServerLimit: maximum value for MaxClients for the lifetime of the server
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>
  StartServers           2
  MinSpareServers        2
  MaxSpareServers       10
  ServerLimit          256
  MaxClients            10
  MaxRequestsPerChild   10
  MaxClients            10
  MaxRequestsPerChild   10
</IfModule>

By the way, that project is a really awesome idea. It is very convenient that everything can be installed at once. Do you have any recommended resources on where I can learn how to create scripts that do things similar to that project? I’m thinking if I upgrade from the BBB it would be nice to have custom scripts to install everything instead of manually doing each package.

From looking in the repository, I’d guess these are shell scripts. You can use them as inspiration and there are certainly tons of tutorials and stuff for shell scripts. Ansible is a tool dedicated to setups servers: https://en.wikipedia.org/wiki/Ansible_(software)