Closed MeteorsLiu closed 11 months ago
Thanks for pointing this out!
To be clear, Linux(which is most used) offers 3 kernel params:
All of them should be configured to a proper value.
Personally I consider it reasonable to set them in our app. It is similar to the nofile
limit which we finally made it resolved by the app itself, in case some end-users are not well aware of this problem.
@MeteorsLiu I'm not sure which toolchain you are using. Switch to the latest nightly one, and run cargo update
may help solve the compiling error =-=
@MeteorsLiu I'm not sure which toolchain you are using. Switch to the latest nightly one, and run
cargo update
may help solve the compiling error =-=
after cargo update
Compiling lightws v0.6.9
error[E0635]: unknown feature `core_io_borrowed_buf`
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/lightws-0.6.9/src/lib.rs:6:12
|
6 | #![feature(core_io_borrowed_buf)]
| ^^^^^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0635`.
error: could not compile `lightws` due to previous error
My rustc version: rustc 1.74.1 (a28077b28 2023-12-04)
@MeteorsLiu
Please build with the nightly version rustc 1.76.0-nightly (f967532a4 2023-12-08)
.
Realm relies on some nightly features(hopefully get stabilized in 2024).
I have finished the job, can i open a PR?
Of course. Thanks!
In Golang, a default tcp keepalive interval(15 Seconds) is set when the connection is established, which prevents the super long interval set by Linux or other system causing the connection "unhealthy"(In Chinese, "unhealthy" means 断流).
However, in Rust, there's no default keepalive interval, which means it will use the system default tcp keepalive.
For example, in Linux, the tcp keepalive interval is 7200s, which means that it have to wait for 7200s to confirm whether the connection is healthy or not. If the connection is broken, it will cause the ETIMEDOUT error and shut down by user space programs.
In high traffic cases, 7200s makes kernel spend a lots of times to do interruption of checking "unhealthy tcp" and makes the numbers of connection increasing(old broken connection cannot be shutdown as soon as possible).
So request to set default tcp keepalive interval to 15s.
I tried to modify some codes (https://github.com/MeteorsLiu/realm) to archive that.
However, i cannot compile due to