zombocom / puma_worker_killer

Automatically restart Puma cluster workers based on max RAM available
750 stars 77 forks source link

Worker memory hits over RAM settings #1

Closed simsicon closed 10 years ago

simsicon commented 10 years ago

Hi, thanks for providing this Gem.

I am current using puma 2.8.0 and rails 3.2.13, running 4 workers on cluster mode. I added puma_worker_killer to my app, put those configs and PumaWorkerKiller.start in my production.rb, but processes went beyond 512 mb which was the RAM value I set.

I took look into the code, realized this gem tries to term processes first, or kill them if failed, I don't know why my processes were so "vital". I guess there's a memory leak in my code, I can't find it right now, because I can't reproduce the problem in my staging or development env. Any ideas? What info I can put here would help?

Thanks.

isc commented 10 years ago

Hi,

PumaWorkerKiller doesn't seem to be able to kill my Puma workers: PumaWorkerKiller: Out of memory. 1 workers consuming total: 522.10546875 mb out of max: 506.88 mb. Sending TERM to #<Puma::Cluster::Worker:0x007f00a761a6f8 @pid=8, @phase=0, @stage=:booted> consuming 506.47265625 mb. I have this line in my logs since 25 minutes. The configuration in my Procfile is the following: web: bundle exec puma -p $PORT -w 2 -t 0:9

isc commented 10 years ago

Looks like I was using a version of Puma which is incompatible with puma_worker_killer ; after upgrading from 2.5.1 to 2.8.1, it works as expected. Maybe the gemspec for puma_worker_killer could be updated.

schneems commented 10 years ago

sorry for the delay here, github doesn't watch repos you create automatically for me, so i'm just now getting this. Could someone give me a PR to rev the gemspec, I would :heart: you so much, then we can close this issue. We can do ~> 2.7 as I originally wrote and tested this against 2.7 until i realized my version was behind. We should also update https://github.com/schneems/puma_auto_tune

schneems commented 10 years ago

I've reved-the spec and it's on master now, releasing a new gem soon.