Solved (mysqld), jid 0, uid 88, was killed: out of swap space

Ofloo

Well-Known Member

Reaction score: 13
Messages: 329

Fresh installed upgraded to FreeBSD 12.1-RELEASE-p5 GENERIC through freebsd-update runs inside bhyve.

kernel: pid 70570 (mysqld), jid 0, uid 88, was killed: out of swap space

Code:
# swapinfo -h
Device          1K-blocks     Used    Avail Capacity
/dev/vtbd0p3      4194268      16M     4.0G     0%

Only mysql is installed an py37-salt, .. tried mysql80-server same issue.

Code:
# mysql --version
mysql  Ver 14.14 Distrib 5.7.30, for FreeBSD12.1 (amd64) using  EditLine wrapper
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 13,123
Messages: 39,719

And tune MySQL/MariaDB properly. Do NOT configure it to use more then 3/4 of RAM (even less if you need to run other applications too). Be careful if you run ZFS, ARC and MySQL are known to battle each other for memory, limit your ARC size to avoid this.

databases/mysqltuner is quite useful for tuning MySQL/MariaDB. Don't take anything at face value though, actually think about what it's telling you to change.
 
OP
Ofloo

Ofloo

Well-Known Member

Reaction score: 13
Messages: 329

Thank you Lamia, Indeed the amount of ram wasn't properly configured, was newly configured bhyve, and i forgot to setup the proper amount.

Richardtoohey2, this happened to all versions i had installed which where mysql57 and mysql80. However mysql80 instantly complained and mysql57 only showed the error in dmesg and message log.

Thank you SirDice I will surely try out that tuner.
 

richardtoohey2

Aspiring Daemon

Reaction score: 347
Messages: 674

I got that it was MySQL 5.7 and 8.0 but I was wondering what you were doing. Nothing, a big query, importing data, lots of small queries, etc.

Doesn't sound like it matters - more RAM seems to have been the answer.
 
OP
Ofloo

Ofloo

Well-Known Member

Reaction score: 13
Messages: 329

Well it was first install, starting the daemon up that's what i was doing. The vm ram was still set to 256mb which is kinda low. But I understand where you're getting from. We used to be able to run a lot more with a lot less. So to me it seems like you should be able to. But reconfiguring the system with a bit more ram did work. Maybe it's a mysql configuration. You probably can run it with that amount of ram but you'd need to tune the settings as SirDice suggested.

So probably mysqld initialize, the thing i don't understand though is that it complains about swap while there's plenty of it. Maybe bad error handling.
 

water

New Member


Messages: 1

same problem here

Aug 2 01:09:59 kernel: pid 1998 (mysqld), jid 0, uid 81, was killed: out of swap space
Aug 2 01:13:08 kernel: pid 1009 (mysqld), jid 0, uid 81, was killed: out of swap space

trying to run MySQL 8.0 on a 512M machine.

Code:
Device          512-blocks     Used    Avail Capacity
/dev/md99          2097152      15M     1.0G     1%

mysql Ver 8.0.19 for freebsd12 on amd64 (MySQL Community Server - GPL)
 

PMc

Daemon

Reaction score: 694
Messages: 1,394

I was fighting with the same problem today, with another application.

The difficulty is:
was killed: out of swap space
does not neceesarly mean
was killed: out of swap space
Instead, it could mean: "no data was found in memory that could be moved to swap". (probably there should be a better message)

It seems that the system is unable to swap active memory. I can run lots and lots of memory-hungry processes, and have occupied swapspace 2-3 times the installed ram. And that works (If these processes are only infrequently used). But when I try to start the whole arrangement at boot time, then it doesn't work and instead produces segfaults or kills the init.
 

grahamperrin

Son of Beastie

Reaction score: 1,045
Messages: 3,504

was killed: out of swap space does not neceesarly mean was killed: out of swap space

Instead, it could mean: …

Sponsored by the FreeBSD Foundation:

<https://cgit.freebsd.org/src/commit/?id=4a864f624a7097f1d032a0350ac70fa6c371179e>

vm_pageout: Print a more accurate message to the console before an OOM kill

Previously we'd always print "out of swap space." This can be misleading, as there are other reasons an OOM kill can be triggered. In particular, it's entirely possible to trigger an OOM kill on a system with plenty of free swap space.
 
Top