Rails server gets killed all the time

rails

#1

I am running into an issue where my rails server (Thin) gets killed as soon as I issue a browser request. Apparently this is because of memory, since the memory bar goes almost full when starting the server.

However, this is a sudden behavior. Since just a while ago I could start the server and use it in development without any problems.

I am using a free plan so the memory limit is 512MB. What bothers me is that I was not having this problem just a while ago.

Not sure if this is a bug or not, since each process in the process list is showing 0.0% memory consumption…

Is there any way to “reset” the memory of my workspace?


#2

Nevermind, a simple click on the button “Restart” next to “Show Process List” button restarts everything. However it takes a while for the meter to catch up.


#3

Hi,

I’ve noticed that sometimes the development rails servers don’t clean up properly. When you exit them, they leave some zombie processes remaining. The 0.0% is misleading in our process list, as it shows the percentage of memory / cpu used by the process within the entire server, and not your workspace. We have an open issue to improve that, but it isn’t trivial to fix.

The next time you experience sluggish performance or out of memory scenario, please check the process list and see if you have too many ruby processes. If so, kill them all and start your rails server again. A short-cut command for this is killall ruby. Restarting is also a solution, but isn’t necessary.

Happy holidays!

Regards,
Mutahhir


#4

Hi @mutahhir, thanks of your reply.

By entire server you mean exactly what? The rails server, or… I’m a bit confused about that.

Thanks for the solution you provided, I will remember it for next time.


#5

Sorry for not being too clear there. I meant the entire physical machine hosting your workspace amongst others. As you know, each workspace on Cloud9 is a docker container running within a big machine, so the 0.0% is shown because the percentage each ruby process is taking is very small compared to the memory the machine has. So, for example, if your workspace has 1GB RAM, and a process is taking 10MB, so that’s ~1%, but for a machine that has, say, 100GB RAM, that’d come to about ~0.01% which is what you’re seeing here.


#6

@mutahhir

Understood! Thanks for clearing that. :grinning: