perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neil Gunton <n...@nilspace.com>
Subject Re: AW: Embperl and threaded mpm?
Date Mon, 26 Jun 2017 23:51:43 GMT
richter@ecos.de wrote:
> Hi Neil,
>
> Embperl is not working with threaded mpm.
>
> Preloading all your perl code saves a lot of memory due to code sharing.
>
> The main issue is, that you have to make sure, not to open any file or database connection
or similar in the preload code, because that will be shared too, which does not work

Thanks, Gerald. So, just to be clear, what my preload routine in 
startup.pl does is the following. Maybe you can confirm that I'm doing 
it right.

if (Apache2::ServerUtil::restart_count() == 1)
{
    preload_dirs();
    $Embperl::initparam{preloadfiles} = \@preload_files;
}

The preload_dirs() simply traverses my code tree and calls this for each 
file:

push (@preload_files, {inputfile => $filename, path => $path, import => 
0, input_escmode => 0, options => 16, debug => 0x7fffffff});

Does that look about right? If as you say it's worthwhile in terms of 
memory then I might look at re-enabling it again. I think I disabled it 
originally because it made restarting the server quite slow, but it 
would be useful to have it as an option should I need it.

Thanks!

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message