Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions dispatcher/src/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ impl Dispatcher {

let subrecoder = recorder.get_sub_recorder();
let args = WorkToDo::FunctionArguments {
function_id,
function_id: function_id.clone(),
function_alternatives,
input_sets,
metadata,
Expand All @@ -531,7 +531,8 @@ impl Dispatcher {
let mut stderr_output: Vec<u8> = vec![0; itm.data.size];
context.context.read(itm.data.offset, &mut stderr_output)?;
warn!(
"Function result contains stderr output:\n{}",
"Function '{}' result contains stderr output:\n{}",
function_id,
std::str::from_utf8(stderr_output.as_slice())
.expect("Invalid stderr buffer")
);
Expand All @@ -540,7 +541,8 @@ impl Dispatcher {
let mut stdout_output: Vec<u8> = vec![0; itm.data.size];
context.context.read(itm.data.offset, &mut stdout_output)?;
debug!(
"Function output:\n{}",
"Function '{}' output:\n{}",
function_id,
std::str::from_utf8(stdout_output.as_slice())
.expect("Invalid stdout buffer")
);
Expand Down
9 changes: 9 additions & 0 deletions server/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const DEFAULT_CONFIG_PATH: &str = "./dandelion.config";
const DEFAULT_FOLDER_PATH: &str = "/tmp/dandelion_server";
const DEFAULT_PORT: u16 = 8080;
const DEFAULT_TIMESTAMP_COUNT: usize = 1000;
const DEFAULT_VIRTUAL_MAX_RAM_MULTIPLIER: usize = 2;
const DEFAULT_MULTINODE_TIMEOUT: u64 = 50;
use machine_interface::function_driver::system_driver::reqwest::DEFAULT_CONCURRENCY_LIMIT;

Expand Down Expand Up @@ -59,10 +60,14 @@ pub struct DandelionConfig {
pub io_cores: Option<usize>,
/// Number of concurrent requests to run per IO core
#[arg(long, env, default_value_t = DEFAULT_CONCURRENCY_LIMIT)]
#[serde(default)]
pub io_concurrency: usize,
#[arg(long, env, default_value_t = DEFAULT_TIMESTAMP_COUNT)]
#[serde(default)]
pub timestamp_count: usize,
#[arg(long, env, default_value_t = DEFAULT_VIRTUAL_MAX_RAM_MULTIPLIER)]
#[serde(default)]
pub virtual_max_ram_multiplier: usize,

// (optional) preload config
#[arg(long, env, default_value = "")]
Expand Down Expand Up @@ -130,6 +135,10 @@ impl DandelionConfig {
merge_option!(io_cores);
merge!(io_concurrency, DEFAULT_CONCURRENCY_LIMIT);
merge!(timestamp_count, DEFAULT_TIMESTAMP_COUNT);
merge!(
virtual_max_ram_multiplier,
DEFAULT_VIRTUAL_MAX_RAM_MULTIPLIER
);
merge_clone!(bin_preload_path, String::from(""));
merge_clone!(folder_path, String::from(DEFAULT_FOLDER_PATH));
merge_option!(remote_queue_url);
Expand Down
7 changes: 4 additions & 3 deletions server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ fn main() -> () {
};

// get RAM size
// TODO could be a configuration, open question on how to split between engines
// or if we unify somehow and have one underlying pool
// TODO: open question on how to split between engines or if we unify somehow and have one
// underlying pool.
let max_ram = read_to_string("/proc/meminfo")
.unwrap()
.lines()
Expand All @@ -318,7 +318,8 @@ fn main() -> () {
})
.unwrap()
.unwrap()
* 1024;
* 1024
* config.virtual_max_ram_multiplier;

let memory_pool = match config.test_mode {
Some(dandelion_server::config::TestMode::NoEngine) => BTreeMap::new(),
Expand Down
Loading