mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 21:38:31 +00:00
Jemalloc tuning via Cargo config
This commit is contained in:
4
.cargo/config.toml
Normal file
4
.cargo/config.toml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[env]
|
||||||
|
# Set the number of arenas to 16 when using jemalloc.
|
||||||
|
JEMALLOC_SYS_WITH_MALLOC_CONF = "abort_conf:true,narenas:16"
|
||||||
|
|
||||||
@@ -11,8 +11,11 @@ lighthouse_metrics = { path = "../lighthouse_metrics" }
|
|||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
libc = "0.2.79"
|
libc = "0.2.79"
|
||||||
parking_lot = "0.11.0"
|
parking_lot = "0.11.0"
|
||||||
jemallocator = { version = "0.3.0", optional = true }
|
jemallocator = { version = "0.3.0", optional = true, features = ["background_threads"] }
|
||||||
|
jemalloc-sys = { version = "0.3.0", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
mallinfo2 = []
|
mallinfo2 = []
|
||||||
jemalloc = ["jemallocator"]
|
jemalloc = ["jemallocator", "jemalloc-sys"]
|
||||||
|
jemalloc-stats = ["jemallocator/stats"]
|
||||||
|
jemalloc-profiling = ["jemallocator/profiling"]
|
||||||
|
|||||||
@@ -1,2 +1,12 @@
|
|||||||
|
//! Set the allocator to `jemalloc`.
|
||||||
|
//!
|
||||||
|
//! Due to `jemalloc` requiring configuration at compile time or immediately upon runtime
|
||||||
|
//! initialisation it is configured via a Cargo config file in `.cargo/config.toml`.
|
||||||
|
//!
|
||||||
|
//! The `jemalloc` tuning can be overriden by:
|
||||||
|
//!
|
||||||
|
//! A) `JEMALLOC_SYS_WITH_MALLOC_CONF` at compile-time.
|
||||||
|
//! B) `_RJEM_MALLOC_CONF` at runtime.
|
||||||
|
|
||||||
#[global_allocator]
|
#[global_allocator]
|
||||||
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ edition = "2021"
|
|||||||
autotests = false
|
autotests = false
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
default = ["tree-states"]
|
||||||
# Writes debugging .ssz files to /tmp during block processing.
|
# Writes debugging .ssz files to /tmp during block processing.
|
||||||
write_ssz_files = ["beacon_node/write_ssz_files"]
|
write_ssz_files = ["beacon_node/write_ssz_files"]
|
||||||
# Compiles the BLS crypto code so that the binary is portable across machines.
|
# Compiles the BLS crypto code so that the binary is portable across machines.
|
||||||
@@ -19,7 +20,7 @@ spec-minimal = []
|
|||||||
# Support Gnosis spec and Gnosis Beacon Chain.
|
# Support Gnosis spec and Gnosis Beacon Chain.
|
||||||
gnosis = []
|
gnosis = []
|
||||||
# Use `milhouse` tree states.
|
# Use `milhouse` tree states.
|
||||||
tree-states = ["beacon_node/tree-states"]
|
tree-states = ["beacon_node/tree-states", "malloc_utils/jemalloc"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
beacon_node = { "path" = "../beacon_node" }
|
beacon_node = { "path" = "../beacon_node" }
|
||||||
|
|||||||
Reference in New Issue
Block a user