Ruby on Rails VPS RAM amount - ruby-on-rails

Currently I have a simpliest VPS: 1 core, 256 MB of RAM, Ubuntu 12.04 LTS. My application seems to be running fine enough (I'm using unicorn and nginx) but when I run my rake jobs:work command for my delayed_jobs, unicorn process is getting killed.
I was wondering if it is related to the RAM amount ?
When the unicorn process is up and running, free -m command shows me that around 230 MB of RAM are occupied.
I was wondering, how much RAM would I need in overall ? 512 ? 1024 ?
Which one should I go with ?
Would be very glad to receive any answers!
Thank you

Your DJ worker would run another instance of your Rails application, so you need to make sure that you have at least enough RAM for that other instance plus allowance for other processes you are running.
Check ps aux for the memory usage of your Rails app.
Run top and see how much physical memory is free (while your Rails app is running).
My guess is you'll have to bump up your RAM to 512 MB. You of course don't want your memory use to spill over to swap.
Of course, besides that, you also need to make sure that your application and database are optimized enough that there are no incredible spikes in memory usage.

You can start with
ulimit -S -a
to find out the limits of your environment

Related

Ubuntu 20.04 memory leak with Docker and Tomcat 9

My setup is as follows:
Ubuntu 20.04 server (16GB RAM) which runs Docker and Elasticsearch 6.8.16 image in a container with following env values -e JAVA_OPTS="-Xmx2g -Xms1g -XX:MaxPermSize=1g".
It also hosts two apps on Tomcat 9, and I have also set up these envs for Tomcat via setenv.sh in Tomcat's bin folder.
However, after a few hours, my remaining memory is less than 100MB and it happens every day. It stabilizes after I reboot the server, but after a few hours it falls under 100MB again.
Does anyone know how can I fix this?
If anyone needs any additional information, I am more than happy to provide it.
P.S. For some reason, my CPU always has 100% usage on one core while the other one is below 10%.
Thanks in advance!

gitlab (puma, sidekiq) how minimalize memory use

I have gitlab on my VPS with 4GB ram. But after upgrade debion to version 10 and upgrade gitlab, momory is not enough. Puma and Sidekiq occupied cca 13% of memory.
I reduce some parametrs in gitlab.rb, but it help only little.
Have somebody advice? Thanks
2.5gb of physical RAM + 1gb of swap should be enough to currently run Gitlab in 2022:
Running Gitlab in a memory constrained environment

Identifying which rails app is using the most memory on a box?

We have several rails apps using passenger and apache on some ubuntu servers that get heavy load occasionally. We get datadog alerts that memory usage is high, get on the server, and do a top to see that passenger and ruby are using lots of memory, but how should I go about figuring out which one of the passenger/rails apps is the culprit? Or at least a list of apps using above a given threshold of memory?
I have only one RoR running on my server (and it's nginx) and I think your looking for
ps auxf
it shows me this for my one passenger instance:
nginx 28279 0.0 10.2 452128 107264 ? Sl Apr03 0:01 Passenger RackApp: /srv/http/redmine
The third column (10.2) is memory usage in %, the last columns shows the directory to the application. More about output here.

Resource limit matched monit ruby on rails 3

I have an small rails 3 app on a small linode 512 mb and I make the monitoring with monit my rails app.
I can see on monit the message Resource limit matched. You can see the next image:
http://overpic.net/viewer.php?file=x5d6ybfukwgz6a5845bu8.jpg
I'm newbie with monit.
Does this mean that I should increase my ram memory? or my cpu? or upgrade to linode 1GB?
Where can I find a good monit ebook?
Thank you!

New Grails Install Way Slow

I'm just starting to learn Grails and Groovy. Did a fresh install of Grails 1.3.8 today and it crawls - I must have something in my environment causing a problem. I ran create-app (following a tutorial), then run-app. Both took quite a while but hey, first time thru. Ran run-app again, took almost 5 minutes, apparently int eh compiling phase. Windows 7 machine with 4 GB memory, Intel i5 CPU. Don't know where to start looking, but know this isn't normal.
When I've run into this normally I'm out of heap or permGen space. Fire up visualvm and check both of those memory limits. It'll slowdown considerably before crashing if your memory limits are too small
I wonder how it happens for you. I have 2gb ram and I run Ubuntu on pc and it's so fast. First check your memory limits.
And for your question, you can find a good disscussion over here.

Resources