in which cpu mode does the CF run the containers?

106 views Asked by At

Our go app uses Telegraf to collect CPU measurement. Neither user nor system mode are closed to the value, which is visible via cli

cf app app_name

1

There are 1 answers

0
Matthias Winzeler On

Do the values in /sys/fs/cgroup/cpuacct/cpuacct.usage* come close to what you expect?

CloudFoundry's runtime Diego uses runC stats command to gather container stats (source). runC appears to leverage the kernel's CPU accounting subsystem on the cgroup (source).

However, I'm not sure this interface is the proper way for you as a user to gather the metrics. Running telegraf in an app container seems strange to me (would it run as a sidecar next to the app? Sidecars are not ready yet in CF).

What's your use case, what would you like to achieve? If you'd like to grab the container metrics for monitoring, grabbing the metrics from the firehose is probably the right interface for you: the firehose is a websocket stream to grab an apps' metrics. Sample app: https://github.com/pivotalservices/app-metrics-nozzle