all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox-mail-forward 1/2] pve-notify-worker: limit number of worker threads to 2
@ 2026-11-23 10:52 Lukas Wagner
  2026-11-23 10:52 ` [PATCH proxmox-mail-forward 2/2] pve-notify-worker: cargo: only enable required tokio features Lukas Wagner
  0 siblings, 1 reply; 2+ messages in thread
From: Lukas Wagner @ 2026-11-23 10:52 UTC (permalink / raw)
  To: pve-devel

proxmox_async::runtime::main uses tokio's default multi-threaded
runtime, which spawns one worker thread per CPU core. That is wasteful
for pve-notify-worker, which spends most of its time sleeping between
polls of the notification queue.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 pve-notify-worker/src/main.rs | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/pve-notify-worker/src/main.rs b/pve-notify-worker/src/main.rs
index 5f13b25..120b142 100644
--- a/pve-notify-worker/src/main.rs
+++ b/pve-notify-worker/src/main.rs
@@ -29,7 +29,15 @@ fn main() -> Result<(), Error> {
         .journald()
         .init()?;
 
-    proxmox_async::runtime::main(run())
+    let runtime = proxmox_async::runtime::get_runtime_with_builder(|| {
+        let mut builder = tokio::runtime::Builder::new_multi_thread();
+        builder.enable_all();
+        builder.worker_threads(2);
+
+        builder
+    });
+
+    runtime.block_on(run())
 }
 
 async fn run() -> Result<(), Error> {
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-23 10:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 10:52 [PATCH proxmox-mail-forward 1/2] pve-notify-worker: limit number of worker threads to 2 Lukas Wagner
2026-11-23 10:52 ` [PATCH proxmox-mail-forward 2/2] pve-notify-worker: cargo: only enable required tokio features Lukas Wagner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal