[Koha-devel] DBIx::Class vs current Koha's DBI performance
Dobrica Pavlinusic
dpavlin at rot13.org
Tue Oct 26 19:17:35 CEST 2010
I just figured out today that kohacon10 is in progress, and one of
topics seems to be DBIx::Class migration.
Let me start by saying that I'm all for it, but probably not for same
resons as everybody else.
I was trying to profile koha search page. On first run under
Devel::NYTProf it showed 2220 invocations of DBI::st::execute.
That's more than 2000 calls which wait for database to return answer.
This might explain extremly high usage of mysql query cache which I'm
seeing in production:
http://mjesec.ffzg.hr/munin/koha/koha-mysql_queries.html
So, I decided to experiment a bit. and few patches later I was able
to reduce number of queries issued on each page load down to 876
If you are interested in what I changed, my code is at:
http://git.rot13.org/?p=koha.git;a=shortlog;h=refs/heads/nytprof-cache
It's basically using either global hash to cache values per request of
simple memoize around function.
Which brings me back to DBIx::Class. If we can cache values using dbic,
this will be huge WIN for Koha performance as opposed to loss :-)
I never used dbic in that contex, but google seems to think it's
possible, and I'm willing to take a try at it.
--
Dobrica Pavlinusic 2share!2flame dpavlin at rot13.org
Unix addict. Internet consultant. http://www.rot13.org/~dpavlin
More information about the Koha-devel
mailing list