Koha performance enhancement overview
Everyone, I was doing some thinking this weekend about the overall goal of making Koha perform faster. We're approaching this from several different angles, so I thought it might be a good idea to come up with a summary of all the various methods we could use to speed Koha up. Tuning & Hardware (http://wiki.koha-community.org/wiki/Koha_Tuning_Guide) - Hardware selection guide (how much CPU, RAM and disk to run Koha on) - Tuning the operating system - Tuning Apache - Tuning MySQL Performance tools - Alternate, Persistent Perl interpreters, like Plack/PSGI or mod_perl/FastCGI (http://wiki.koha-community.org/wiki/Plack) - Alternate webservers like Nginx or Starman - caching tools like memcached or T:T cache Code cleanup - Denesting dependencies - Optimizing SQL queries - Dual database handles (readonly, read/write) - Simplifying code - Minimizing XML parsing Network latency - AJAX calls for key functions like circ (cheaper to send/receive than full page loads) - Minifying JS and CSS ( http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=1918) - CSS sprites (css-tricks.com/css-sprites/) - caching some data client-side (like user preferences) in cookies or localStorage Ergonomics - Fewer clicks to do common actions - Display important info more prominently - Preferences to customize to individuals' workflows Now, here's the question: which of these techniques will net us the biggest boosts for the least effort? We've got lots of great work on Plack so far, but would figuring out the perfect MySQL tuning settings be easier and give us a similar performance enhancement (I don't know, just using as an example)? Some of these are of course inter-related; doing code cleanup and denesting would make it easier to do AJAX calls or use mod_perl. I should probably dump this into a wiki page, but I wanted to raise the issue on-list first. Does anyone have any data that we could use to determine what above is low-hanging fruit, or what will get the biggest gains? We're lucky in this community in that we have many, many kinds of expertise, so we're not limited to pursuing any one course at a time, but having a coordinated effort would help us reap more tangible benefits sooner. Cheers, -Ian
As an end-user, I've found ySlow & Page Speed to be helpful: http://developer.yahoo.com/yslow/ https://developers.google.com/speed/pagespeed/ http://gtmetrix.com/ runs both analyses at once. Our catalog's site gets grades of 75-80%. I'll leave it to the developers to figure out which recommendations are worthwhile. Cheers, Cab Vinton, Director Sanbornton Public Library Sanbornton, NH
On Mon, Apr 09, 2012 at 09:54:35AM -0400, Ian Walls wrote:
Everyone,
I was doing some thinking this weekend about the overall goal of making Koha perform faster. We're approaching this from several different angles, so I thought it might be a good idea to come up with a summary of all the various methods we could use to speed Koha up.
I submitted talk proposal for KohaCon hackfest in which I plan to cover similar topics. I allmost feel like you wrote my talk overview :-)
Tuning & Hardware (http://wiki.koha-community.org/wiki/Koha_Tuning_Guide)
- Hardware selection guide (how much CPU, RAM and disk to run Koha on) - Tuning the operating system - Tuning Apache - Tuning MySQL
Performance tools
- Alternate, Persistent Perl interpreters, like Plack/PSGI or mod_perl/FastCGI (http://wiki.koha-community.org/wiki/Plack) - Alternate webservers like Nginx or Starman
Starman is part of plack if you want to run multiple processes. However, you would like to put some web server or http proxy in front of it, at least for static content so you don't need to run perl code for it.
- caching tools like memcached or T:T cache
T:T cache is so essential, that we should make it enabled as default, and not as on option.
Code cleanup
- Denesting dependencies - Optimizing SQL queries - Dual database handles (readonly, read/write)
I'm missing caching here. I did experiments with memoizing, I just haven't had time to rebase them to current master and re-run benchmarks again. With cache, spliting handles and replication becomes allmost non-issue :-)
- Simplifying code - Minimizing XML parsing
I had one patch with this which uses marc instead of marcxml from biblioitems to provide huge performance improvement: http://git.rot13.org/?p=koha.git;a=commitdiff;h=a18a7f709447cccf617e8fa5b545... (it needs cleanup, rebase and probably own bug)
Network latency
- AJAX calls for key functions like circ (cheaper to send/receive than full page loads) - Minifying JS and CSS ( http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=1918) - CSS sprites (css-tricks.com/css-sprites/)
I write Moose based web framework a while ago, which had this feature: http://svn.rot13.org/index.cgi/Frey/view/trunk/lib/Frey/Web/CombineImages.pm It turns out that it really pays off for icons or other more-or-less fixed sized assets which are often requested. I could rewrite it into Template Toolkit plugin, I guess :-)
- caching some data client-side (like user preferences) in cookies or localStorage
Ergonomics
To be honest, erfonomics didn't cross my mind, but it's a important point!
- Fewer clicks to do common actions - Display important info more prominently - Preferences to customize to individuals' workflows
Now, here's the question: which of these techniques will net us the biggest boosts for the least effort? We've got lots of great work on Plack so far, but would figuring out the perfect MySQL tuning settings be easier and give us a similar performance enhancement (I don't know, just using as an example)? Some of these are of course inter-related; doing code cleanup and denesting would make it easier to do AJAX calls or use mod_perl.
I would vote for accessor simplification and memoizing as smallest changes which biggest impact. In fact, that's why I proposed myself as performance bug wrangler in the first place.
I should probably dump this into a wiki page, but I wanted to raise the issue on-list first. Does anyone have any data that we could use to determine what above is low-hanging fruit, or what will get the biggest gains? We're lucky in this community in that we have many, many kinds of expertise, so we're not limited to pursuing any one course at a time, but having a coordinated effort would help us reap more tangible benefits sooner.
I started http://wiki.koha-community.org/wiki/Performance as dumping ground for topics which I would like to cover at KohaCon. I think that this breakdown would be great addition to it :-) -- Dobrica Pavlinusic 2share!2flame dpavlin@rot13.org Unix addict. Internet consultant. http://www.rot13.org/~dpavlin
On Mon, Apr 9, 2012 at 1:03 PM, Dobrica Pavlinusic <dpavlin@rot13.org>wrote:
- Simplifying code - Minimizing XML parsing
I had one patch with this which uses marc instead of marcxml from biblioitems to provide huge performance improvement:
http://git.rot13.org/?p=koha.git;a=commitdiff;h=a18a7f709447cccf617e8fa5b545...
(it needs cleanup, rebase and probably own bug)
That's spectacular. What's keeping us from pushing that now? Kind Regards, Chris
2012/4/10 Chris Nighswonger <cnighswonger@foundations.edu>:
On Mon, Apr 9, 2012 at 1:03 PM, Dobrica Pavlinusic <dpavlin@rot13.org> wrote:
- Simplifying code - Minimizing XML parsing
I had one patch with this which uses marc instead of marcxml from biblioitems to provide huge performance improvement:
http://git.rot13.org/?p=koha.git;a=commitdiff;h=a18a7f709447cccf617e8fa5b545...
(it needs cleanup, rebase and probably own bug)
That's spectacular. What's keeping us from pushing that now?
It is indeed spectacular Unfortunately, it is now missing all the item information. So it still needs to call C4::Biblio::EmbedItemsInMarcBiblio($record, $biblionumber) if ($embeditems); Can you test it with that ? Chris
On Mon, Apr 9, 2012 at 8:08 PM, Chris Cormack <chris@bigballofwax.co.nz> wrote:
2012/4/10 Chris Nighswonger <cnighswonger@foundations.edu>:
On Mon, Apr 9, 2012 at 1:03 PM, Dobrica Pavlinusic <dpavlin@rot13.org> wrote:
- Simplifying code - Minimizing XML parsing
I had one patch with this which uses marc instead of marcxml from biblioitems to provide huge performance improvement:
http://git.rot13.org/?p=koha.git;a=commitdiff;h=a18a7f709447cccf617e8fa5b545...
(it needs cleanup, rebase and probably own bug)
That's spectacular. What's keeping us from pushing that now?
It is indeed spectacular
Unfortunately, it is now missing all the item information. So it still needs to call C4::Biblio::EmbedItemsInMarcBiblio($record, $biblionumber) if ($embeditems);
Can you test it with that ?
One other thought: Won't $record = MARC::Record::new_from_usmarc( $row->{marc} ) choke on normarc, unimarc, and friends? I'm wondering if this was not part of the reason we went to XML... Kind Regards, Chris
Chris(es),
It is indeed spectacular
Unfortunately, it is now missing all the item information. So it still needs to call C4::Biblio::EmbedItemsInMarcBiblio($record, $biblionumber) if ($embeditems);
Can you test it with that ?
The problem with this is that it won't handle large records (serials with lots of items most spectacularly). Using this would require us to access item data directly, rather than embedding it.
One other thought: Won't $record = MARC::Record::new_from_usmarc( $row->{marc} ) choke on normarc, unimarc, and friends?
No, new_from_usmarc isn't well-named. It just translates from MARC blobs. Regards, Jared -- Jared Camins-Esakov Bibliographer, C & P Bibliography Services, LLC (phone) +1 (917) 727-3445 (e-mail) jcamins@cpbibliography.com (web) http://www.cpbibliography.com/
Actually...
[snip]
The problem with this is that it won't handle large records (serials with lots of items most spectacularly). Using this would require us to access item data directly, rather than embedding it.
Chris Cormack and I just discussed this, and concluded that actually the format limitations aren't relevant here, since we don't serialize the record. So I withdraw my objection. The question is, do we keep the performance benefits if we add the item embedding back in? Regards, Jared -- Jared Camins-Esakov Bibliographer, C & P Bibliography Services, LLC (phone) +1 (917) 727-3445 (e-mail) jcamins@cpbibliography.com (web) http://www.cpbibliography.com/
Le 10/04/2012 02:22, Chris Nighswonger a écrit :
One other thought: Won't $record = MARC::Record::new_from_usmarc( $row->{marc} ) choke on normarc, unimarc, and friends? I'm almost sure that's not a problem. The "usmarc" here is an misnamed function. It could/should be iso2709 I think (MARC::Record::new_from_iso2709)
There's the same kind of problem with ->title() and ->author() (that, fortunately, Koha never uses and you should forget) = it is marc21 only, and return useless things in UNIMARC. -- Paul POULAIN http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc Tel : (33) 4 91 81 35 08
participants (7)
-
Cab Vinton -
Chris Cormack -
Chris Nighswonger -
Dobrica Pavlinusic -
Ian Walls -
Jared Camins-Esakov -
Paul Poulain