doccaz / scc-tools

A set of simple tools to interact with SUSE Customer Center (SCC)
MIT License
12 stars 1 forks source link

vercheck-cache hitting 100% CPU when threads are idle #26

Closed doccaz closed 2 years ago

doccaz commented 2 years ago

After yet another severe rate-limiting event from the API server, we found a situation where dozens of threads were waiting on the results from the server for hours, and the vercheck process hit a solid 100% CPU until it was killed.

Apparently, Python threading doesn't yield idle time back to the CPU properly. Will have to research that, or maybe go for the multiprocessing library as an alternative.

doccaz commented 2 years ago

The 100% CPU usage peaks are solved. I'll work on converting this code to use ThreadPoolExecutor to avoid this in the future.