Re: [Koha-devel] mod_perl (was: DBIx::Class stuff)
On Sat, Nov 22, 2008 at 7:24 PM, Rick Welykochy <rick@praxis.com.au> wrote:
Joshua Ferraro wrote:
Speed is definitely a major concern here ... and I believe it's one of the reasons that Koha originally wasn't written with an ORM. Andy, any thoughts about what this choice will mean w/respect to performance?
The use of mod_perl would speed things up by an order (and a half) of magnitude, giving the software more leeway to use abstractions like an OR mapper.
Hi Rick - I've long suspected that Koha could benefit from using mod_perl, too. Do you know of any work done to see if it's possible or what changes would need to be made in order to allow it? Thanks, -Andy
I assume that C4::Context's overriding of Exporter's import method is a big problem for anyone wishing to run more than one Koha instance on a mod_perl enabled machine. While it's convenient to be able to just call C4::Context->dbh to get the active db handle from Context's package global $context, I think we will have to refactor much of Koha's api and start passing a $context object around instead of using the package global. Am I missing something, or will this be necessary to run multiple Kohas under mod_perl ? Ryan On Mon, Nov 24, 2008 at 8:38 AM, Andrew Moore <andrew.moore@liblime.com>wrote:
On Sat, Nov 22, 2008 at 7:24 PM, Rick Welykochy <rick@praxis.com.au> wrote:
Joshua Ferraro wrote:
Speed is definitely a major concern here ... and I believe it's one of the reasons that Koha originally wasn't written with an ORM. Andy, any thoughts about what this choice will mean w/respect to performance?
The use of mod_perl would speed things up by an order (and a half) of magnitude, giving the software more leeway to use abstractions like an OR mapper.
Hi Rick -
I've long suspected that Koha could benefit from using mod_perl, too. Do you know of any work done to see if it's possible or what changes would need to be made in order to allow it?
Thanks, -Andy _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-devel
-- Ryan Higgins LibLime * Open-Source Solutions for Libraries Featuring KohaZOOM ILS 888-564-2457 x704
Hmm, I hope that isn't the case. I have multiple instances of Koha running on a server with mod_perl installed. I haven't heard any complaints so far. On Mon, 2008-11-24 at 12:00 -0500, Ryan Higgins wrote:
I assume that C4::Context's overriding of Exporter's import method is a big problem for anyone wishing to run more than one Koha instance on a mod_perl enabled machine. While it's convenient to be able to just call C4::Context->dbh to get the active db handle from Context's package global $context, I think we will have to refactor much of Koha's api and start passing a $context object around instead of using the package global.
Am I missing something, or will this be necessary to run multiple Kohas under mod_perl ?
Ryan
On Mon, Nov 24, 2008 at 8:38 AM, Andrew Moore <andrew.moore@liblime.com> wrote: On Sat, Nov 22, 2008 at 7:24 PM, Rick Welykochy <rick@praxis.com.au> wrote: > Joshua Ferraro wrote: > >> Speed is definitely a major concern here ... and I believe it's one of >> the reasons that Koha originally wasn't written with an ORM. Andy, any >> thoughts about what this choice will mean w/respect to performance? > > The use of mod_perl would speed things up by an order (and a half) > of magnitude, giving the software more leeway to use abstractions > like an OR mapper.
Hi Rick -
I've long suspected that Koha could benefit from using mod_perl, too. Do you know of any work done to see if it's possible or what changes would need to be made in order to allow it?
Thanks, -Andy _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-devel
-- Ryan Higgins
LibLime * Open-Source Solutions for Libraries Featuring KohaZOOM ILS 888-564-2457 x704 _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-devel
-- Michael Hafen Systems Analyst and Programmer Washington County School District Utah, USA for Koha checkout http://koha-dev.washk12.org or git://koha-dev.washk12.org/koha
Hi Michael, On Mon, Nov 24, 2008 at 12:08 PM, Michael Hafen <mdhafen@tech.washk12.org> wrote:
Hmm, I hope that isn't the case. I have multiple instances of Koha running on a server with mod_perl installed. I haven't heard any complaints so far.
You're running Koha under Apache::PerlRun, not Apache::Registry, right? It's the latter that would likely give us a significant performance boost, but because of Apache::Registry's caching of scripts and variables, a lot of code would have to be refactored. Regards, Galen -- Galen Charlton VP, Research & Development, LibLime galen.charlton@liblime.com p: 1-888-564-2457 x709 skype: gmcharlt
I don't know if I have either installed. I might have misunderstood the use of the ubuntu libapache2-mod-perl2 package. How would I find out if I have either of those installed. Are they apache modules or perl modules? Thanks. On Mon, 2008-11-24 at 12:56 -0500, Galen Charlton wrote:
Hi Michael,
On Mon, Nov 24, 2008 at 12:08 PM, Michael Hafen <mdhafen@tech.washk12.org> wrote:
Hmm, I hope that isn't the case. I have multiple instances of Koha running on a server with mod_perl installed. I haven't heard any complaints so far.
You're running Koha under Apache::PerlRun, not Apache::Registry, right? It's the latter that would likely give us a significant performance boost, but because of Apache::Registry's caching of scripts and variables, a lot of code would have to be refactored.
Regards,
Galen -- Michael Hafen Systems Analyst and Programmer Washington County School District Utah, USA
for Koha checkout http://koha-dev.washk12.org or git://koha-dev.washk12.org/koha
Michael Hafen a écrit :
Hmm, I hope that isn't the case. I have multiple instances of Koha running on a server with mod_perl installed. I haven't heard any complaints so far.
wow... are you sure you're with mod_perl ? we did some test, on a small library, and the result was awful (with duplicated biblios, and other blockquing problems) -- Paul POULAIN http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc NOUVEAU TELEPHONE : 04 91 81 35 08
Paul POULAIN wrote:
Michael Hafen a écrit :
Hmm, I hope that isn't the case. I have multiple instances of Koha running on a server with mod_perl installed. I haven't heard any complaints so far.
wow... are you sure you're with mod_perl ? we did some test, on a small library, and the result was awful (with duplicated biblios, and other blockquing problems)
Yup, that backs up my general experience with mod_perl. If you have multiple definitions of environment variables and attempt to load different instances of the same perl modules (for example) all chaos breaks out. The solution: one instance of apache for each instance of Koha that you require. We are running about ten Kohas on one machine. Each uses its own instance of Apache. Nice and clean and most importantly: safe. cheer rickw -- _________________________________ Rick Welykochy || Praxis Services Tis the dream of each programmer before his life is done, To write three lines of APL and make the damn thing run.
I must not be running mod_perl then. I have misunderstood the purpose of the ubuntu package libapache2-mod-perl2. It seems to not include Apache2::PerlRun or Apache2::Registry which Galen pointed out. I guess it only allows for <perl> sections to the apache config files, and such. No script or environment caching. I have two installes of Koha 3 on the same instance of apache2 with no problems. I must not be using mod_perl. On Tue, 2008-11-25 at 22:14 +1100, Rick Welykochy wrote:
Paul POULAIN wrote:
Michael Hafen a écrit :
Hmm, I hope that isn't the case. I have multiple instances of Koha running on a server with mod_perl installed. I haven't heard any complaints so far.
wow... are you sure you're with mod_perl ? we did some test, on a small library, and the result was awful (with duplicated biblios, and other blockquing problems)
Yup, that backs up my general experience with mod_perl.
If you have multiple definitions of environment variables and attempt to load different instances of the same perl modules (for example) all chaos breaks out.
The solution: one instance of apache for each instance of Koha that you require.
We are running about ten Kohas on one machine. Each uses its own instance of Apache. Nice and clean and most importantly: safe.
cheer rickw
-- Michael Hafen Systems Analyst and Programmer Washington County School District Utah, USA for Koha checkout http://koha-dev.washk12.org or git://koha-dev.washk12.org/koha
Michael Hafen wrote:
I have two installes of Koha 3 on the same instance of apache2 with no problems. I must not be using mod_perl.
Is there a writeup on what things need to be (re)configured to get two separate instances of Koha running on one single Apache server, i.e. sharing the same namespace and serverspace? There must be some gotchas in doing this naively. cheers rickw -- _________________________________ Rick Welykochy || Praxis Services Tis the dream of each programmer before his life is done, To write three lines of APL and make the damn thing run.
Having managed this sort of configuration with MediaWiki, I've had thoughts about using it for hosting Koha instances. It has a number of advantages, including being more amenable to mod_perl. The biggest drawback to this configuration is when applications care about the port number on which the HTTP daemon received a request (as MediaWiki does) since it's invariably not the port that you want further requests to go to. Have you experienced issues like that with Koha? Clay On Tue, Nov 25, 2008 at 3:14 AM, Rick Welykochy <rick@praxis.com.au> wrote:
Paul POULAIN wrote:
Michael Hafen a écrit :
Hmm, I hope that isn't the case. I have multiple instances of Koha running on a server with mod_perl installed. I haven't heard any complaints so far.
wow... are you sure you're with mod_perl ? we did some test, on a small library, and the result was awful (with duplicated biblios, and other blockquing problems)
Yup, that backs up my general experience with mod_perl.
If you have multiple definitions of environment variables and attempt to load different instances of the same perl modules (for example) all chaos breaks out.
The solution: one instance of apache for each instance of Koha that you require.
We are running about ten Kohas on one machine. Each uses its own instance of Apache. Nice and clean and most importantly: safe.
cheer rickw
-- _________________________________ Rick Welykochy || Praxis Services
Tis the dream of each programmer before his life is done, To write three lines of APL and make the damn thing run. _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-devel
Clay Fouts wrote:
Having managed this sort of configuration with MediaWiki, I've had thoughts about using it for hosting Koha instances. It has a number of advantages, including being more amenable to mod_perl. The biggest drawback to this configuration is when applications care about the port number on which the HTTP daemon received a request (as MediaWiki does) since it's invariably not the port that you want further requests to go to. Have you experienced issues like that with Koha?
We use name-based virtual hosting instead of different ports. All web request to all Koha instances go to port 80, and then Apache sorts them out and dispatches by hostname. Fairly common and straightforward web farming technique, wouldn't you say ;) cheers rickw -- _________________________________ Rick Welykochy || Praxis Services Tis the dream of each programmer before his life is done, To write three lines of APL and make the damn thing run.
Oh, I misunderstood what you were describing. Saying "one instance of apache for each instance of Koha" led me to think you meant a separate apache process group (running under a different UID, with a different config file set, etc.) for each koha instance. It actually never occurred to me that someone would want to host two instances as http://myhost/koha1 and http://myhost/koha2 when name-based virtual hosting requires so little administrative overhead. So does anyone know of name-space or other conflicts arising from using mod_perl with one koha instance installed per virtual host? Thanks, Clay On Tue, Nov 25, 2008 at 3:27 PM, Rick Welykochy <rick@praxis.com.au> wrote:
Clay Fouts wrote:
Having managed this sort of configuration with MediaWiki, I've had thoughts about using it for hosting Koha instances. It has a number of advantages, including being more amenable to mod_perl. The biggest drawback to this configuration is when applications care about the port number on which the HTTP daemon received a request (as MediaWiki does) since it's invariably not the port that you want further requests to go to. Have you experienced issues like that with Koha?
We use name-based virtual hosting instead of different ports.
All web request to all Koha instances go to port 80, and then Apache sorts them out and dispatches by hostname.
Fairly common and straightforward web farming technique, wouldn't you say ;)
cheers rickw
-- _________________________________ Rick Welykochy || Praxis Services
Tis the dream of each programmer before his life is done, To write three lines of APL and make the damn thing run.
Hello Clay, Wednesday, November 26, 2008, 12:58:45 AM, you wrote: CF> So does anyone know of name-space or other conflicts arising from CF> using mod_perl with one koha instance installed per virtual host? hm... we have been using koha with mod perl (RegistryPrefork) since 3 years without problems on name-space;) http://bg.univ.szczecin.pl/strona_en/index.php?strona=4&link=2 -- The Main Library of Szczecin University. Computerization Department. http://bg.univ.szczecin.pl
Wojciech Zatorski wrote:
Hello Clay,
Wednesday, November 26, 2008, 12:58:45 AM, you wrote:
CF> So does anyone know of name-space or other conflicts arising from CF> using mod_perl with one koha instance installed per virtual host?
hm... we have been using koha with mod perl (RegistryPrefork) since 3 years without problems on name-space;)
http://bg.univ.szczecin.pl/strona_en/index.php?strona=4&link=2
As has been pointed out, all of your koha instances must share one set of perl modules. CAVEAT: If you attempt to mix, say, a test environment or development system into the shared services and use different include paths (@INC, %INC) in your code, then mod_perl will get confused. The first web child might see @INC=/usr/share/koha/libs and the second /home/rick/koha/dev. You will get grossly inconsistent (and often corrupted) results when using a web server set up in this configuration. cheers rickw -- _________________________________ Rick Welykochy || Praxis Services You go find out what they need and I'll start coding. -- two geeks
Wojciech -- Obviously 3 years ago would have been with a 2.2 (or perhaps earlier?) version of Koha. Have you upgraded to 3.x under the same environment? Can you also confirm that you have multiple Koha databases running concurrently on the same server? --Joe On Wed, Nov 26, 2008 at 1:58 AM, Wojciech Zatorski <listy-in@zatorski.net>wrote:
CF> So does anyone know of name-space or other conflicts arising from CF> using mod_perl with one koha instance installed per virtual host?
hm... we have been using koha with mod perl (RegistryPrefork) since 3 years without problems on name-space;)
http://bg.univ.szczecin.pl/strona_en/index.php?strona=4&link=2
-- The Main Library of Szczecin University. Computerization Department. http://bg.univ.szczecin.pl
Hello Joe, Wednesday, November 26, 2008, 4:48:56 PM, you wrote: JA> Wojciech -- JA> Obviously 3 years ago would have been with a 2.2 (or perhaps JA> earlier?) version of Koha. Have you upgraded to 3.x under the JA> same environment? yes.. version 2.2.x and no we still using 2.2.x as framework. JA> Can you also confirm that you have multiple JA> Koha databases running concurrently on the same server? yes on version 2.2.x we have multiple KOHA installation (perl code shared). my $r = Apache2::RequestUtil->request( ); $conf_fname = $r->dir_config('KOHA_CONF'); -- The Main Library of Szczecin University. Computerization Department. http://bg.univ.szczecin.pl
Frederic, regarding Apache2::Reload, I think that is an interesting module, but I find their performance warnings<http://perl.apache.org/docs/2.0/api/Apache2/Reload.html#Performance_Issues>offputting, basically that (1) you have to use a "touch" file and (2) child memory not shared back w/ parent, so memory load increases markedly. Their conclusion: This module is perfectly suited for a development environment. Though it's possible that you would like to use it in a production environment [to avoid restarts]... doing a full server stop and restart is probably a better solution. Currently we don't have to restart apache when code is updated. Of course increasing memory load not a surprise, since it is part of the idea behind caching, but their warning makes me wonder how much it might be. I think an apache restart is not a bad tradeoff if the performance benefit is there. Rick suggests running under different apache server instances for each Koha DB. This would be safest, and might work for some environments, but I don't think it will work well for a web farm like ours. It should be expected that running 50+ copies of Apache and 50+ perl interpreters and 50+ copies of the same core and required modules on each webserver in the farm is going to be detrimental to performance. And it pretty quickly defeats the point of caching. --Joe On Tue, Nov 25, 2008 at 4:54 AM, Paul POULAIN <paul.poulain@free.fr> wrote:
Michael Hafen a écrit :
Hmm, I hope that isn't the case. I have multiple instances of Koha running on a server with mod_perl installed. I haven't heard any complaints so far.
wow... are you sure you're with mod_perl ? we did some test, on a small library, and the result was awful (with duplicated biblios, and other blockquing problems)
-- Paul POULAIN http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc NOUVEAU TELEPHONE : 04 91 81 35 08
On Mon, Nov 24, 2008 at 07:38:38AM -0600, Andrew Moore wrote:
On Sat, Nov 22, 2008 at 7:24 PM, Rick Welykochy <rick@praxis.com.au> wrote:
The use of mod_perl would speed things up by an order (and a half) of magnitude, giving the software more leeway to use abstractions like an OR mapper.
I've long suspected that Koha could benefit from using mod_perl, too. Do you know of any work done to see if it's possible or what changes would need to be made in order to allow it?
Another technique is to switch from CGI to FastCGI. This has the same benefit as mod_perl, but can be used by most webservers, rather than just Apache. -kolibrie
Andrew Moore wrote:
I've long suspected that Koha could benefit from using mod_perl, too. Do you know of any work done to see if it's possible or what changes would need to be made in order to allow it?
There are unwanted caching effects, i.e. (*) data global to a script, i.e. file level variables, will persist across invocation which can caused surprising data leaks from one web request to the next. SOLUTION: get rid of file level data and move it into objects or subroutines (*) the scripts and perl modules themselves are precompiled and cached. When a script or module is modified the web server has to be restarted. There may be advantages to using other schemes to speed up web services. cheers rickw -- _________________________________ Rick Welykochy || Praxis Services Tis the dream of each programmer before his life is done, To write three lines of APL and make the damn thing run.
(*) the scripts and perl modules themselves are precompiled and cached. When a script or module is modified the web server has to be restarted.
Not necessarily: http://perl.apache.org/docs/2.0/api/Apache2/Reload.html -- Frédéric
participants (11)
-
Andrew Moore -
Clay Fouts -
Frederic Demians -
Galen Charlton -
Joe Atzberger -
Michael Hafen -
Nathan Gray -
Paul POULAIN -
Rick Welykochy -
Ryan Higgins -
Wojciech Zatorski