[Koha-bugs] [Bug 16579] Use separate memcached namespace for caching koha-conf.xml

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sun Jun 19 17:02:34 CEST 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16579

--- Comment #12 from Jacek Ablewicz <abl at biblos.pk.edu.pl> ---
(In reply to Jonathan Druart from comment #11)

> c) move the memcached config to a syspref and do not fetch this pref from
> the cache (like we do for OVERRIDE_SYSPREF_*)

You mean, to fetch memcached setup directly from the database? But to do it
you'll need to parse koha config file first, to obtain database connection
config.

> It will 1/ avoid to parse the koha conf file

I don't see how this step can be avoided in such scenario (?).

2nd problem with this scenario is that plack startup script will initialize DB
connection (1st 'use C4::Context;' will trigger it) and without some extra care
this single DB connection will then be shared between multiple plack workers.
But this is not really a big problem, just a matter of adding e.g.

{
    ## pre-init DBI / DBIx database connection
    my $schema = Koha::Database->new()->schema();
    my $dbh = C4::Context->dbh;
    $dbh->do('SELECT * FROM systempreferences WHERE 1 = 0');
    Koha::Config::SysPrefs->find('marcflavour');

    ## trigger lazy-loaded modules compilation (conditional
    ## requires etc.) in Template::*, CGI and Koha::Dateutils
    # Template::Config->preload();
    # CGI->compile(':all');
    ## initializes locale and timezone related stuff
    # dt_from_string();

    ## disconnect from the database, otherwise the single database
    ## connection will be shared between multiple plack workers
    $schema->storage()->disconnect();
}

at the end of the startup script. Actually, this may have some extra adventages
as it will allow safe preloading of many more modules at startup (good for
performance and really good for memory footprint, due to copy-on-write),
including some problematic ones like e.g. C4/Auth.pm (which calls
->preference() in BEGIN block).

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list