tomas@tuxteam.de wrote:
> On Tue, Sep 29, 2020 at 10:24:35AM +0700, Victor Sudakov wrote:
> > Dear Colleagues,
> >
> > Could you please clarify for me how the following is possible. `ps` shows
> > that the php-fpm workers have occupied 62% of physical memory, while
> > `free` shows that only 1.3Gi (which is 17% of total RAM) is used:
> >
> > $ ps axww -o cmd,%mem |awk '/php-fpm/{sum+=$NF}END{print sum}'
>
> Ah, but you're adding the resident set sizes of many processes here,
> right?
Indeed, as written in the man page:
%mem %MEM ratio of the process's resident set size to the physical
memory on the machine, expressed as a percentage. (alias pmem).
And it is even not mine, but Zabbix' idea, but that's another story.
>
> Remember that they do share quite a bit of that set: libraries, binaries,
> and so on: you are counting that shared stuff more than once.
Those are kind of virtual things, as far as I understand. If not %mem, then
what `ps` parameter can show me how many php-fpm workers I can safely start
before RAM is exhausted?
--
Victor Sudakov, VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/
Attachment:
signature.asc
Description: PGP signature