Do we know since when calls to malloc(3) never fail, and who implemented this OOM Killer? I am curious about, what stuff this developer
is smoking, wherever he lives. This looks also like a big security flaw. I would not be surprised, if this could be easily exploited at least for some denial of service attacks.
For example, I experienced a major hassle in October/November 2020 with a tiny AWS-EC2 instance, which was for years perfectly running an Apache/PHP/MySQL web service. All over a sudden, Apache continued to being killed because of for some reason MySQL ran out of swap space. I found it already stupid to kill Apache and not MySQL.
Does this sound familiar?
I never was able to find out, what request actually triggered this, I am even not sure whether there was a trigger at all, perhaps the memory hog MySQL is a leaking hog. Finally, I added a second volume to the EC2 instance, 1 GB for swap only, and that solved the problem.
For my daemons, I use a malloc wrapper. It got already some introspection facilities, like total allocations, and I will add a configurable limit which hopefully keeps my daemons below the radar of the OOM Killer. In case it becomes killed, a watchdog will restart FreeBSD then, because killing the OOM Killer is the only clean solution.
is smoking, wherever he lives. This looks also like a big security flaw. I would not be surprised, if this could be easily exploited at least for some denial of service attacks.
For example, I experienced a major hassle in October/November 2020 with a tiny AWS-EC2 instance, which was for years perfectly running an Apache/PHP/MySQL web service. All over a sudden, Apache continued to being killed because of for some reason MySQL ran out of swap space. I found it already stupid to kill Apache and not MySQL.
Does this sound familiar?
I never was able to find out, what request actually triggered this, I am even not sure whether there was a trigger at all, perhaps the memory hog MySQL is a leaking hog. Finally, I added a second volume to the EC2 instance, 1 GB for swap only, and that solved the problem.
For my daemons, I use a malloc wrapper. It got already some introspection facilities, like total allocations, and I will add a configurable limit which hopefully keeps my daemons below the radar of the OOM Killer. In case it becomes killed, a watchdog will restart FreeBSD then, because killing the OOM Killer is the only clean solution.