diff --git a/Dockerfile.mariadb b/Dockerfile.mariadb index 4fa40ef286..76d138eeaf 100644 --- a/Dockerfile.mariadb +++ b/Dockerfile.mariadb @@ -4,3 +4,6 @@ FROM mariadb:latest # Set correct permissions for /tmp directory RUN chmod 1777 /tmp + +# Copy custom MySQL configuration file +COPY deploy/my.cnf /etc/mysql/my.cnf diff --git a/deploy/my.cnf b/deploy/my.cnf new file mode 100644 index 0000000000..b44c1c9250 --- /dev/null +++ b/deploy/my.cnf @@ -0,0 +1,13 @@ +[mysqld] +wait_timeout = 28800 +interactive_timeout = 28800 +max_allowed_packet = 256M +innodb_buffer_pool_size = 512M +innodb_log_file_size = 256M +innodb_file_per_table = 1 +innodb_flush_log_at_trx_commit = 1 +innodb_lock_wait_timeout = 50 +innodb_log_buffer_size = 8M +innodb_io_capacity = 500 +innodb_flush_method = O_DIRECT +net_buffer_length = 64K diff --git a/objects/mysql_dal.php b/objects/mysql_dal.php index 589cd7250d..e9b8b038a5 100644 --- a/objects/mysql_dal.php +++ b/objects/mysql_dal.php @@ -36,6 +36,11 @@ global $disableMysqlNdMethods; // this is only to test both methods more easy. $disableMysqlNdMethods = false; +if(isDocker()){ + ini_set('mysql.connect_timeout', 300); + ini_set('default_socket_timeout', 300); +} + /* * This class exists for making servers avaible, which have no mysqlnd, withouth cause a performance-issue for those who have the driver. * It wouldn't be possible without Daan on https://stackoverflow.com/questions/31562359/workaround-for-mysqlnd-missing-driver diff --git a/objects/user.php b/objects/user.php index b93c260b0b..a8c9c2b2e8 100644 --- a/objects/user.php +++ b/objects/user.php @@ -960,7 +960,7 @@ if (typeof gtag !== \"function\") { return $cache; } if (empty($videos_id)) { - _error_log("User::canWatchVideo Video is empty ({$videos_id})"); + _error_log("User::canWatchVideo Video is empty ({$videos_id}) ".json_encode(debug_backtrace())); return false; }