Search code examples
performancehsqldb

Why does starting a server with HSQLDB take very long with large NIO sizes


I run a java server using a file-based HSQL database and imported a large amount of data yielding a .data file around 25gb. To speed up the database import I set the files NIO size property to 30gb, which speeds up the process significantly. However, when I restart the server some SQL queries are performed and it takes very long to obtain a connection the first time with the last log line reading:

dataFileCache commit start
copyShadow [size, time] 98376 4

I figured out that when I reduce the NIO parameter to a size that is below the one of the .data file (8gb for example) the server starts much faster.

Why does a large NIO size parameter increase my server restart time ? And does it make sense to reduce the NIO size assuming that after the initial data import the database is mostly used for read-only operations and a fast server restart time is desired ?


Solution

  • When the NIO size property is below the size of the existing .data file, NIO is not used at all.

    The problem is probably related to how you shutdown the server. You need to perform the SQL statement "SHUTDOWN" (not "SHUTDOWN IMMEDIATELY") to close the database. Doing so will reduce the next startup tome.