Page 1 of 1

mysql crashed tables

Posted: Mon Mar 23, 2020 2:59 pm
by gregwhite
Every couple of months we are seeing an error that a table has crashed on mysql. We run the repair procedure and everything is fine. Is it possible to know what caused it? Should we be concerned? We have the database offloaded to another server to maximize performance. We are a healthcare facility and depend on Nagios to be up and running.
Thanks for any insight.

Greg

Re: mysql crashed tables

Posted: Mon Mar 23, 2020 4:40 pm
by Box293
Normally we notice crashed tables when the server becomes overloaded however in your case the database is offloaded so I suspect in this case the SQL server is running fine. However you should check the logs on this server to see if everything is OK.

Does your Nagios XI server have sufficient resources? Disk / Memory / CPU ?

How many hosts / services do you have? To find this out go to Admin > System Config > System Profile and click the View System Info button.

Re: mysql crashed tables

Posted: Tue Mar 24, 2020 2:51 pm
by gregwhite
Thanks for your response. Below is the information on hosts and services.
nagios (pid 2326) is running...
npcd (pid 3660) is running...
ndo2db (pid 3733) is running...
CPU Load 15: 6.11
Total Hosts: 2446
Total Services: 14933
Function 'get_base_uri' returns: http://sherlock/nagiosxi/
Function 'get_base_url' returns: http://sherlock/nagiosxi/
Function 'get_backend_url(internal_call=false)' returns: http://sherlock/nagiosxi/includes/compo ... rofile.php
Function 'get_backend_url(internal_call=true)' returns: http://localhost/nagiosxi/backend/

Server statistics

Server Statistics
Metric
Value
Load
1-min 5.28
5-min 5.39
15-min 5.71

CPU Stats
User 25.75%
Nice 0.00%
System 10.91%
I/O Wait 7.51%
Steal 0.00%
Idle 55.84%
Memory
Total 23996 MB
Used 19,169 MB
Free 4,827 MB
Shared 42 MB
Buffers 294 MB
Cached 16,589 MB
Swap
Total 12,063 MB
Used 59 MB
Free 12,004 MB

Re: mysql crashed tables

Posted: Tue Mar 24, 2020 4:37 pm
by lmiltchev
Every couple of months we are seeing an error that a table has crashed on mysql. We run the repair procedure and everything is fine. Is it possible to know what caused it?
Database corruption is usually caused by power outages, running out of disk space or improper shutting down the Nagios XI server. Nagios is constantly reading from and writing to the mysql database, so killing the mysqld process (i.e. with "kill -9" or "killall mysqld") will lead to crashed tables.
Should we be concerned? We have the database offloaded to another server to maximize performance.
Usually running the repair script fixes the issue. You may have to implement some other boosting performance steps, e.g. ramdisk (in order to reduce I/O wait). You can view a full list of things you can do to improve performance here:

https://assets.nagios.com/downloads/nag ... p#boosting

Hope this helps.