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
Long running job blocks execution of short scheduled jobs #335
Comments
Your 6 jobs are included in the same client or do you have different clients? How many clients do you have? |
By the way, do you have different backup locations? Did you remember to set the max parallel jobs option also there? Thanks |
They are all different cllients. hope this helps |
Hi @HenryRc0 Sorry, but I'm not able to reproduce your issue:
There must be something I'm missing. Just to be sure, I'd like to highlight the 3 configurable options related to parallel jobs:
In the example above, I let my max parallel job per client to 1, as every job is from a different client. |
By the way, can you try enqueueing the jobs on-demand using the "Enqueue now" button?
They should start immediately. Does it work like that? thanks |
Hi @xezpeleta Henry |
One difference I can see ist that with on demand enqueueing the log entry "StatusReport QUEUED" has an user entry (root in my case), while the scheduled entries don´t. |
As I'm not able to reproduce your issue, I guess that it's related to your custom installation. Let me know if you have any more udpates. |
@xezpeleta New findings from todays testing: after the long running job is started for about 50 minutes everything works as expected. any ideas/hints how to proceed? |
@xezpeleta I think I found the real problem: the process "php /opt/elkarbackup/app/console elkarbackup:tick" looks like to have a memleak You could probably not reproduce this issue because you either have a higher memory limit configured or in your tests the long running job was not as long running as mine. |
Thanks for the info, I'm gonna try to reproduce it using a fake rsnapshot binary with a sleep of 50min. I'll keep you updated. |
@HenryRc0 can you try commenting the following lines? elkarbackup/src/Binovo/ElkarBackupBundle/Command/RunJobCommand.php Lines 275 to 278 in 671e006
|
@xezpeleta commented out the lines -> no effect on memory consumption FYI: What I did in the meantime to slow down the increasing memory consumption is |
supplement info: The long running job is now finished - In the overview it says "Disk Usage 0 MB" - but that should have been expected since the above lines have been commented. |
Hi @HenryRc0 , Looking for some info about memory leaks and Doctrine, I've stumbled upon in two possible causes: debug and profiler. Debug is disabled by default in Elkarbackup, but profiler is enabled. Line 31 in 611895b
Can you disable it commenting out the line? |
Hi @xezpeleta I did two tests: one with those changes and one without. So the changes have an impact on the initial mem consumption, but interestingly Henry |
HI @HenryRc0 How are you measuring the memory usage of TickCommand? Just using ps aux or any other utility? I'm trying to simulate your issue using a fake rsnapshot but I don't see memory usage increasing... Thanks EDIT: ah ok, I saw your previous comment. You're using: |
I've just checked it in my test environment (a Docker container with a fake rsnapshot script, PHP v7.1.22) and my production environment (Debian 9, "real" rsnapshot v1.4.2 and PHP v7.0.30). In my test environment, after a 50min long job the memory usage of TickCommand remains stable: 40368 In my production server, after more than 20 jobs (some of them take 20min), memory usage remains stable: 33176 |
Environment here: In your environments is the memusage of TickCommand always stable? |
@xezpeleta With this change the memory consumption stays stable at ~30MB for the TickCommand process. Source: So there is only one question: Why does only my installation have this issue? Henry |
Hi @HenryRc0 Yes, I've found that website and more: https://stackoverflow.com/questions/9699185/memory-leaks-symfony2-doctrine2-exceed-memory-limit Apparently the issue is related to the debugging option, which should be disabled by default. So I imagine that your problem comes from the not-debian based installation process (the installation script, i guess?). |
Hi @xezpeleta yes the initial installation was done with the script. Here is the (snipped) output of ./console debug:config doctrine doctrine: I guess logging is false on your installations. I will also try the other solution mentiond in your link: doctrine: |
I finished now tests with the parameters set within config.yml Memory consumption stays stable but at a higher level of ~39MB The additional 9MB are interesting, but both solutions work. @xezpeleta Any idea yet, in which direction you are heading |
Can we close this issue? |
For me it is solved. I don´t know if any of the solutions is now included within the project (I changed the parameters locally). |
Thanks @HenryRc0 . We're discontinuing script-based installation on 1.4.0, so I close this issue having you fixed the problem. I suggest you switch to docker image which will be much more maintainable. Thanks |
Hi,
a long running job blocks the execution of short scheduled jobs even if it is allowed to execute more
jobs in parallel.
Example:
Within parameters: Max parallel jobs is 5
5 jobs are configured with a policy to be executed every hour (redologs from databases)
1 job is configured with a policy to be executed on a daily basis (online/offline backup of a database)
The job which is doing the online/offline backup runs for about 3 hours.
While the job is running the tick command adds the 5 jobs correctly to the queue (status queued), but
they aren´t executed. Only after the long running job is finished all 5 hourly based jobs are started
(in parallel).
Therefor 2 hourly backups aren´t executed.
Henry
The text was updated successfully, but these errors were encountered: