I’ve installed Nextcloud as a docker image on my raspberry pi 3b+ with an ssd.
And it is behind traefik (reverse proxy; it is a local storage server for now).
docker-compose files
I’ve got the following Problem:
Uploading many small files is very slow, and based on my research it is because of mysql writing to the database every transaction. What I have to do is change (and probably some others to)
innodb_flush_log_at_trx_commit = 2
which should be inside /etc/mysql/my.cnf .
So I tried changing it by:
mysql -u root -p
then
MariaDB [(none)]> show variables like 'innodb_flush_log%';
+--------------------------------+-------+
| Variable_name | Value |
+--------------------------------+-------+
| innodb_flush_log_at_timeout | 1 |
| innodb_flush_log_at_trx_commit | 1 |
+--------------------------------+-------+
2 rows in set (0.00 sec)
changing the value:
MariaDB [(none)]> set global innodb_flush_log_at_trx_commit = 2;
Query OK, 0 rows affected (0.00 sec)
then checking:
MariaDB [(none)]> show variables like 'innodb_flush_log%';
+--------------------------------+-------+
| Variable_name | Value |
+--------------------------------+-------+
| innodb_flush_log_at_timeout | 1 |
| innodb_flush_log_at_trx_commit | 2 |
+--------------------------------+-------+
2 rows in set (0.00 sec)
BUT after restarting the db container I get:
MariaDB [(none)]> show variables like 'innodb_flush_log%';
+--------------------------------+-------+
| Variable_name | Value |
+--------------------------------+-------+
| innodb_flush_log_at_timeout | 1 |
| innodb_flush_log_at_trx_commit | 1 |
+--------------------------------+-------+
2 rows in set (0.00 sec)
So how do I change those variables inside the container?
I’ve also found the Tuning Primer script as referred by some on the forum (Example), but how should I execute it inside the container? How would I even get it?
Also should I do some sort of redis? Just one user .
.
.
Side question:
When
innodb_flush_log_at_trx_commit = 2
and an outage:
Because the flush to disk operation only occurs approximately once per second, you can lose up to a second of transactions in an operating system crash or a power outage.
[…]
occurs, where lies the problem? Is there a database entry for a file, but no file, or is there no database entry but a file? Couldn’t something like that be fixed by some sort of rescan, like occ maintenance:repair or something like that, with rescheduled syncing?