How can I disable swappiness just for Mariadb and not for other applications on the same EC2 Instance?

dba.stackexchange https://dba.stackexchange.com/questions/286959

  •  17-03-2021
  •  | 
  •  

Question

I have an EC2 instance where DB(Mariadb) runs on the same EC2 instance as the other applications. MySQL documentation suggests to disable swappiness since DB doesn't like swap. How can I disable swappiness just for Mariadb and not for all other users/apps ? Thanks Moe

No correct solution

OTHER TIPS

Plan A (if possible): Use "huge pages" for the buffer_pool. They can't be swapped, thereby helping keep from swapping MariaDB.

Plan B: Use swappiness = 1 -- This, in theory, discourages the OS from swapping any process. It will still swap if it is absolutely necessary. At that point, perhaps it is better to slow down some process(es) rather than crashing?

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top