Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
50 changes: 26 additions & 24 deletions scripts/batch_run.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
run_time: 4
run_time: 10

params:
request_freq:
Expand All @@ -16,40 +16,42 @@ params:
mech_scale_sche:
scale_sche_joint:
scale_num:
# - hpa:
- hpa:
# - temp_scaler:
- ensure_scaler:
# - ensure_scaler:
scale_down_exec:
- default:
scale_up_exec:
- least_task:
sche:
# - bp_balance:
# - pos: greedy
- ensure_scheduler:
- pos: greedy
# - ensure_scheduler:
- priority: a
- priority: b
filter:
# - []
- [{'careful_down':''}]

scale_sche_separated:
scale_num:
- temp_scaler:
- hpa:
- lass:
scale_down_exec:
- default:
scale_up_exec:
- least_task:
sche:
# - greedy:
# - hash:
# - random:
- load_least:
# - rotate:
- pass:
filter:
# - []
- [{'careful_down':''}]
# scale_sche_separated:
# scale_num:
# - temp_scaler:
# - hpa:
# - lass:
# scale_down_exec:
# - default:
# scale_up_exec:
# - least_task:
# sche:
# # - greedy:
# # - hash:
# # - random:
# - load_least:
# # - rotate:
# - pass:
# filter:
# # - []
# - [{'careful_down':''}]

# no_scale:
# scale_num:
Expand Down
18 changes: 2 additions & 16 deletions scripts/fast_draw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,8 @@ filter:

## each group bars
targets_alias:
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'single', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'ensure_scaler.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'ensure_scheduler.', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtsingle.cshigh.ftcpu.nml1.mtscale_sche_joint.scl(ensure_scaler.)(default.)(least_task.)[(careful_down.)].scd(ensure_scheduler.).ic(no_evict.)']
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'single', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'hpa.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'bp_balance.', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtsingle.cshigh.ftcpu.nml1.mtscale_sche_joint.scl(hpa.)(default.)(least_task.)[(careful_down.)].scd(bp_balance.).ic(no_evict.)']
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'single', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'hpa.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'pos.greedy', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtsingle.cshigh.ftcpu.nml1.mtscale_sche_joint.scl(hpa.)(default.)(least_task.)[(careful_down.)].scd(pos.greedy).ic(no_evict.)']
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'single', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'temp_scaler.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'bp_balance.', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtsingle.cshigh.ftcpu.nml1.mtscale_sche_joint.scl(temp_scaler.)(default.)(least_task.)[(careful_down.)].scd(bp_balance.).ic(no_evict.)']
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'single', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'temp_scaler.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'pos.greedy', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtsingle.cshigh.ftcpu.nml1.mtscale_sche_joint.scl(temp_scaler.)(default.)(least_task.)[(careful_down.)].scd(pos.greedy).ic(no_evict.)']
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'single', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'hpa.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'greedy.', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtsingle.cshigh.ftcpu.nml1.mtscale_sche_separated.scl(hpa.)(default.)(least_task.)[(careful_down.)].scd(greedy.).ic(no_evict.)']
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'single', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'hpa.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'hash.', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtsingle.cshigh.ftcpu.nml1.mtscale_sche_separated.scl(hpa.)(default.)(least_task.)[(careful_down.)].scd(hash.).ic(no_evict.)']
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'single', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'hpa.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'load_least.', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtsingle.cshigh.ftcpu.nml1.mtscale_sche_separated.scl(hpa.)(default.)(least_task.)[(careful_down.)].scd(load_least.).ic(no_evict.)']
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'single', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'hpa.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'pass.', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtsingle.cshigh.ftcpu.nml1.mtscale_sche_separated.scl(hpa.)(default.)(least_task.)[(careful_down.)].scd(pass.).ic(no_evict.)']
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'single', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'hpa.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'rotate.', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtsingle.cshigh.ftcpu.nml1.mtscale_sche_separated.scl(hpa.)(default.)(least_task.)[(careful_down.)].scd(rotate.).ic(no_evict.)']
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'single', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'lass.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'load_least.', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtsingle.cshigh.ftcpu.nml1.mtscale_sche_separated.scl(lass.)(default.)(least_task.)[(careful_down.)].scd(load_least.).ic(no_evict.)']
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'single', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'lass.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'pass.', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtsingle.cshigh.ftcpu.nml1.mtscale_sche_separated.scl(lass.)(default.)(least_task.)[(careful_down.)].scd(pass.).ic(no_evict.)']
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'single', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'temp_scaler.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'greedy.', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtsingle.cshigh.ftcpu.nml1.mtscale_sche_separated.scl(temp_scaler.)(default.)(least_task.)[(careful_down.)].scd(greedy.).ic(no_evict.)']
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'single', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'temp_scaler.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'load_least.', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtsingle.cshigh.ftcpu.nml1.mtscale_sche_separated.scl(temp_scaler.)(default.)(least_task.)[(careful_down.)].scd(load_least.).ic(no_evict.)']
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'single', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'temp_scaler.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'pass.', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtsingle.cshigh.ftcpu.nml1.mtscale_sche_separated.scl(temp_scaler.)(default.)(least_task.)[(careful_down.)].scd(pass.).ic(no_evict.)']
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'single', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'temp_scaler.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'rotate.', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtsingle.cshigh.ftcpu.nml1.mtscale_sche_separated.scl(temp_scaler.)(default.)(least_task.)[(careful_down.)].scd(rotate.).ic(no_evict.)']
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'dag', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'hpa.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'priority.a', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtdag.cshigh.ftcpu.nml1.mtscale_sche_joint.scl(hpa.)(default.)(least_task.)[(careful_down.)].scd(priority.a).ic(no_evict.)']
- [{'rand_seed': '', 'request_freq': 'low', 'dag_type': 'dag', 'cold_start': 'high', 'fn_type': 'cpu', 'scale_num': 'temp_scaler.', 'scale_down_exec': 'default.', 'scale_up_exec': 'least_task.', 'sche': 'load_least.', 'instance_cache_policy': 'no_evict.', 'filter': '(careful_down.)', 'no_mech_latency': '1'}, 'sd.rflow.dtdag.cshigh.ftcpu.nml1.mtscale_sche_separated.scl(temp_scaler.)(default.)(least_task.)[(careful_down.)].scd(load_least.).ic(no_evict.)']


## group on x axis:
Expand Down
39 changes: 20 additions & 19 deletions serverless_sim/module_conf_es.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,46 @@
{
"mech_type": {
"no_scale": null,
"scale_sche_separated": null,
"scale_sche_joint": null
"scale_sche_joint": null,
"no_scale": null
},
"scale_num": {
"rela": null,
"no": null,
"hpa": null,
"full_placement": null,
"ensure_scaler": null,
"no": null,
"lass": null,
"temp_scaler": null
"full_placement": null,
"temp_scaler": null,
"rela": null,
"lass": null
},
"scale_down_exec": {
"default": null
},
"scale_up_exec": {
"least_task": null,
"no": null
"no": null,
"least_task": null
},
"sche": {
"consistenthash": null,
"ensure_scheduler": null,
"faasflow": null,
"load_least": null,
"rotate": null,
"hash": null,
"pos": null,
"ensure_scheduler": null,
"random": null,
"bp_balance": null,
"load_least": null,
"faasflow": null,
"pass": null,
"priority": null,
"hash": null,
"consistenthash": null,
"fnsche": null,
"greedy": null,
"pass": null
"bp_balance": null,
"greedy": null
},
"filter": {
"careful_down": null
},
"instance_cache_policy": {
"lru": null,
"no_evict": null,
"fifo": null,
"no_evict": null
"lru": null
}
}
5 changes: 3 additions & 2 deletions serverless_sim/src/mechanism.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl<S: SameTarget> CheckDup for Vec<S> {
}
}

pub const SCHE_NAMES: [&'static str; 12] = [
pub const SCHE_NAMES: [&'static str; 13] = [
"rotate",
"hash",
"bp_balance",
Expand All @@ -91,6 +91,7 @@ pub const SCHE_NAMES: [&'static str; 12] = [
"consistenthash", // "gofs",
"ensure_scheduler",
"load_least",
"priority"
// "load_least",
// "random",
];
Expand Down Expand Up @@ -222,7 +223,7 @@ impl ConfigNewMec for Config {
}
}
"scale_sche_joint" => {
let allow_sche = vec!["pos", "bp_balance", "ensure_scheduler"];
let allow_sche = vec!["pos", "bp_balance", "ensure_scheduler", "priority"];
let allow_scale_num = vec!["hpa", "lass", "temp_scaler", "full_placement", "rela", "ensure_scaler"];
let allow_scale_down_exec = vec!["default"];
let allow_scale_up_exec = vec!["least_task"];
Expand Down
10 changes: 5 additions & 5 deletions serverless_sim/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ impl Node {
Self {
node_id,
rsc_limit: NodeRscLimit {
// cpu: 1000.0,
cpu: 200.0,
cpu: 1000.0,
// cpu: 200.0,
mem: 8000.0,
},
fn_containers: HashMap::new().into(),
Expand Down Expand Up @@ -264,9 +264,9 @@ impl Node {
Box::new(move |to_replace| {
let node = node.as_ref();
// log::info!("节点{}要移除的容器{}", node.node_id, to_replace);
for (_k, v) in node.fn_containers.borrow().iter() {
// log::info!("{}", v.fn_id);
}
// for (_k, v) in node.fn_containers.borrow().iter() {
// log::info!("{}", v.fn_id);
// }
node.container(*to_replace).unwrap().is_idle()
}),
);
Expand Down
6 changes: 3 additions & 3 deletions serverless_sim/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,13 @@ impl SimEnv {

for (dag_i, &(mut avg_frequency, cv)) in env.help.fn_call_frequency().iter() {
if env.help.config().request_freq_low() {
avg_frequency *= 0.1;
avg_frequency *= 0.3;
}
else if env.help.config().request_freq_middle() {
avg_frequency *= 0.2;
avg_frequency *= 0.5;
}
else {
avg_frequency *= 0.3;
avg_frequency *= 0.7;
}
// avg_frequency *= 100.0;
// avg_frequency *= 10.0;
Expand Down
6 changes: 6 additions & 0 deletions serverless_sim/src/sche/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use self::{
rotate::RotateScheduler,
ensure_scheduler::EnsureScheduler,
load_least::LoadLeastScheduler,
priority::PriorityScheduler
};

pub mod consistenthash;
Expand All @@ -29,6 +30,8 @@ pub mod hash;
pub mod rotate;
pub mod ensure_scheduler;
pub mod load_least;
pub mod priority;


// pub mod rule_based;
// pub mod time_aware;
Expand Down Expand Up @@ -76,6 +79,9 @@ pub fn prepare_spec_scheduler(config: &Config) -> Option<Box<dyn Scheduler + Sen
"load_least" => {
return Some(Box::new(LoadLeastScheduler::new()));
}
"priority" => {
return Some(Box::new(PriorityScheduler::new(&sche_attr)));
}
_ => {
return None;
}
Expand Down
25 changes: 0 additions & 25 deletions serverless_sim/src/sche/pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,6 @@ impl PassScheduler {
}
}

// 图形调度器中分组和调度算法的关键步骤如下所示。
// 在初始化阶段,每个函数节点都作为单独的组进行初始化,并且工作节点是随机分配的(第1-2行)。
// 首先,算法从拓扑排序和迭代开始。在每次迭代的开始,它将使用贪婪方法来定位DAG图中关键路径上具有最长边的两个函数,
// 并确定这两个函数是否可以合并到同一组(第3-8行)。
// 如果这两个函数被分配到不同的组中,它们将被合并(第9行)。
// 在合并组时,需要考虑额外的因素。
// 首先,算法需要确保合并的函数组不超过工作节点的最大容量(第10-12行)。
// 否则,合并的组将无法部署在任何节点上。其次,组内局部化的数据总量不能违反内存约束(第13-18行)。
// 同时,在合并的组中不能存在任何资源竞争的函数对𝑐𝑜𝑛𝑡 (𝐺) = {(𝑓𝑖, 𝑓𝑗 )}(第19-20行)。
// 最后,调度算法将采用装箱策略,根据节点容量为每个函数组选择适当的工作节点(第21-23行)。
// 根据上述逻辑,算法迭代直到收敛,表示函数组不再更新。
impl Scheduler for PassScheduler {
fn schedule_some(
&mut self,
Expand All @@ -220,19 +209,5 @@ impl Scheduler for PassScheduler {
self.schedule_for_one_req(req, env, cmd_distributor);
}
}
// let mut to_scale_down = vec![];
// // 回收空闲container
// for n in env.nodes.borrow().iter() {
// for (_, c) in n.fn_containers.iter() {
// if c.recent_frame_is_idle(3) && c.req_fn_state.len() == 0 {
// to_scale_down.push((n.node_id(), c.fn_id));
// }
// }
// }
// for (n, f) in to_scale_down {
// env.scale_executor
// .borrow_mut()
// .scale_down(env, ScaleOption::ForSpecNodeFn(n, f));
// }
}
}
Loading