mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +00:00
aquatic_ws: improve cpu pinning
This commit is contained in:
parent
6eaac536ba
commit
b54694bbc0
5 changed files with 56 additions and 19 deletions
|
|
@ -1,4 +1,7 @@
|
|||
use aquatic_common::access_list::update_access_list;
|
||||
use aquatic_common::{
|
||||
access_list::update_access_list,
|
||||
cpu_pinning::{pin_current_if_configured_to, WorkerIndex},
|
||||
};
|
||||
use cfg_if::cfg_if;
|
||||
use signal_hook::{consts::SIGUSR1, iterator::Signals};
|
||||
|
||||
|
|
@ -14,11 +17,11 @@ pub mod mio;
|
|||
pub const APP_NAME: &str = "aquatic_ws: WebTorrent tracker";
|
||||
|
||||
pub fn run(config: Config) -> ::anyhow::Result<()> {
|
||||
if config.cpu_pinning.active {
|
||||
core_affinity::set_for_current(core_affinity::CoreId {
|
||||
id: config.cpu_pinning.offset,
|
||||
});
|
||||
}
|
||||
pin_current_if_configured_to(
|
||||
&config.cpu_pinning,
|
||||
config.socket_workers,
|
||||
WorkerIndex::Other,
|
||||
);
|
||||
|
||||
cfg_if!(
|
||||
if #[cfg(feature = "with-glommio")] {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue