-
Notifications
You must be signed in to change notification settings - Fork 107
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
reduce microservices memory footprint #12200
Comments
@mapellidario , yesterday I posted on MM chat to Alan and Andrea my observations which aligned with the ticket. Here is my posting (for completeness on the issue): Here is a proof of memory spike in I took test/python/WMCore_t/MicroService_t/MSRuleCleaner_t/MSRuleCleanerWflow_t.py code and added memory profile to one of the unit test as following:
Basically, I run over 10K requests which I modified slightly and call MSRuleCleanerWflow for each of them in a similar manner as MSRuleCleaner code is doing. Here is the outcome:
and, when I enable my for loop I see the following:
As you can see the first reported set of numbers which correspond to the test I modified spiked from 11KB to 1232KB. Therefore if we take MSRuleCleaner for loop at line https://github.com/dmwm/WMCore/blob/master/src/python/WMCore/MicroService/MSRuleCleaner/MSRuleCleaner.py#L262 and pass 10K requests you will see a spike of 1000x times in memory due to the memory allocation in Here is modified version I used MSRuleCleanerWflow_t.py To fix the problem few steps should be performed:
|
Impact of the new feature
MicroServices
Is your feature request related to a problem? Please describe.
We realized that the microservices memory footprint depends on their backlog, for example for ms-rulecleaner at every polling cycle runs the function
_execute()
only once [1] on every workflow with a certain status [2]Describe the solution you'd like
Taking ms-rulecleaner as an example, we could change
getRequestRecords
into a generator that yields only a few workflows every time it is called. We would need to add a for loop inexecute()
around the call to_execute()
. Not a huge effort, achievable without consistent refactoring.Describe alternatives you've considered
The alternative would be to process once workflow at a time, possibly moving our model to a pub/sub, but this would require some major refactoring
Additional context
Follow-up to #12042 .
[1]
WMCore/src/python/WMCore/MicroService/MSRuleCleaner/MSRuleCleaner.py
Line 222 in beefc74
[2]
WMCore/src/python/WMCore/MicroService/MSRuleCleaner/MSRuleCleaner.py
Line 775 in beefc74
The text was updated successfully, but these errors were encountered: