Limit total memory allocated for Dockers


Recommended Posts

I'd like to be able to limit total memory allocated for all Dockers running. For instance system has 6GB of RAM allocated to unRAID and I want to set a hard limit of max 4GB to be utilized by Dockers, leaving 2GB (in worst case scenario) for NAS subsystem (emhttp, SAMBA, etc). That would hopefully prevent Out of Memory occurrences killing important processes when suddenly some Docker decides to use tons of RAM.

 

That could,for example, be implemented as a global Docker setting in respective GUI.

 

I know this could be solved by manually adding -m parameter to each Docker, but what about simple solution like this:

 

For EACH DOCKER->

IF (-m not specified) append -m <global setting> ELSE use existing -m <value> entered by user

 

EDIT: LOL, I realized the above would not work properly and it doesn't achieve what I wanted i.e. it would not limit TOTAL memory usage.

Is there any way to do it at all (cgroups)?

 

 

Link to comment

I'd like to be able to limit total memory allocated for all Dockers running. For instance system has 6GB of RAM allocated to unRAID and I want to set a hard limit of max 4GB to be utilized by Dockers, leaving 2GB (in worst case scenario) for NAS subsystem (emhttp, SAMBA, etc). That would hopefully prevent Out of Memory occurrences killing important processes when suddenly some Docker decides to use tons of RAM.

 

That could,for example, be implemented as a global Docker setting in respective GUI.

 

I know this could be solved by manually adding -m parameter to each Docker, but what about simple solution like this:

 

For EACH DOCKER->

IF (-m not specified) append -m <global setting> ELSE use existing -m <value> entered by user

 

EDIT: LOL, I realized the above would not work properly and it doesn't achieve what I wanted i.e. it would not limit TOTAL memory usage.

Is there any way to do it at all (cgroups)?

Not sure on limiting memory usage with Docker, but have you looked at installing the swap file plugin to enable swap in unRAID?  It's in the plugin subforum.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.