cpu consumption is very high
# ask-ai
c
cpu consumption is very high
t
Thanks for reaching out, N. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks so much for reaching out! To help you better with the high CPU consumption issue, could you share a bit more information? For instance: • Is this happening on a specific server, client device, or during a particular operation? • Are you using LiveKit's server SDKs, client SDKs, or another component? • Have you noticed any specific logs, metrics, or patterns? Getting these details will really help us understand what's going on and find the best solution for you.
c
• Is this happening on a specific server, client device, or during a particular operation? ->server side • Are you using LiveKit's server SDKs, client SDKs, or another component? -> LiveKit's server SDKs • Have you noticed any specific logs, metrics, or patterns? ->no
t
I understand that high CPU consumption on your LiveKit server SDKs can be challenging, so let’s work through some helpful steps together: • Use Non-Burstable Instances: If you’re currently using burstable instance types like AWS t3 or t4, it might be a good idea to switch to non-burstable types such as m5 or c5. These offer more consistent CPU performance, which can really make a difference. • Monitor CPU Credits: If you do need to stick with burstable instances, keeping an eye on the
CPUCreditBalance
metric is key to preventing throttling. You might also want to explore using t3.unlimited instances if that fits your needs. • Set CPU Thresholds: Consider configuring the LiveKit Egress service to watch CPU usage closely and automatically stop the processes that are using the most CPU if things get too high. This can help keep things running smoothly. • Enable CPU Profiling: Using the
--cpuprofile
flag allows you to generate a CPU profile file. Then, with Go’s
pprof
tool, you can dive into that data to spot any bottlenecks. • Validate Load: The
livekit-cli
tool is great for simulating load and seeing how your CPU behaves under stress, which can provide valuable insights. I hope these suggestions help you get a clearer picture and manage the CPU usage more effectively. Please feel free to reach out if you’d like any help walking through these steps—I’m here to support you! Sources: Troubleshooting Latency and Timeout Errors with Turn Detection on AWS | pkg/stats/monitor.go | cmd/server/main.go | Optimizing Video Calls for Low-Powered Devices in LiveKit (JS SDK ≥ v2.14.0... | cmd/lk/perf.go