For the past two or so months I have been struggling with database problems. Out of the blue the database locks up and a systemctl restart mariadb
will not do. It’ll do nothing. Also a reboot
will not help as the mariadb service cannot properly shut down. All I can do is a power cycle to reboot my database server.
Looking into the current state of affairs with MariaDB [(none)]> show processlist;
gives me a list of very long running processes that somehow get stuck. They vary. Sometimes it’s something related to preferences, sometimes to file caches but the list gets quite long as I think all of them were started at some point but couldn’t finish.
This behaviour started I think with NC 28 but could have been the last version before that. I always updgrade as soon as updates are available. Will give more details further on.
I started with Mariadb 10 on the same server as nextcloud but then moved my database to a different server when I thought my initial db was corrupt. I tehn upgraded to mariadb 11 assuming it might help.
Before I move on to migrate all my data to Postgresql I thought I might ask here if there is any help available to fix this.
You will see that I’m running the enterprise version which is correct. We have a license but it’s without support since we’re a school and don’t have paid support.
There are about 100 active users of the nextcloud.
My Mariadb:
Server version: 11.2.3-MariaDB-1:11.2.3+maria~ubu2204-log mariadb.org binary distribution
My NextCloud:
sudo -u www-data php occ config:list system
{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [ some servers ],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "28.0.3.3",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"logtimezone": "UTC",
"installed": true,
"ldapIgnoreNamingRules": false,
"ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
"memcache.local": "\\OC\\Memcache\\APCu",
"memcache.distributed": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 6379
},
"maintenance": false,
"theme": "",
"loglevel": 0,
"log_rotate_size": 104857600,
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_smtpmode": "smtp",
"mail_sendmailmode": "smtp",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtpsecure": "ssl",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "465",
"mail_smtpauthtype": "LOGIN",
"mail_smtpauth": 1,
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"mysql.utf8mb4": true,
"app_install_overwrite": [
"external",
"cms_pico",
"files_readmemd",
"githubmergetracker",
"calendar",
"bruteforcesettings",
"bbb"
],
"overwrite.cli.url": "https:\/\/nextcloud.example.de",
"htaccess.RewriteBase": "\/",
"apps_paths": [
{
"path": "\/var\/www\/nextcloud\/apps",
"url": "\/apps",
"writable": false
},
{
"path": "\/var\/www\/nextcloud\/apps2",
"url": "\/apps2",
"writable": true
}
],
"updater.release.channel": "enterprise",
"default_phone_region": "DE",
"updater.server.url": "https:\/\/updates.nextcloud.com\/customers\/J3CWG-94D1Q-QCLLJ-A6V9Y-PJSIR\/",
"maintenance_window_start": "1"
}
}
and my.cnf:
[client]
default-character-set = utf8mb4
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
log_error=/var/log/mysql/mysql_error.log
nice = 0
socket = /var/run/mysqld/mysqld.sock
[mysqld]
# performance_schema=ON
basedir = /usr
# bind-address = 127.0.0.1
bind-address = 0.0.0.0
binlog_format = ROW
character-set-server = utf8mb4
collation-server = utf8mb4_general_ci
datadir = /var/lib/mysql
default_storage_engine = InnoDB
expire_logs_days = 2
general_log_file = /var/log/mysql/mysql.log
innodb_buffer_pool_size = 2G
innodb_log_buffer_size = 32M
innodb_log_file_size = 512M
innodb_read_only_compressed=OFF
join_buffer_size = 2M
key_buffer_size = 512M
lc_messages_dir = /usr/share/mysql
lc_messages = en_US
log_bin = /var/log/mysql/mariadb-bin
log_bin_index = /var/log/mysql/mariadb-bin.index
log_error = /var/log/mysql/mysql_error.log
log_slow_verbosity = query_plan
log_warnings = 2
long_query_time = 1
max_connections = 100
max_heap_table_size = 64M
myisam_sort_buffer_size = 512M
port = 3306
pid-file = /var/run/mysqld/mysqld.pid
query_cache_limit = 0
query_cache_size = 0
read_buffer_size = 2M
read_rnd_buffer_size = 2M
skip-name-resolve
socket = /var/run/mysqld/mysqld.sock
sort_buffer_size = 2M
table_open_cache = 400
table_definition_cache = 800
tmp_table_size = 32M
tmpdir = /tmp
transaction_isolation = READ-COMMITTED
user = mysql
wait_timeout = 600
[mysqldump]
max_allowed_packet = 16M
quick
quote-names
[isamchk]
key_buffer = 16M
If I forgot something plase let me know so I can update this post. Thank you very much for looking into this.