[Bug 15970] New: Plack should not clear syspref cache
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15970 Bug ID: 15970 Summary: Plack should not clear syspref cache Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org Depends on: 15341, 13815 Just played with nytprof and found something exciting: If I remove the following line: C4::Context->clear_syspref_cache(); from the psgi file, the processing time is divided per 2 (!) With the clear cache: for 15.8s (of 18.6s), executing 2588556 statements and 903720 subroutine calls in 421 source files and 63 string evals. Without the clear cache: for 7.82s (of 8.69s), executing 904432 statements and 262539 subroutine calls in 421 source files and 63 string evals. I have tried to update a pref (NoLoginInstructions): it's saved and displayed correctly. Am I missing something? Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13815 [Bug 13815] plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15341 [Bug 15341] Performance - Retrieve all sysprefs at once -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15970 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |15342 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15342 [Bug 15342] Performance 3.22 - Omnibus -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15970 Jacek Ablewicz <abl@biblos.pk.edu.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |abl@biblos.pk.edu.pl --- Comment #1 from Jacek Ablewicz <abl@biblos.pk.edu.pl> --- (In reply to Jonathan Druart from comment #0)
Just played with nytprof and found something exciting:
If I remove the following line: C4::Context->clear_syspref_cache(); from the psgi file, the processing time is divided per 2 (!)
With the clear cache: for 15.8s (of 18.6s), executing 2588556 statements and 903720 subroutine calls in 421 source files and 63 string evals.
Without the clear cache: for 7.82s (of 8.69s), executing 904432 statements and 262539 subroutine calls in 421 source files and 63 string evals.
Such a difference looks kind of weird - unless the script you are testing calls (for whatever reasons) CGI->new() repeatedly ? BTW, how many times was C4::Context::preference() called in that test?
Am I missing something?
With that line removed, each time when you change some syspref value, you'll need to restart starman server/workers manually for that change to take effect. However, clearing syspref cache inside CGI->new() override sub is probably not 100% flawless method anyway, so serwer restarts are still needed if one wants to be on the safe side ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15970 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jacek Ablewicz from comment #1)
(In reply to Jonathan Druart from comment #0)
Just played with nytprof and found something exciting:
If I remove the following line: C4::Context->clear_syspref_cache(); from the psgi file, the processing time is divided per 2 (!)
With the clear cache: for 15.8s (of 18.6s), executing 2588556 statements and 903720 subroutine calls in 421 source files and 63 string evals.
Without the clear cache: for 7.82s (of 8.69s), executing 904432 statements and 262539 subroutine calls in 421 source files and 63 string evals.
Such a difference looks kind of weird - unless the script you are testing calls (for whatever reasons) CGI->new() repeatedly ?
BTW, how many times was C4::Context::preference() called in that test?
No idea, patch is coming.
Am I missing something?
With that line removed, each time when you change some syspref value, you'll need to restart starman server/workers manually for that change to take effect. However, clearing syspref cache inside CGI->new() override sub is probably not 100% flawless method anyway, so serwer restarts are still needed if one wants to be on the safe side ;)
Yes indeed, I have fixed bug 11998 to solve this constraint. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15970 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |11998 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11998 [Bug 11998] Syspref caching issues -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15970 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15970 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 48641 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=48641&action=edit Bug 15970: Do not clear syspref cache in psgi file This in only in koha.psgi, it has been introduced by bug 13815 but should not have been added by this patch. Removing it should not introduce any changes. Not that it won't impact debian packages. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15970 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #3)
Created attachment 48641 [details] [review] Bug 15970: Do not clear syspref cache in psgi file
This in only in koha.psgi, it has been introduced by bug 13815 but should not have been added by this patch.
Removing it should not introduce any changes. Not that it won't impact debian packages.
Yeah. No one cares about misc/plack/koha.psgi. Why not patching debian/templates/plack.psgi instead? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15970 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Tomás Cohen Arazi from comment #4)
(In reply to Jonathan Druart from comment #3)
Created attachment 48641 [details] [review] [review] Bug 15970: Do not clear syspref cache in psgi file
This in only in koha.psgi, it has been introduced by bug 13815 but should not have been added by this patch.
Removing it should not introduce any changes. Not that it won't impact debian packages.
Yeah. No one cares about misc/plack/koha.psgi. Why not patching debian/templates/plack.psgi instead?
I do :) Because it does not disable the syspref cache, contrary to my earlier belief. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15970 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|15341 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15341 [Bug 15341] Performance - Retrieve all sysprefs at once -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15970 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|11998 | See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=11998 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11998 [Bug 11998] Syspref caching issues -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15970 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|Needs Signoff |RESOLVED --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Moved to bug 11998. *** This bug has been marked as a duplicate of bug 11998 *** -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org