public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter J. Holzer <[email protected]>
To: [email protected]
Subject: Re: Used memory calculation in containers - docker stats and file cache
Date: Mon, 4 Nov 2024 21:45:54 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAJ+5Ff5vEbwBLFw9LyDG2mmL6Ljkj_r-6iGujYFAUQnPkYP_KQ@mail.gmail.com>
References: <CAJ+5Ff6qH6hLW3MVSip0eCY7pFdHJQvmFrOXfKRMQkqYVfsMHw@mail.gmail.com>
	<[email protected]>
	<CAJ+5Ff5vEbwBLFw9LyDG2mmL6Ljkj_r-6iGujYFAUQnPkYP_KQ@mail.gmail.com>

On 2024-11-04 14:35:23 +0100, Costa Alexoglou wrote:
> > I don't know if Docker does anything strange here.
> 
> I am not sure if this is docker specific or cgroup comes into play. 
> The measurement is implemented in docker CLI, but I would make the
> assumption that the eviction is done within the cgroup scope.

I was trying to come up with possible *causes* for the eviction.


> > A large file (or many smaller files) which is cached is deleted
> 
> The increase pattern is "incremental" until the huge eviction, and
> this is my question. Couldn't also the eviction happen incrementally
> rather than 15GB of file cache evicted on an instant?

It (usually) takes longer to write a file than to delete it.

If a temporary file is slowly written and then deleted after it is no
longer needed, you would see such a "sawtooth" as your screenshots show:
While the file is written, the kernel will cache the data on the
assumption that it will be read again sometime in the near future. But
when it is deleted, the kernel knows that it can't be read again - so it
will throw away all this (now useless) data.


> Seems like this issue, or the parent one that everyone is linking to this.

That seems to be just about the way it is reported, not the behaviour.

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | [email protected]         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"


Attachments:

  [application/pgp-signature] signature.asc (833B, 2-signature.asc)
  download

view thread (4+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Used memory calculation in containers - docker stats and file cache
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox