Thanks, yep, that's what I ended up doing - I just write directly to the cgroup files (together with modifying raw.lxc). I would have posted it earlier, but did not know how to reply to my own email which I did not receive :-S
Thanks again. On 3 July 2017 at 21:06, Fajar A. Nugraha <[email protected]> wrote: > On Mon, Jul 3, 2017 at 7:05 AM, Ivan Kurnosov <[email protected]> wrote: > >> Hi, >> >> I've went through the lxd and go-lxc binding to find the answer myself >> but I stuck at >> >> bool go_lxc_set_config_item(struct lxc_container *c, const char *key, >> const char *value) { >> return c->set_config_item(c, key, value); >> } >> >> Internally - that's how the config parameters are changed. >> >> But is it possible to change lxc config parameters >> like lxc.cgroup.memory.memsw.limit_in_bytes >> or lxc.cgroup.memory.limit_in_bytes in runtime using some of lxc or lxd >> cli utils, so that it was not required to restart a container to get its >> new memory limits. >> >> > In lxc, the only way I know how is to modify cgroup files directly. e.g. > /sys/fs/cgroup/memory/lxc/your_container_name/memory.limit_in_bytes . > That would modify current effective value, while editing lxc config file > would ensure the new config stays the same after container stop-start. > > In lxd, for some limits (e.g. limits.memory, the equivalent > of lxc.cgroup.memory.memsw.limit_in_bytes), "lxc config edit > your_container_name" should modify both effective and configured limits > interactively. You can also perform the change non-interactively, see "lxc > config help" for details. I don't think memory.memsw.limit_in_bytes has an > lxd equivalent though. > > -- > Fajar > > _______________________________________________ > lxc-users mailing list > [email protected] > http://lists.linuxcontainers.org/listinfo/lxc-users > -- With best regards, Ivan Kurnosov
_______________________________________________ lxc-users mailing list [email protected] http://lists.linuxcontainers.org/listinfo/lxc-users
