Score:0

how to keep website up when server resource is not available

at flag

First of all I should say I'm newbie in server configuration and managment.

In my case mariadb has high cpu usage and oom killer close this service when resources are not available and website get down.

how to keep up website when oom killer kills a service or limit resource for services to prevent killing service by oom killer ?

I searched a lot about limiting resource but all soulution said I should optimize my services and application and I couldn't find soulution for prevent killing service by limiting resource.

in flag
Don't fix the symptoms, fix the cause. If your server doesn't have enough memory to hold your database, increase memory.
Score:0
ua flag

High RAM usage can cause OOM. How much RAM do you have? What are the settings for innodb_buffer_pool_size and max_connections? Are there other apps running in the same server? If so, how much RAM do they need?

Lack of swap also contributes. Add some swap space, if practical. This won't solve the problem, but will (mostly) keep OOM from happening. The downside is a significant slowdown.

High CPU usage does not cause OOM, at least not directly. Turn on the slowlog with long_query_time = 1. Then let's try to improve the slow queries. More discussion: SlowLog

Score:0
cn flag

I'd look into fixing the actual issue i.e either improve application performance or increase resources on your servers.

One other thing to note is high CPU usage doesn't cause oom kill. You can use dmesg | grep -i "oom-killer" or if you have atop command to look the past data when it happend

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.