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
  2026-11-24  7:50 ` applied: [PATCH proxmox-mail-forward 1/2] pve-notify-worker: limit number of worker threads to 2 Thomas Lamprecht
  0 siblings, 2 replies; 3+ 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] 3+ messages in thread

* [PATCH proxmox-mail-forward 2/2] pve-notify-worker: cargo: only enable required tokio features
  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 ` Lukas Wagner
  2026-11-24  7:50 ` applied: [PATCH proxmox-mail-forward 1/2] pve-notify-worker: limit number of worker threads to 2 Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Lukas Wagner @ 2026-11-23 10:52 UTC (permalink / raw)
  To: pve-devel

The binary itself only needs 'rt-multi-thread' to build its runtime.
The other features it relies on, such as timers and signal handling,
are enabled by proxmox-notify and proxmox-daemon, so there is no need
to pull in all of tokio.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 pve-notify-worker/Cargo.toml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pve-notify-worker/Cargo.toml b/pve-notify-worker/Cargo.toml
index 61738e9..7e6d2b0 100644
--- a/pve-notify-worker/Cargo.toml
+++ b/pve-notify-worker/Cargo.toml
@@ -10,7 +10,7 @@ homepage.workspace = true
 [dependencies]
 anyhow.workspace = true
 futures.workspace = true
-tokio = { workspace = true, features = [ "full" ] }
+tokio = { workspace = true, features = [ "rt-multi-thread" ] }
 tracing.workspace = true
 
 common.workspace = true
-- 
2.47.3





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

* applied: [PATCH proxmox-mail-forward 1/2] pve-notify-worker: limit number of worker threads to 2
  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
@ 2026-11-24  7:50 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2026-11-24  7:50 UTC (permalink / raw)
  To: pve-devel, Lukas Wagner

On Mon, 23 Nov 2026 11:52:35 +0100, Lukas Wagner wrote:
> 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.

Applied, thanks!

Adapted d/control to build-depend tokio on rt-multi-thread instead of the full
feature.

[1/2] pve-notify-worker: limit number of worker threads to 2
      commit: 9074b77c53a24ae5e037b244e0ec5308fa892f87
[2/2] pve-notify-worker: cargo: only enable required tokio features
      commit: d8dd5bd1242d828b094d25670fa3746df9435b02




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

end of thread, other threads:[~2026-11-24  7:51 UTC | newest]

Thread overview: 3+ 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
2026-11-24  7:50 ` applied: [PATCH proxmox-mail-forward 1/2] pve-notify-worker: limit number of worker threads to 2 Thomas Lamprecht

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