Improvements for large test cluster management. (#59)

* VM script improvements.
* Modified docker-pull to create new container
* Replaced vpnkit with slirp4netns for better containerized network performance.
* Added swap allocation config.
Co-authored-by: chalith <desaman.chalith@gmail.com>
This commit is contained in:
Ravin Perera
2021-09-17 12:07:56 +05:30
committed by GitHub
parent f38591eb19
commit 1473d2b059
10 changed files with 384 additions and 40 deletions

View File

@@ -63,9 +63,10 @@ namespace conf
cfg.hp.init_user_port = 8081;
cfg.system.max_instance_count = 5;
cfg.system.max_mem_kbytes = 1024000; // Total 1GB RAM
cfg.system.max_mem_kbytes = 1048576; // Total 1GB RAM
cfg.system.max_swap_kbytes = 1572864; // Total 1.5GB RAM
cfg.system.max_cpu_us = 5000000; // CPU cfs period cannot be less than 1ms (i.e. 1000) or larger than 1s (i.e. 1000000) per instance.
cfg.system.max_storage_kbytes = 2048000; // Total 2GB
cfg.system.max_storage_kbytes = 5242880; // Total 5GB
const std::string img_prefix = registry_addr.empty() ? "hotpocketdev" : std::string(registry_addr);
cfg.docker.images["hp.0.5-ubt.20.04"] = img_prefix + "/sashimono:hp.0.5-ubt.20.04";
@@ -242,6 +243,7 @@ namespace conf
const jsoncons::ojson &system = d["system"];
cfg.system.max_mem_kbytes = system["max_mem_kbytes"].as<size_t>();
cfg.system.max_swap_kbytes = system["max_swap_kbytes"].as<size_t>();
cfg.system.max_cpu_us = system["max_cpu_us"].as<size_t>();
cfg.system.max_storage_kbytes = system["max_storage_kbytes"].as<size_t>();
cfg.system.max_instance_count = system["max_instance_count"].as<size_t>();
@@ -324,6 +326,7 @@ namespace conf
jsoncons::ojson system_config;
system_config.insert_or_assign("max_mem_kbytes", cfg.system.max_mem_kbytes);
system_config.insert_or_assign("max_swap_kbytes", cfg.system.max_swap_kbytes);
system_config.insert_or_assign("max_cpu_us", cfg.system.max_cpu_us);
system_config.insert_or_assign("max_storage_kbytes", cfg.system.max_storage_kbytes);
system_config.insert_or_assign("max_instance_count", cfg.system.max_instance_count);