<div dir="ltr">Thanks,<div><br></div><div>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</div><div><br></div><div>Thanks again.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 3 July 2017 at 21:06, Fajar A. Nugraha <span dir="ltr"><<a href="mailto:list@fajar.net" target="_blank">list@fajar.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Mon, Jul 3, 2017 at 7:05 AM, Ivan Kurnosov <span dir="ltr"><<a href="mailto:zerkms@zerkms.ru" target="_blank">zerkms@zerkms.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I've went through the lxd and go-lxc binding to find the answer myself but I stuck at</div><div><br></div><div><div>bool go_lxc_set_config_item(struct lxc_container *c, const char *key, const char *value) {</div><div><span style="white-space:pre-wrap">  </span>return c->set_config_item(c, key, value);</div><div>}</div><div><br></div><div>Internally - that's how the config parameters are changed.</div><div><br></div><div>But is it possible to change lxc config parameters like lxc.cgroup.memory.memsw.l<wbr>imit_in_bytes or lxc.cgroup.memory.limit_in_<wbr>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.</div><div><br></div></div></div></blockquote><div><br></div></span><div>In lxc, the only way I know how is to modify cgroup files directly. e.g. /sys/fs/cgroup/memory/lxc/<wbr>your_container_name/memory.<wbr>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.</div><div><br></div><div>In lxd, for some limits (e.g. limits.memory, the equivalent of lxc.cgroup.memory.memsw.<wbr>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.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- </div><div>Fajar</div></font></span></div></div></div>
<br>______________________________<wbr>_________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.<wbr>linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.<wbr>org/listinfo/lxc-users</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">With best regards, Ivan Kurnosov</div>
</div>