Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial qos story for system and containers #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

asac
Copy link
Contributor

@asac asac commented Nov 22, 2022

Add initial oom score adjustments to ensure that on pantavisor system pantavisor itself and the log facilities get killed last by oom handler

@asac asac force-pushed the feature/initial-oom-score-adj branch from f92e43a to 1099d5e Compare February 20, 2023 09:02
@asac
Copy link
Contributor Author

asac commented Feb 20, 2023

pushed new revision that supports qos_policy: "guaranteed, besteffort and burstable"; also sets system pids to guaranateed.

@asac asac changed the title Add initial oom score adjustments to ensure that on pantavisor system… Add initial qos story for system and containers Feb 20, 2023
@asac
Copy link
Contributor Author

asac commented Feb 20, 2023

TODO:

  • make actual values for each level configurable
  • make setting for system pids individually tunable
  • make dropbear get prio
  • take a stab at making burstable more like k8s by looking at mem settings.

@asac asac force-pushed the feature/initial-oom-score-adj branch 4 times, most recently from 3739f4f to abaeda6 Compare February 20, 2023 11:20
@asac
Copy link
Contributor Author

asac commented Feb 20, 2023

i fixed all TODOS except the burstable impl is still dumb... would like to land as is...

@asac
Copy link
Contributor Author

asac commented Feb 20, 2023

think memleak still with p->qos_policy_oom_score_adj = strdup(score);

 * containers get qos_policy config in run.json
 * values from k8s: -997 guaranteed, 1000 besteffort, 333 burstable
 * make values configurable in pantavisor.config; overloadable in initrd_config
   * vm.oom_qos_besteffort
   * vm.oom_qos_guaranteed
 * system gets guaranteed -997 as well, loggers get -333
@asac asac force-pushed the feature/initial-oom-score-adj branch from abaeda6 to 913441a Compare February 20, 2023 16:28
@@ -186,6 +186,11 @@ struct pantavisor_metadata {
int usrmeta_interval;
};

struct pantavisor_vm {
int oom_qos_besteffort;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whould be nice to have these in pv_config_get_json and pv_config_print too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure lets add there....

@@ -445,6 +445,11 @@ static int pv_config_load_file(char *path, struct pantavisor_config *config)
config_iterate_items_prefix(&config_list, config_sysctl_apply,
"sysctl.", NULL);

config->vm.oom_qos_besteffort = config_get_value_int(
&config_list, "vm.oom_qos_besteffort", 1000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the names very much, but I cannot think of something better either :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add a . in the middle, but then i dont know the benefit :)

init.c Show resolved Hide resolved
parser/parser_system1.c Show resolved Hide resolved
platforms.c Show resolved Hide resolved
@asac
Copy link
Contributor Author

asac commented Feb 21, 2023

needs docs/ update for new config keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants