-
Notifications
You must be signed in to change notification settings - Fork 93
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
high CPU use due to continual state dumping #1744
Comments
My response:
|
See #421 |
The logic in the main loop in if cylc.flags.iflag or self.do_update_state_summary:
cylc.flags.iflag = False
self.do_update_state_summary = False
self.update_state_summary()
self.state_dumper.dump() It does look like they are reset, but perhaps they get set to |
Well, I was just about to post this! Might as well! My two cents: The relevant code in if cylc.flags.iflag or self.do_update_state_summary:
cylc.flags.iflag = False
self.do_update_state_summary = False
self.update_state_summary()
self.state_dumper.dump()
|
Yep, queued reproduces it - for example, this suite: [scheduling]
[[queues]]
[[[people_queue]]]
limit = 1
members = person_a, person_b
[[dependencies]]
graph = """
person_a & person_b
"""
[runtime]
[[person_a,person_b]]
script = sleep 360 will dump a state file every second while one of the tasks is queued. High CPU usage for a large suite will be triggered by the update state summary call which happens just before the dump. |
This fixes a problem where the state file is continually dumped if the task pool contains a queued task. This is due to the ready_to_run check in process_tasks in scheduler.py returning True if any task is queued and has reached its start time. The fix is to only update the state summary if we really think something has changed. This is a good thing to be doing anyway.
This fixes a problem where the state file is continually dumped if the task pool contains a queued task. This is due to the ready_to_run check in process_tasks in scheduler.py returning True if any task is queued and has reached its start time. The fix is to only update the state summary if we really think something has changed. This is a good thing to be doing anyway.
(from @MartinDix)
We occasionally see cylc server processes with high CPU usage for long periods. The cause of this seems to be that they are continually writing files to cylc-run/SUITE/state, e.g. in this case at a frequency of about 1.5 s (username removed to protect the innocent)
These files are all identical apart from the internal timestamp. In suites behaving normally it seems these files are only written when something changes (e.g. a task finishes). Here however nothing seems to be changing at this high frequency. The log files and cylc-suite.db aren't being modified at this frequency.
I've only seen this behaviour in complex NWP suites with lots of tasks (e.g. state file has ~1000 lines). The high CPU usage can also come and go while the suite runs.
The text was updated successfully, but these errors were encountered: