Thanks everyone for the replies!  I will give a look at everything, because I'm in dire need of solutions.

Just a cue on the tests I did yesterday:

#!/usr/bin/perl

use Modern::Perl;
use C4::Context;
use Koha::BackgroundJobs;

while (1){
    sleep 10;
}

I use htop to see the memory usage.  The RES is the value I care about.  And the total memory usage of the machine tells me it is indeed additive (unlike mariadb or apache that show me the same value for each thread)

Now, the code above uses 50K on _some_ instances, and 150M on others.  I still haven't figured out the why for the discrepency, and I've tried about 20 instances, our our debian servers, our clients, and my coworkers ubuntu's.  Something in the config?  The 50K happens more often in 23.05, but when I restart them, they go to 150M and stay there.  I'll be examining the koha-conf.xml today...


As for plack, I have a very bare understanding on how it works. I suppose it loads all the code, so I suppose the 200M is justified?  Of course, making it slower makes it useless, so I won't go that route.


Thanks again, all!  I'll be checking the BZ you suggested.


Philippe Blouin,
Directeur de la technologie

Tél.  : (833) 465-4276, poste 230
philippe.blo...@inlibro.com

inLibro | pour esprit libre | www.inLibro.com <http://www.inLibro.com>
On 2023-10-24 03:25, Thomas Klausner via Koha-devel wrote:
Hi!

On Mon, Oct 23, 2023 at 03:57:16PM -0400, Philippe Blouin via Koha-devel wrote:
background_jobs_worker.pl for instance uses 170M per instance, and plack
uses 200M without anything being loaded.
How are you calculating the memory usage? I remember from mod_perl times
that if you preload as much code as possible before forking of
plack/redis workers much of the memory will be shared between processes.

So maybe the actual memory usage is much lower than what you expect it
to be. And if it's not, then we should investigate how to pull as much
`use` statements into pieces of code that are loaded before a `fork`
happens.

Greetings,
domm

_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : https://www.koha-community.org/
git : https://git.koha-community.org/
bugs : https://bugs.koha-community.org/

Reply via email to