-
Notifications
You must be signed in to change notification settings - Fork 956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After some time delayed jobs process is taking all memory of the development machine after deployment. #823
Comments
Probably something getting lost in code reloading. My guess would be that your web server does the same but you restart it more often. |
same here. two systems: staging and production. memory on staging is being filled up by production
staging
i'm at a loss as to where to look. the only significant difference are ubuntu release and ram size and i'd be damned if one of these are the reason rbenv compiles ruby in a way it introduces memory leaks. suggestions anyone? |
update: i tamed delayed_job. enabling rails' class cache prevents the leakage as in #776. # config/environments/staging.rb
config.cache_classes = true |
for what it's worth, |
There are many memory things ruby does not clear up well. If you have any jobs that involve a lot of data, ruby will naturally grow and not due to DJ. You would see the same thing if the jobs were run inline in the server. There is no easy answer but you can search around for ways to identify what type of ruby objects are building up over time. |
I don't think my jobs consume a lot of data (or use a lot of memory I guess is what you mean?) but I have a lot of jobs... I don't think I had this problem until the number of jobs became high. I have at least 2,400 jobs that run every 15 minutes. |
That in and of itself will generate a lot of objects. How ruby handles the cleanup is out of our hands and that graph is very common to many/most ruby apps. The most common "memory leak" is references to objects that survive the normal work loop, whether that be a single job, a web request, or other. There are ways to get ruby to tell you what type of objects are stacking up. Search for object count reports. |
i have the same issues. but around 160.000 jobs per hour (!). each job is doing http request to scrape data.
i have not find any other ideas. which one is best? |
this is about delayed_job. or so i thought. |
Same here. ENV
|
my problem was, that i actually started 500k+ jobs per day. if there is
just 10 byte uncleared memory, well, that eats up
Am 09.12.2016 um 19:31 schrieb 1c7:
…
Same here. also my delayed_job would take up all the memory after
about 1 day.
and cause server down. not even able to ssh login to system, I have to
manually restart server on Azure.
ENV
Server: Ubuntu 14.04
Ruby 2.3.1
gem 'delayed_job', "> 4.1.1"
gem 'delayed_job_active_record', "> 4.1.0"
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#823 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMv1un3SsdfCoRDpRs72uidR7Uj7DCCXks5rGUomgaJpZM4FDMNr>.
---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus
|
@dgobaud What are you using there to monitor your memory usage? |
I think I may be experiencing this too. I've got two workers running delayed jobs on my production server and after about a day of low/moderate usage, I run out of memory. 1GB EC2 instance. Then my capistrano deploys fail on asset precompile. |
@gregblass nothing you can do about. i actually restart all my processed via cronjob every 6 hour to prevent bloating |
So I don't have a lot of processes running. Maybe 20-30 a day I'd think. But in theory isn't this not OK? How can processes be spawned and then memory just lost into the void? I added a swap of 1GB and it fixed my Capistrano issues. But in the long run, if delayed job is going to slowly eat way my server's memory, I will avoid it and use something that doesn't. Does Sidekiq have this issue? |
Oh nevermind, you're talking about 500K+ processes per day! Thats crazy. Congrats to you on whatever you're working on. There's no way I'm experiencing the same types of effects as you. I think it may be the 2 workers I'm spawning and the fact that I have only 1GB of real memory allocated, plus a ton of JS/CSS to precompile? |
observing 1Million instagram accounts requires 1million jobs fetching
the data.
no big congrazt on that.actually i am using sidekiq and that problem occured
Am 26.04.2017 um 10:27 schrieb Greg Blass:
…
Oh nevermind, you're talking about 500K+ processes per day! Thats
crazy. Congrats to you on whatever you're working on. There's no way
I'm experiencing the same types of effects as you. I think it may be
the 2 workers I'm spawning and the fact that I have only 1GB of real
memory allocated, plus a ton of JS/CSS to precompile?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#823 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMv1us8j_lbfeIsq0x0o7SY_SdcOLkB1ks5rzrm8gaJpZM4FDMNr>.
---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus
|
Taking a moment to share how I resolved this: Set config/environments/development.rb to use this - Then we ran delayed job with - Clearly if you are developing a job you want to run backgrounded you will need to just omit the ENV, then it will use the reloading..albeit with the memory creep. This solution is helpful if you just need to run it a long time in dev, and keeps your laptop from blowing up if you leave it all running in tmux or something. |
Now reloading only runs when files are changed - the problem before was that your whole app was reloaded every 5 seconds. |
@ghiculescu I’m sorry I got confused, should cache_classes be set to true or false in the whole discussion above? Second, the plugin you created, should it be only loading the files needed by the worker instead of loading the whole env? should one limit cache_classes=false to the worker, since it’s gonna handle the needed files by the plugin, and set cache_classes=true everywhere else? thanks |
ooops, I meant #1115 (comment) reloads the entire app, but only does so when:
In other words it behaves exactly the same as your Rails server. You should always set |
I am having a related issue but need some help. |
Closing stale |
Deployment via capistrano.
using:
delayed_job (4.0.6)
capistrano3-delayed-job (1.4.0)
delayed_job_active_record (4.0.3)
server:
Ubuntu 12.04.5 LTS (GNU/Linux 3.2.0-24-virtual x86_64)
Any idea what we could check or how to debug this issue.
Everything is fine on stage and production with production rails env.
The text was updated successfully, but these errors were encountered: