Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL restart termination #330

Open
kochetovd opened this issue Jul 27, 2024 · 2 comments
Open

MySQL restart termination #330

kochetovd opened this issue Jul 27, 2024 · 2 comments

Comments

@kochetovd
Copy link
Collaborator

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.

@drupaladmin drupaladmin changed the title Speed up MySQL restart MySQL restart termination Jul 28, 2024
@kochetovd
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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.

kochetovd added a commit that referenced this issue Sep 26, 2024
* Added collect aql_text and explain for all versions db

* #337: Changed path  the log location

* #350: fixed issue

* #330: Increased timeout to service restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant