So we have managed to catch what has killed MySQL on one occasion and in this instance it was Litespeed but we have no idea why it did that.
We have a server where MySQL was shut down on 13/04/25 at 19:42:27.
If you look at this Audit log it shows the litespeed process sent the SIGKILL
type=PROCTITLE msg=audit(04/13/25 19:42:27.498:355805) : proctitle=litespeed (lshttpd - main)
type=OBJ_PID msg=audit(04/13/25 19:42:27.498:355805) : opid=56235 oauid=unset ouid=mysql oses=-1 obj=/usr/sbin/mysqld ocomm=ib_io_rd-2
type=SYSCALL msg=audit(04/13/25 19:42:27.498:355805) : arch=x86_64 syscall=kill success=yes exit=0 a0=0xdbb8 a1=SIGKILL a2=0x8 a3=0x748ba6bb1fc0 items=0 ppid=1 pid=2303176 auid=unset uid=root gid=www-data euid=root suid=root fsuid=root e
gid=www-data sgid=www-data fsgid=www-data tty=(none) ses=unset comm=litespeed exe=/usr/local/lsws/bin/lshttpd.6.3.2 subj=unconfined key=sigkill_watch
And then if we look at the litespeed error log for that same time we see this
2025-04-13 19:42:11.703539 [NOTICE] [2303176] [T0] [2303176] Cmd from child: [extappkill:56279:-3:0]
2025-04-13 19:42:11.703566 [INFO] [2303176] [T0] Failed to get process [56279] start time, not running, skip killing.
2025-04-13 19:42:11.703339 [INFO] [2303179] [T0] [192.248.156.201:36770>2.223.152.152#xxxxx.co.uk] Abort request processing by PID:56279, kill: 1, begin time: 3, sent time: 3, req processed: 30
2025-04-13 19:42:11.703345 [NOTICE] [2303179] [T0] sendKillCmdToWatchdog: 'extappkill:56279:-3:0'.
2025-04-13 19:42:12.700474 [INFO] [2303179] [T0] [147.78.3.13:12347-H3:7C275FFA95E3C447-0>213.180.203.204#xxxxx.co.uk] Access is denied by context rewrite.
2025-04-13 19:42:27.390287 [NOTICE] [2303176] [T0] [2303176] Cmd from child: [extappkill:56248:-3:0]
2025-04-13 19:42:27.390396 [INFO] [2303176] [T0] [CLEANUP] Send signal: 15 to process: 56248 (ib_io_rd-2)
2025-04-13 19:42:27.500768 [INFO] [2303176] [T0] [CLEANUP] Process 56248 (ib_io_rd-2) wont stop after SIGTERM, send SIGKILL.
2025-04-13 19:42:27.390135 [INFO] [2303179] [T0] [192.248.156.201:57228>2.223.152.152#xxxxx.co.uk] Abort request processing by PID:56248, kill: 1, begin time: 4, sent time: 4, req processed: 142
2025-04-13 19:42:27.390140 [NOTICE] [2303179] [T0] sendKillCmdToWatchdog: 'extappkill:56248:-3:0'.
We have been capturing all of the running processes every 15 seconds and here is the mysql process just before it was killed (you can see it was running since April 6th)
mysql 56235 5.3 19.2 4997680 3138128 ? Ssl Apr06 498:59 /usr/sbin/mysqld
The 2 processes mentioned in the litespeed error log (56279 & 56248) were not picked up by the process capture so no idea what they were and due to their low id's process id recycling must be in effect.
So litespeed tried to kill 2 processes that did not exist and ended up killing Mysql? I checked our pid_max value and its 4194304 so no issues there.
If this is happening to other users it would explain why we are seeing mysql being terminated for what appears no reason as it is not an OOM kill but a litespeed kill - so, why is litespeed killing mysql?