Open richstokes opened 5 years ago
Hi @richstokes , thanks for reaching out. To help better understand, can you give an idea of what "high" CPU usage means? Is it something like 20-30% at "idle" or are you seeing 80-100%? Generally speaking, the system is never really idle, since it is constantly processing tag update checks, policy evaluations and cve feed updates, so you should see some usage, and that will vary based on the number of images and subscribed tags (things to watch in external docker registries) in your system. Can you provide a bit more detail on that state of your system to help triage further? Thanks!
Sure, the server is an AWS t2.medium (4Gb memory). The system is set up for anchore testing only, so even when nothing else is happening on the box the 'twistd' process is using about 15% CPU. I've not added any new scans since my initial testing a few days ago and the CPU use remains pretty consistent.
If this is expected then fair enough, just feels like its spinning its wheels unnecessarily. :-]
@richstokes understood. Right now, that's about normal. It does feed "busy", but anchore is a very asynchronous system that has a lot of background tasks that have duty cycles. We're aware of the issue and will work to help reduce that, but in the current design that is expected behavior. The db logging thing is on our radar as well. I've been looking into approaches to remove the need for active polling, such as redis-based pub-sub but that involves more dependencies to install/run.
anchore-db_1 | WARNING: there is no transaction in progress
gets spammed as fast as possible (seems to come from postgres), using very high amount of CPU even at idle.Process using high cpu:
/usr/bin/python2 /bin/twistd --logger=anchore_engine.subsys.twistd_logger.logger --pidfile /var/run/anchore-simplequeue.pid -n anchore-simplequeue --config /config
How to reproduce the issue: Fresh install
Anything else we need to know: Ubuntu 18.04.1 LTS