mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Showing /sys/fs/cgroup/memory/memory.stat very slow on some machines
@ 2018-07-03  6:43 Bruce Merry
  2018-07-18  4:23 ` Andrew Morton
  0 siblings, 1 reply; 22+ messages in thread
From: Bruce Merry @ 2018-07-03  6:43 UTC (permalink / raw)
  To: linux-kernel

Hi

I've run into an odd performance issue in the kernel, and not being a
kernel dev or knowing terribly much about cgroups, am looking for
advice on diagnosing the problem further (I discovered this while
trying to pin down high CPU load in cadvisor).

On some machines in our production system, cat
/sys/fs/cgroup/memory/memory.stat is extremely slow (500ms on one
machine), while on other nominally identical machines it is fast
(2ms).

One other thing I've noticed is that the affected machines generally
have much larger values for SUnreclaim in /proc/memstat (up to several
GB), and slabtop reports >1GB of dentry.

Before I tracked the original problem (high CPU usage in cadvisor)
down to this, I rebooted one of the machines and the original problem
went away, so it seems to be cleared by a reboot; I'm reluctant to
reboot more machines to confirm since I don't have a sure-fire way to
reproduce the problem again to debug it.

The machines are running Ubuntu 16.04 with kernel 4.13.0-41-generic.
They're running Docker, which creates a bunch of cgroups, but not an
excessive number: there are 106 memory.stat files in
/sys/fs/cgroup/memory.

Digging a bit further, cat
/sys/fs/cgroup/memory/system.slice/memory.stat also takes ~500ms, but
"find /sys/fs/cgroup/memory/system.slice -mindepth 2 -name memory.stat
| xargs cat" takes only 8ms.

Any thoughts, particularly on what I should compare between the good
and bad machines to narrow down the cause, or even better, how to
prevent it happening?

Thanks
Bruce
-- 
Bruce Merry
Senior Science Processing Developer
SKA South Africa

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2018-07-26 12:48 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-03  6:43 Showing /sys/fs/cgroup/memory/memory.stat very slow on some machines Bruce Merry
2018-07-18  4:23 ` Andrew Morton
2018-07-18 10:42   ` Michal Hocko
2018-07-18 14:29     ` Bruce Merry
2018-07-18 14:47       ` Michal Hocko
2018-07-18 15:27         ` Bruce Merry
2018-07-18 15:33           ` Shakeel Butt
2018-07-18 15:26       ` Shakeel Butt
2018-07-18 15:37         ` Bruce Merry
2018-07-18 15:49           ` Shakeel Butt
2018-07-18 17:40             ` Bruce Merry
2018-07-18 17:48               ` Shakeel Butt
2018-07-18 17:58                 ` Bruce Merry
2018-07-18 18:13                   ` Shakeel Butt
2018-07-18 18:43                     ` Bruce Merry
2018-07-24 10:05               ` Bruce Merry
2018-07-25 12:32                 ` Michal Hocko
2018-07-26 12:35                 ` Bruce Merry
2018-07-26 12:48                   ` Michal Hocko
2018-07-26  0:55               ` Singh, Balbir
2018-07-26  6:41                 ` Bruce Merry
2018-07-26  8:19                   ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®