Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: How to do rust profiling in production?
I have this open source rust project that I started in 2022 that's very central to my smart home setup: thomas351 / rust-influxdb-udp-logger ยท GitLab
I've got multiple instances of it running on various devices, but the most important instance doing most of the work is nowadays running on this Intel N100 mini PC powered by Linux Mint 22.1.
It's running stable and does what it's meant to do, but it uses more CPU cycles than I wish it would (40-50% of one of my 4 CPU cores, according to htop
) - So I'd like to trace / profile what it's spending those CPU cycles on.
I don't want to restart my main instance more often than absolutely necessary, or even worse have it not run for more than a few seconds at most - because that would produce ugly holes in my graphs.
But since this main instance is the only one that's seeing enough load to even notice any relevant CPU usage, I don't think I can use anything but that to gather the profiling information I'm looking for.
I do have tokio-console setup and running, but either I'm not knowledgeable enough to control / interpret its output or it can't tell me which portions of my code cause the high CPU load htop tells me I'm using. I think the reason I don't see anything using too much CPU in tokio-console might be that most of my CPU-load is actually coming from my #[tokio::main] thread/task.
Does anybody have any pointers for me how to do that profiling?
1 post - 1 participant
๐ท๏ธ Rust_feed