metalbear-co / mirrord

Connect your local process and your cloud environment, and run local code in cloud conditions.
https://mirrord.dev
MIT License
3.77k stars 103 forks source link

Reconsidering the way background tasks are handled #1287

Closed Razz4780 closed 8 months ago

Razz4780 commented 1 year ago

Right now mirrord agent uses 3 global background tasks (dns, sniffer and stealer) and 2 per-client background tasks (tcp and udp). All tasks are run in their own tokio runtimes constructed with Builder::new_multi_thread, which spawns nproc threads. Main function is also run in a multi-threaded runtime. That means that agent uses (4 + clients) * nproc threads. Maybe we could consider using single-threaded runtimes?

eyalb181 commented 1 year ago

Seems premature at this point - not something our users will really feel the effect of?

Razz4780 commented 1 year ago

Seems premature at this point - not something our users will really feel the effect of?

Just something I noticed when working with the agent. The change would be very simple - using different tokio runtime flavor.

Razz4780 commented 8 months ago

Closed with #1497