RE: 答复: PROBLEM: cgroup cost too much memory when transfer small files to tmpfs
Cc Fangxiuning On Fri 24-07-20 09:35:26, jingrui wrote: > > On Friday, July 24, 2020 3:55 PM, Michal Hocko wrote: > > > What is the reason to run under !root cgroup in those sessions if you do > > not care about accounting anyway? > > The systemd not support run those sessions under root cgroup, disable > pam-systemd will not create session/cgroup, but this is not safe and > make systemd-logind not work. Could you be more specific please? As I know, when user call sftp client to send files, the server will call pam-systemd.so lib to create session and cgroup. We can skip call pam-systemd.so by config /etc/pam.d/password-auth drop the line " -session optional pam_systemd.so". But this config is global, and will affect other services, such as ssh login. We don’t find a way just don’t create cgroup dir for sftp. @Xiuning Would you please take a look and give some suggestion? -- Michal Hocko SUSE Labs
PROBLEM: cgroup cost too much memory when transfer small files to tmpfs
Cc: Johannes Weiner ; Michal Hocko ; Vladimir Davydov Thanks. --- PROBLEM: cgroup cost too much memory when transfer small files to tmpfs. keywords: cgroup PERCPU/memory cost too much. description: We send small files from node-A to node-B tmpfs /tmp directory using sftp. On node-B the systemd configured with pam on like below. cat /etc/pam.d/password-auth | grep systemd -session optional pam_systemd.so So when transfer a file, a systemd session is created, that means a cgroup is created, then file saved at /tmp will associated with a cgroup object. After file transferred, session and cgroup-dir will be removed, but the file in /tmp still associated with the cgroup object. The PERCPU memory in cgroup/css object cost a lot(about 0.5MB/per-cgroup-object) on 200/cpus machine. When lot of small files transferred to tmpfs, the cgroup/css object memory cost become huge in this scenes to be used. systemd related issue: https://github.com/systemd/systemd/issues/16499 kernel version: 4.19+ Problem: 1. Do we have any idea to descrease cgroup memory cost in this case? 2. When user remove cgroup directory, does it possible associated file memory to root cgroup? 3. Can we provide an option that do not associate memory with cgroup in tmpfs?
答复: PROBLEM: cgroup cost too much memory when transfer small files to tmpfs
On Friday, July 24, 2020 3:55 PM, Michal Hocko wrote: > What is the reason to run under !root cgroup in those sessions if you do not > care about accounting anyway? The systemd not support run those sessions under root cgroup, disable pam-systemd will not create session/cgroup, but this is not safe and make systemd-logind not work. > tmpfs is a persistent charge until the file is removed. So if those outlive > the session then you either want them to be charged to somebody or you do not > care about accounting at all, no? Or could you explain your usecase some more? In some usecase, we dont have disk and keep files in memory, we treat tmpfs just like disk, so dont care tmpfs accouting at all. -- Jingrui BR.