|
|
|
|
|
by sshine
920 days ago
|
|
Tooting the Rust horn in predictable ways: Why would you want to restart a service frequently? - Flush incorrect state
- Reset memory leaks
- ...others reasons?
Rust's borrow system makes it harder (but not impossible) to have memory leaks.Rust's immutable-by-default semantics makes it harder (but not impossible) to end up where your long-running process'es state is incorrect. You can still mark everything as `&mut` and litter the code with ref-counts. I've seen a lot of this "removing the safety rails because it's more convenient" among C/C++ developers who were forced into using Rust. I think a bigger attack vector for anything dynamic, including a type-safe, memory-safe Axum back-end service, is denial-of-service because requests take too long to process. Application development is always vulnerable for being feature-driven: features sure do like resources! A service doesn't need bugs to get killed efficiently. It just needs to get slow over time. |
|
As mentioned in the original comment - I haven’t found a web framework which supports timeouts for idle TCP connections (they all seem to be built on top of Hyper, which doesn’t support them). And so even tweaking kernel parameters to bump up the connection limit to a few hundred thousand (any higher than that and I start hitting a different set of problems), and only having a few thousand actually active connections, my app still runs out of sockets and hangs after a few hours.