On Thu, 4 Sep 2003, Chris Cormack wrote:
Yep, I think to get some real speed increases, we'd need to look into mod_perl and Apache::DBI to get some connection pooling.
I plan on doing this after 2.0 comes out if noone else beats me to it. CGI is great for development, but crapola for serious deployment. :) mod_perl rocks and they've got the 'beta' mod_perl for apache 2.0 thoroughly bug fixed at this point. 2.0 offers whole new avenues for tweaking things to improve performance. "Maybe a multi-threaded apache would make intel hyperthreading useful under linux, let's try...."
I suspect that starting up perl, and making database connections are 2 of the bottlenecks.
Oh yes. Even MySQL takes a significant time to setup a database connection compared to the rest of the perl script. Sadly that's nothing compared to the heavyweight time required to connect to heavyweight database like Oracle and DB2. I actually had a really scary script come across my desk a year ago, written by a very smart scientist (sigh). The script had a database connection to a server three states away inside the inner loop that ran 50 times for every script invocation. Apparently they needed a consultant to explain to them that the script as written was going to take 45 secs per CGI invocation, that it couldn't run in mod_perl because the Perl was so very ugly, and oh by the way, pull this out of the inner loop and things will get much quicker. Despite that, in looking at profiling data throughout that process to see where the script was really sucking wind the SQL connection portion of things and loading modules were the real crunchers. Loading DBI and doing a database connection on a P90 isn't too painful. On older hardware the slow I/O tends to make Perl seem slower because it pulls in so many different files and processes them when it starts up. That still doesn't mean the old hardware is useless for Perl/Koha, but that a different strategy might be required - like a Perl daemon accepting telnets.
But once we get 2.0 out, we can do some work with the profiler tools and spot any bottlenecks and fix them.
Profiling is pretty easy to do and and can be extremely helpful. It may or may not surprise you with its answers, but it's so nice to see and have real numbers. -- </chris> The death of democracy is not likely to be an assassination from ambush. It will be a slow extinction from apathy, indifference, and undernourishment. -Robert Maynard Hutchins, educator (1899-1977)