[kwlug-disc] Service resource management: i.e. Mailman3 vs Mailman2

Khalid Baheyeldin kb at 2bits.com
Wed Feb 5 11:36:44 EST 2025


On Wed, Feb 5, 2025 at 11:14 AM Ronald Barnes via kwlug-disc <
kwlug-disc at kwlug.org> wrote:

>
> I've played around with this a bit.
>
> How do you determine whether you want:
> a) rss (resident set size)
> b) drs (data resident set size - "other then executable code"
> c) size (swap space related)
> d) sz (size in physical pages)
> e) trs (text resident size - executable code)
> f) vsz or vsize (virtual memory size)
>
> "?!?"
>

Some of those include shared library memory, others measure code,
and so on.

Here is the difference between rss and vsz:

https://www.baeldung.com/linux/resident-set-vs-virtual-memory-size

And the man page for ps has this: "The SIZE and RSS fields don't count some
parts
of a process including the page tables, kernel stack, struct thread_info,
and struct
task_struct.  This is usually at least 20 KiB of memory that is always
resident."

Code is usually not a large portion of a problematic processes' memory
usage,
and there is no much you can do to reduce it unless you want to rewrite an
application.

I use rss because it is the closest thing to what actual usage for a
process is.
Even though it is not exact, it is the closest proxy for that.

The goal is not how much bytes do I need, the goal is "why are these
processes
using a lot of memory".

# ps -eo rss,trs,drs,vsize,args |    grep php-fpm |    grep -v grep |
> awk '{ s += $1+$2+$3+$4 } END {print s}'
>

If my goal is comparative, then I keep things simple, and just use rss
as a proxy to "memory consumption".


> For the tired-eyed, that's 33MB 33,086,265 bytes.
>
> However...
>
> systemctl status php8.1-fpm.service
>       Status: "Processes active: 0, idle: 30, Requests: 233130, ...
>        Tasks: 31 (limit: 6949)
>       Memory: 446.6M
>          CPU: 7h 49min 22.955s
>       CGroup: /system.slice/php8.1-fpm.service
>
>
> These results are off by 1-1½ orders of magnitude.
>

The unit for rss in ps is Kilobytes, not bytes.
So that is part of the discrepancy.

What is yours like when comparing `ps` vs `systemctl status` on PHP,
> similar?
>

I can't restart PHP using systemctl on this server as it is a live busy
site.

Any thoughts on how to reconcile these wildly divergent results?
>

I think no matter how you measure it, MM3 uses MUCH more memory.
Exact figures don't matter.

I was hoping it was a due to one or two features that you can disable,
either because you don't use them at all, or you can make do without
them.

But it does not seem like a viable path so far.
So your best bet is to post these data to the issues that others have
complained about already, and hope that if enough people report this
as a show stopper, they will modularize the code more, or do something
else.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20250205/55f3aff2/attachment.htm>


More information about the kwlug-disc mailing list