From: Eric Wong Date: 2017-06-26T02:01:41+00:00 Subject: [ruby-core:81769] Re: [Ruby trunk Bug#11101] Forking is killing my memory when running GC hi@olivierlacan.com wrote: > normalperson (Eric Wong) wrote: > > Did you try the nakayoshi_fork gem as ko1 suggested? > > Sorry for replying so late. I think I missed the notification when you originally replied. > I believe nakayoshi_fork did help a bit to bring response times near to their pre 2.2 > averages. No worries about being late, good to know nakayoshi_fork helped. > > Performance is unlikely to be twice as slow unless you're using enough > > memory to hit swap... > > To be fair, it wasn't. I think we had a 30 ms average that > jumped to 60 at first and leveled of at 50 ms with > nakayoshi_fork. I don't believe we were close to hitting swap, > and I think I was seeing this on multiple different servers at > the time. You don't sound too confident about whether or not you're swapping :) Actual memory in swap is harmless if it's static, what hurts is swapping in and out as that requires I/O. If you're on Linux, try the "vmstat 1" command and watch "si" and "so" columns for swap-in/swap-out. vmstat should be commonly installed via "procps" on Debian-based systems, at least. > > How big are your processes on 2.1 and 2.2? > > I'm not sure what you're asking there. I mean how much memory are your Ruby processes using? (Again, Linux-specific), that would be the RES column of "top", and you can get more-fine grained output via "pmap -x #{pid}" for any particular process. The "[anon]" memory is what's actually allocated by Ruby. > Interestingly, upgrading to 2.3.4 brought us back to pre-2.2 > response time averages of about 35 ms, and the averages are > much more stable as well. Good to know... However, I'm wondering if that was the result of general memory reductions in 2.3.x and if your results are consistent to Ruby 2.4.x or to other applications. I say that because (AFAIK) there were no significant changes to the GC for 2.3 (but some bugfixes and minor improvements) Unsubscribe: