[Koha-bugs] [Bug 27880] Store each database migrations state in database

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Jul 5 06:40:25 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27880

--- Comment #25 from David Cook <dcook at prosentient.com.au> ---
(In reply to Julian Maurice from comment #17)
> (In reply to Julian Maurice from comment #14)
> > It would be interesting to see how much time it takes to process a directory
> > of 100, 1000 and 10000 entries (we are getting close to 1500 updates
> > actually in master)
> 
> Just ran a quick test:
> 
> Time to execute pending_migrations with an empty executed_migrations table
> and:
> - 100 migration files: <1ms
> - 1000 migration files: ~1.2ms
> - 10000 migration files: ~6ms
> 
> Time to execute pending_migrations with a full executed_migrations table and:
> - 1000 migration files: ~1.6ms
> - 10000 migration files: ~12ms
> 
> Note that I got these times with two small modifications I made to
> pending_migrations, which I will submit with the rebased patch, they save a
> few ms in the "10000 files" test.
> 
> One way to avoid slowdowns as the number of files grows is to check for
> pending migrations only once at the start of the application, and not at
> every request.

I'm a bit surprised that pending_migrations ran that fast. It takes me a lot
longer just to load C4::Context and get a database handle via C4::Context->dbh
on koha-testing-docker. Did you run that on koha-testing-docker or on a server?

--

Regarding only checking for migrations at the start of the application, that's
a good point. I've noticed that's what other (persistent) applications do as
well. I think we have consensus at this point that Koha should always be run
persistently, so I think that is a reasonable move to make.

That said, I'm less worried about slowdowns with the web UI vs
updatedatabase.pl, since updatedatabase.pl is where I notice the worst
performance impacts when installing a new koha-common package.

What do you think about bug 34088 in this context? If the code version and the
database version match and there are no atomic updates to run, it exits out of
updatedatabase.pl. Koha::Migrations does look pretty minimal, but I found
C4::Context to be too slow, so I used Koha::Database::dbh() and Koha::Config
for a database handle and config since they were much faster to load and use.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list