pub mod backend;
pub mod buffer_cache;
pub mod dirlock;
pub mod file;
pub mod filter_stats;
pub mod tracking_bloom_filter;
use fdlimit::{Outcome::LimitRaised, raise_fd_limit};
use tracing::warn;
use std::sync::Once;
fn init_fd_limit() {
match raise_fd_limit() {
Ok(LimitRaised { from, to }) => {
const WARN_THRESHOLD: u64 = 1 << 19;
if to < WARN_THRESHOLD {
warn!(
"Raised fd limit from {} to {}. It's still very low -- try increasing the fd hard-limit (in your limits.conf).",
from, to
);
}
}
Ok(_) => { }
Err(e) => {
warn!("Failed to raise fd limit: {}", e);
}
}
}
pub fn init() {
static ONCE: Once = Once::new();
ONCE.call_once(|| {
init_fd_limit();
});
}