为什么使用HSQLDB启动服务器需要很长的NIO大小

时间:2021-03-22 04:06:29

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:

我使用基于文件的HSQL数据库运行java服务器并导入大量数据,产生大约25gb的.data文件。为了加快数据库导入,我将文件NIO size属性设置为30gb,这大大加快了进程。但是,当我重新启动服务器时,会执行一些SQL查询,并且第一次获取连接需要很长时间才能读取最后一个日志行:

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.

我想通过当我将NIO参数减小到低于.data文件(例如8gb)之一的大小时,服务器启动的速度要快得多。

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 ?

为什么大的NIO大小参数会增加我的服务器重启时间?假设在初始数据导入后数据库主要用于只读操作并且需要快速的服务器重启时间,那么减少NIO大小是否有意义?

1 个解决方案

#1


1  

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

当NIO size属性低于现有.data文件的大小时,根本不使用NIO。

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.

问题可能与您关闭服务器的方式有关。您需要执行SQL语句“SHUTDOWN”(而不是“立即关闭”)才能关闭数据库。这样做会减少下一个启动时间。

#1


1  

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

当NIO size属性低于现有.data文件的大小时,根本不使用NIO。

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.

问题可能与您关闭服务器的方式有关。您需要执行SQL语句“SHUTDOWN”(而不是“立即关闭”)才能关闭数据库。这样做会减少下一个启动时间。