Releem / mysqlconfigurer

Releem is a simple MySQL tuning tool to improve database performance and reduce servers costs.
https://releem.com
GNU General Public License v3.0
255 stars 27 forks source link

MySQL restart termination #330

Open kochetovd opened 1 month ago

kochetovd commented 1 month ago

The MariaDB service has a stop timeout of 900 seconds. A termination error may occur in a large database mariadb.service: State 'stop-sigterm' timed out. Skipping SIGKILL.

kochetovd commented 2 weeks ago

MariaDB's systemd unit file has a default startup timeout of about 90 seconds on most systems. If a service startup takes longer than this default startup timeout, then systemd will assume that mariadbd has failed to startup, which causes systemd to kill the mariadbd process. To work around this, it can be changed by configuring the TimeoutStartSec option for the systemd service.

A similar problem can happen when stopping the MariaDB service. Therefore, it may also be a good idea to set TimeoutStopSec.

For example, you can reconfigure the MariaDB systemd service to have an infinite timeout by executing one of the following commands:

If you are using systemd 228 or older, then you can execute the following to set an infinite timeout:

sudo systemctl edit mariadb.service

[Service]

TimeoutStartSec=0
TimeoutStopSec=0

Systemd 229 added the infinity option, so if you are using systemd 229 or later, then you can execute the following to set an infinite timeout:

sudo systemctl edit mariadb.service

[Service]

TimeoutStartSec=infinity
TimeoutStopSec=infinity

To check the systemd version, run the command, depending on your version OS:

systemctl --version

kochetovd commented 2 weeks ago

It is necessary to add to the agent the setting of the EXTEND_TIMEOUT_USEC environment variable to increase the timeout of stopping and starting the MariaDB service.

We will add this feature soon.