Auto stop container ?

IMW72

New Member
Sep 6, 2020
6
1
3
44
Hello !

I have 2 proxmox 6.1 (OVH preinstalled), and on each, some container shudown automatically if not used for some days (I think, it's the only common point).

Is any config to auto-shutdown if no usages ?

The last activity not correspond to backup time or anything.

Thanks all !
 
I've found this in journalctl for the last stop of ctx :


Code:
Sep 04 19:36:09 ecomhost kernel: Memory cgroup stats for /lxc/1001:
Sep 04 19:36:09 ecomhost kernel: anon 55001088
                                 file 463966208
                                 kernel_stack 1990656
                                 slab 13934592
                                 sock 0
                                 shmem 462544896
                                 file_mapped 10137600
                                 file_dirty 1351680
                                 file_writeback 0
                                 anon_thp 0
                                 inactive_anon 266543104
                                 active_anon 249995264
                                 inactive_file 249856
                                 active_file 552960
                                 unevictable 0
                                 slab_reclaimable 7409664
                                 slab_unreclaimable 6524928
                                 pgfault 25468562
                                 pgmajfault 1244008
                                 workingset_refault 31222882
                                 workingset_activate 3074429
                                 workingset_nodereclaim 1188
                                 pgrefill 12151493
                                 pgscan 58359059
                                 pgsteal 31414626
                                 pgactivate 5074549
                                 pgdeactivate 8612889
                                 pglazyfree 0
                                 pglazyfreed 0
                                 thp_fault_alloc 0
                                 thp_collapse_alloc 0
Sep 04 19:36:09 ecomhost kernel: Tasks state (memory values in pages):
Sep 04 19:36:09 ecomhost kernel: [  pid  ]   uid  tgid total_vm      rss pgtables_bytes swapents oom_score_adj name
Sep 04 19:36:09 ecomhost kernel: [  32634] 100000 32634    42330      537    94208        6             0 systemd
Sep 04 19:36:09 ecomhost kernel: [    342] 100000   342      604       25    45056        3             0 agetty
Sep 04 19:36:09 ecomhost kernel: [    344] 100000   344      604       25    45056        3             0 agetty
Sep 04 19:36:09 ecomhost kernel: [  13786] 100108 13786    13792     8621   155648        0             0 tor
Sep 04 19:36:09 ecomhost kernel: [  32767] 100000 32767    39046      288    73728       63             0 rsyslogd
Sep 04 19:36:09 ecomhost kernel: [    308] 100000   308     4825      112    77824      118             0 systemd-logind
Sep 04 19:36:09 ecomhost kernel: [    309] 100000   309     1377       19    49152       33             0 cron
Sep 04 19:36:09 ecomhost kernel: [    310] 100106   310     2246       75    49152       57             0 dbus-daemon
Sep 04 19:36:09 ecomhost kernel: [    347] 100000   347     3962       44    65536      171             0 sshd
Sep 04 19:36:09 ecomhost kernel: [   2787] 100000  2787     3962      214    69632        0             0 sshd
Sep 04 19:36:09 ecomhost kernel: [   2817] 100102  2817     3962      217    69632        0             0 sshd
Sep 04 19:36:09 ecomhost kernel: [   2822] 100000  2822     3962      214    65536        0             0 sshd
Sep 04 19:36:09 ecomhost kernel: [   2823] 100000  2823     3880       81    61440        0             0 sshd
Sep 04 19:36:09 ecomhost kernel: [   2861] 100000  2861     3962      215    65536        0             0 sshd
Sep 04 19:36:09 ecomhost kernel: [   2867] 100000  2867     3962       64    65536      151             0 sshd
Sep 04 19:36:09 ecomhost kernel: [    337] 100107   337  1250990     2792   757760       62             0 privoxy
Sep 04 19:36:09 ecomhost kernel: [    340] 100000   340      604       12    40960       15             0 agetty
Sep 04 19:36:09 ecomhost kernel: [  19475] 100000 19475     9439     3471   122880        0             0 systemd-journal
Sep 04 19:36:09 ecomhost kernel: oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=ns,mems_allowed=0,oom_memcg=/lxc/1001,task_memcg=/lxc/1001/ns/system.slice/system-tor.slice/tor@default.service,task=tor,pid=13786,uid=100108
Sep 04 19:36:09 ecomhost kernel: Memory cgroup out of memory: Killed process 13786 (tor) total-vm:55168kB, anon-rss:32028kB, file-rss:2456kB, shmem-rss:0kB, UID:100108 pgtables:152kB oom_score_adj:0
Sep 04 19:36:09 ecomhost kernel: oom_reaper: reaped process 13786 (tor), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
Sep 04 19:36:10 ecomhost audit[2904]: AVC apparmor="DENIED" operation="change_onexec" info="label not found" error=-2 namespace="root//lxc-1001_<-var-lib-lxc>" profile="unconfined" name="system_tor" pid=2904 comm="(tor)"
Sep 04 19:36:10 ecomhost kernel: audit: type=1400 audit(1599248170.044:152): apparmor="DENIED" operation="change_onexec" info="label not found" error=-2 namespace="root//lxc-1001_<-var-lib-lxc>" profile="unconfined" name="system_tor" pid=2904 comm="(tor)"


on this host I've removed :
apparmor-easyprof
apparmor-profiles
apparmor-profiles-extra
apparmor-utils


I don't understant why it appears only on CT unused for long time.
 
I've always the pb ...
Nothing special in this CT (apache/php)
In syslog :

Sep 17 03:25:33 dev kernel: [15271672.054893] ? filemap_map_pages+0x1ae/0x380
Sep 17 03:25:33 dev kernel: [15271672.054901] vfs_fallocate+0x147/0x280
Sep 17 03:25:33 dev kernel: [15271672.054904] __x64_sys_fallocate+0x1e/0x30
Sep 17 03:25:33 dev kernel: [15271672.054910] entry_SYSCALL_64_after_hwframe+0x44/0xa9
Sep 17 03:25:33 dev kernel: [15271672.054917] Code: Bad RIP value.
Sep 17 03:25:33 dev kernel: [15271672.054920] RAX: ffffffffffffffda RBX: 00000000000000d2 RCX: 00007f4d9346846d
Sep 17 03:25:33 dev kernel: [15271672.054923] RBP: 0000000000000000 R08: 0000000000000000 R09: 00007f4d7c002f20
Sep 17 03:25:33 dev kernel: [15271672.054927] R13: 0000000000400000 R14: 00007f4d86ffbce0 R15: 0000000000000000
Sep 17 03:25:33 dev kernel: [15271672.054930] memory+swap: usage 1048576kB, limit 1048576kB, failcnt 956780279
Sep 17 03:25:33 dev kernel: [15271672.054933] Memory cgroup stats for /lxc/150:
Sep 17 03:25:33 dev kernel: [15271672.054953] Tasks state (memory values in pages):
Sep 17 03:25:33 dev kernel: [15271672.054957] [ 413] 100000 413 42370 560 94208 0 0 systemd
Sep 17 03:25:33 dev kernel: [15271672.054962] [ 988] 100101 988 10995 254 73728 0 0 qmgr
Sep 17 03:25:33 dev kernel: [15271672.054966] [ 13332] 100000 13332 10883 218 73728 0 0 local
Sep 17 03:25:33 dev kernel: [15271672.054970] [ 27440] 100101 27440 10961 218 73728 0 0 bounce
Sep 17 03:25:33 dev kernel: [15271672.054974] [ 634] 100000 634 604 29 40960 0 0 agetty
Sep 17 03:25:33 dev kernel: [15271672.054979] [ 573] 100000 573 1377 93 45056 0 0 cron
Sep 17 03:25:33 dev kernel: [15271672.054984] [ 6968] 100000 6968 596 16 45056 0 0 sh
Sep 17 03:25:33 dev kernel: [15271672.054988] [ 7275] 100000 7275 299822 3479 708608 0 0 chromium
Sep 17 03:25:33 dev kernel: [15271672.054992] [ 7303] 100000 7303 222801 3124 512000 0 300 chromium
Sep 17 03:25:33 dev kernel: [15271672.054996] [ 7305] 100000 7305 92476 521 348160 0 0 exe
Sep 17 03:25:33 dev kernel: [15271672.055001] [ 574] 100000 574 39046 362 77824 0 0 rsyslogd
Sep 17 03:25:33 dev kernel: [15271672.055005] [ 576] 100000 576 4876 250 73728 0 0 systemd-logind
Sep 17 03:25:33 dev kernel: [15271672.055010] [ 635] 100000 635 604 28 40960 0 0 agetty
Sep 17 03:25:33 dev kernel: [15271672.055015] [ 25474] 100033 25474 58687 2611 196608 0 0 apache2
Sep 17 03:25:33 dev kernel: [15271672.055019] [ 25476] 100033 25476 58663 2470 196608 0 0 apache2
Sep 17 03:25:33 dev kernel: [15271672.055023] [ 25478] 100033 25478 58574 2577 196608 0 0 apache2
Sep 17 03:25:33 dev kernel: [15271672.055027] [ 26505] 100033 26505 58558 2066 196608 0 0 apache2
Sep 17 03:25:33 dev kernel: [15271672.055032] oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=ns,mems_allowed=0,oom_memcg=/lxc/150,task_memcg=/lxc/150/ns/system.slice/cron.service,task=chromium,pid=7310,uid=100000


some idea to resolve this ?
 
lxc conf :

arch: amd64
cores: 2
hostname: webtools
memory: 1024
net0: bridge=vmbr0,hwaddr=....:1c,name=eth0,ip=..../32,gw=....,firewall=1
onboot: 1
ostype: debian
rootfs: local:150/vm-150-disk-0.raw,size=16G
swap: 0
unprivileged: 1


pveversion -v :

proxmox-ve: 6.2-1 (running kernel: 5.3.18-2-pve)
pve-manager: not correctly installed (running version: 6.2-11/22fb4983)
pve-kernel-helper: 6.2-6
pve-kernel-5.4: 6.2-1
pve-kernel-5.3: 6.1-6
pve-kernel-5.0: 6.0-11
pve-kernel-5.4.34-1-pve: 5.4.34-2
pve-kernel-5.3.18-3-pve: 5.3.18-3
pve-kernel-5.3.18-2-pve: 5.3.18-2
pve-kernel-5.0.21-5-pve: 5.0.21-10
pve-kernel-5.0.21-4-pve: 5.0.21-9
ceph-fuse: 12.2.11+dfsg1-2.1+b1
corosync: 3.0.4-pve1
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: 0.8.35+pve1
libjs-extjs: 6.0.1-10
libknet1: 1.16-pve1
libproxmox-acme-perl: 1.0.5
libpve-access-control: 6.1-2
libpve-apiclient-perl: 3.0-3
libpve-common-perl: 6.2-2
libpve-guest-common-perl: 3.1-3
libpve-http-server-perl: 3.0-6
libpve-storage-perl: 6.1-7
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve4
lxc-pve: 4.0.3-1
lxcfs: 4.0.3-pve3
novnc-pve: 1.1.0-1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.2-12
pve-cluster: 6.1-8
pve-container: 3.2-1
pve-docs: 6.2-5
pve-edk2-firmware: 2.20200531-1
pve-firewall: 4.1-2
pve-firmware: 3.1-3
pve-ha-manager: 3.1-1
pve-i18n: 2.2-1
pve-qemu-kvm: 5.1.0-1
pve-xtermjs: 4.7.0-2
pve-zsync: 2.0-3
qemu-server: 6.2-2
smartmontools: 7.1-pve2
spiceterm: 3.1-1
vncterm: 1.6-2
zfsutils-linux: 0.8.4-pve1
 
memory: 1024
1G memory is not enough for http server

for this reason you get oom-kill
Sep 17 03:25:33 dev kernel: [15271672.055032] oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=ns,mems_allowed=0,oom_memcg=/lxc/150,task_memcg=/lxc/150/ns/system.slice/cron.service,task=chromium,pid=7310,uid=100000


i suggest you to give the container more memory then try again.
 
Hello,

I have the same problem with randomly OOM inside LXC VPS. When the memory usage of the container and the PVE host if relatively low inside Proxmox GUI. Any new info?

Regards,
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!