I have a backend app that is being used internally by developers hosted on our server, however, the app unfortunately requires the use of Passenger and Ruby, both of which are very memory-hungry.

I have an SSD swapfile that should allow reasonable performance for our usage, and I'd like to force this app to use swap space and leave the RAM open for our front-facing apps.

So the question is, is there a way to force a process/user(this process is run under a specific user) to use swap space as much as possible? I think limits.conf may be capable, but I don't want it to give Out of Memory errors, just switch to swapfile.

share|improve this question
up vote 2 down vote accepted

You should take a look at cgroups (Control Groups). There is some info on ad-hoc cgroups which also says

Note that the memory limit applies to RAM use only -- once tasks hit this limit, they will begin to swap.

which seems to be exactly what you want.


If your backend developer app is causing your front-facing apps pain, it'll probably be a good idea to move the backend stuff to it's own server.

share|improve this answer
    
Oh, that does sound good, I'll look into it, hopefully someone has a more specific example, but this is definitely what I'm looking for. – Ecksters Apr 8 '15 at 13:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.