How can I reduce my Ruby/Rails memory usage when running Redmine? Redmine seems to use quite a bit of my plan's memory ~60MB on an empty project how can I reduce that? asked 06 Mar '11, 02:47 klynton |
Hi, Great question Klynton! ;) Here's a nice little wrapper script that you can use to reduce the memory usage for your Redmine project:
then just have nginx call this script instead of the ruby executable. That will reduce your memory usage by ~20MB, at least. answered 06 Mar '11, 02:49 klynton This looks great. Which file does this go in, though? Sorry, I'm new to this...
(17 Apr '11, 23:04)
Spike
Hi, You can put it in a file called ruby.sh then just point your nginx script to the full path to ruby.sh instead of /usr/local/bin/...
(17 Apr '11, 23:16)
klynton
There should be a line in the
You will want to change it to something like this:
Then, create the new "ruby_small" file with the contents as Klynton described. Lastly, set the permissions (
(17 Apr '11, 23:17)
ryans ♦♦
It worked, thanks! The only thing I needed to change on top of that was to change the last line: exec "ruby" "$@" to: exec "/full/path/to/ruby" "$@"
(18 Apr '11, 08:53)
Spike
Will this work for a non-redmine project? I have a couple of rails 3.1 projects that are using an over abundance of memory that I need to get a handle on...
(24 Jan '12, 17:50)
Kagi
Yes, it will work on other ruby-based apps too.
(24 Jan '12, 19:41)
neeravk
Works well. But just wondering, it seems that Passenger ApplicationSpawner also sucks down a chunk of memory, and it eventually seems to spawn several redmine instances -- is that OK? Does this happen when the old instance runs out of memory? Is there any way to keep a lid of the number of instances spawned and what would the adverse effect be if any?
(20 Aug '12, 19:29)
pixelglow
@pixelglow, multiple process threads are normal. You may want to submit a support ticket so we can see what you are describing in real time.
(21 Aug '12, 01:08)
johns
showing 5 of 8
show 3 more comments
|
I did as following steps, but it does not work. Something wrong?
then, when I want to access my redmine, it tells me 'Cannot spawn application '/home/user/webapps/my_redmine/redmine': The spawn server has exited unexpectedly.'
permanent link
This answer is marked "community wiki".
answered 05 Dec '12, 21:24 navy Change the error log level in nginx's config file to 'debug' and check the nginx log for more info.
(05 Dec '12, 22:40)
johns
(06 Dec '12, 02:15)
navy
Perhaps the ruby version for your app is different than the ruby that the new " You can also try modifying "
(06 Dec '12, 02:47)
ryans ♦♦
|
Thank you very much, ryans. I updated the call to the 'ruby' executable with the full path and it works. answered 06 Dec '12, 16:10 navy |
Here's what I found, after looking at the number of running RackApp .../redmine isntances and seeing all the memory they were consuming, I needed more of a solution than above. I received a message from WebFaction that my process was killed as it was consuming way too much memory. After doing some testing, I found doing even simple things in Redmine was running up to 5 instances! I need Redmine for client access, but my use is very minimal. I did some Googling and found this: http://blog.phusion.nl/2013/03/12/tuning-phusion-passengers-concurrency-settings/ Here's what I added to http section in the nginx.conf file:
It seems to be doing what I need. This is all new for me though (I'm a Windows/Android developer, no experience with RoR/Ruby/Phusion, etc), so feedback/corrections welcome! answered 27 Jul '13, 10:33 RickB |