# Housekeeper 1.12.1 - 100% CPU usage (a single core) in quiet period

**URL:** https://discourse.orthanc-server.org/t/housekeeper-1-12-1-100-cpu-usage-a-single-core-in-quiet-period/3961
**Category:** General
**Created:** [October 5, 2023, 10:15pm UTC](https://discourse.orthanc-server.org/t/housekeeper-1-12-1-100-cpu-usage-a-single-core-in-quiet-period/3961 "2023-10-05T22:15:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![a.sallai](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/a/779978/32.png) [@a.sallai](https://discourse.orthanc-server.org/u/a.sallai)
#### Post date: [October 5, 2023, 10:15pm UTC](https://discourse.orthanc-server.org/t/housekeeper-1-12-1-100-cpu-usage-a-single-core-in-quiet-period/3961/1 "2023-10-05T22:15:26Z")

</div>

If the Housekeeper is still not finished processing all the changes AND it is currently in its “quiet period” then it seems to be going into a “busy wait” around here: [https://hg.orthanc-server.com/orthanc/file/tip/OrthancServer/Plugins/Samples/Housekeeper/Plugin.cpp#l700](https://hg.orthanc-server.com/orthanc/file/tip/OrthancServer/Plugins/Samples/Housekeeper/Plugin.cpp#l700) .  
We noticed this in multiple environments.

Shouldn’t we add some sleep (a minute maybe?) in that else block to avoid spinning the CPU unnecessarily?

---

<div class="post-metadata">

### Author: ![alainmazy](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/alainmazy/32/1576_2.png) [@alainmazy](https://discourse.orthanc-server.org/u/alainmazy)
#### Post date: [October 6, 2023, 2:50pm UTC](https://discourse.orthanc-server.org/t/housekeeper-1-12-1-100-cpu-usage-a-single-core-in-quiet-period/3961/2 "2023-10-06T14:50:44Z")

</div>

Hi Andràs,

You are totally right !

I have just [fixed it](https://hg.orthanc-server.com/orthanc/rev/c1037a755cee). Note, however, that I have introduced only a 1 sec sleep to allow Orthanc to exit quickly when requested.

Thanks a lot !

Alain.
