Hi there!
Problem summary:
* The database "freezes" for a couple of minutes when receiving data
at commit time (normally 2 - 5 minutes)
* At that time no one can do connect/select/insert (or any operations)
H2 Version: 1.4.197
Java Version: openjdk version "1.8.0_151" on RHEL
Here is how the application works:
* The application receives data via a web interface as JSON (I use an
embedded Jetty as the web server)
* Stores the information in H2 (using smaller JDBC batches, that is
surrounded by a transaction)
* (the web server also has a couple of entry point to get data from
H2)
So it's pretty simple.
H2 URL:
jdbc:h2:file:/home/sybase/.dbxtune/dbxc/data/DBXTUNE_CENTRAL_DB;DATABASE_TO_
UPPER=false;MAX_COMPACT_TIME=2000;COMPRES
S=TRUE;WRITE_DELAY=30000;DB_CLOSE_ON_EXIT=FALSE
The size of the database (DBX_CENTRAL_DB)
* 75 GB (and constantly growing)
* Not important: the DB growth is a bit strange, sometimes it grows
*much* and sometimes it's a constant growth, even if the amount of data sent
to it is the "same")
* When the database was smaller, there was no issues
At the end-of-the-mail is a stack trace when it "freezes" (using jstack)
>From what I can understand from the stack trace is that:
* On commit: it tries to "cleanup"
* But the cleanup takes too long (it has to read a lot of data)
* If I use "jvmtop" to see where it spends time during the freeze it
on: org.h2.store.fs.FileNio.read()
So:
* Is there any way to get around this behaviour?
* If it's a known issue in version 197 that is fixed/checked in on
github
* Is there any nightly build that I can get "somewhere"
Thanks for your time and answers
/Goran Schwarz
"CentralPcsWriterHandler" #15 prio=5 os_prio=0 tid=0x00007f3d1c5c6300
nid=0x457f runnable [0x00007f3d00841000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.NativeThread.current(Native Method)
at sun.nio.ch.NativeThreadSet.add(NativeThreadSet.java:46)
at sun.nio.ch.FileChannelImpl.readInternal(FileChannelImpl.java:737)
at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:727)
at org.h2.store.fs.FileNio.read(FilePathNio.java:74)
at org.h2.mvstore.DataUtils.readFully(DataUtils.java:403)
at org.h2.mvstore.FileStore.readFully(FileStore.java:98)
at org.h2.mvstore.Page$PageChildren.read(Page.java:1055)
at org.h2.mvstore.MVStore.readPageChunkReferences(MVStore.java:1356)
at org.h2.mvstore.MVStore.collectReferencedChunks(MVStore.java:1301)
at org.h2.mvstore.MVStore.collectReferencedChunks(MVStore.java:1306)
at org.h2.mvstore.MVStore.collectReferencedChunks(MVStore.java:1306)
at org.h2.mvstore.MVStore.collectReferencedChunks(MVStore.java:1306)
at org.h2.mvstore.MVStore.collectReferencedChunks(MVStore.java:1286)
at org.h2.mvstore.MVStore.freeUnusedChunks(MVStore.java:1248)
- locked <0x000000008055bc88> (a org.h2.mvstore.MVStore)
at org.h2.mvstore.MVStore.freeUnusedIfNeeded(MVStore.java:1238)
at org.h2.mvstore.MVStore.storeNowTry(MVStore.java:1025)
at org.h2.mvstore.MVStore.storeNow(MVStore.java:1016)
at org.h2.mvstore.MVStore.commitAndSave(MVStore.java:1005)
- locked <0x000000008055bc88> (a org.h2.mvstore.MVStore)
at org.h2.mvstore.MVStore.commit(MVStore.java:966)
- locked <0x000000008055bc88> (a org.h2.mvstore.MVStore)
at
org.h2.mvstore.db.TransactionStore.endTransaction(TransactionStore.java:489)
- locked <0x0000000080df8ae8> (a org.h2.mvstore.db.TransactionStore)
at
org.h2.mvstore.db.TransactionStore.commit(TransactionStore.java:385)
at
org.h2.mvstore.db.TransactionStore$Transaction.commit(TransactionStore.java:
807)
at org.h2.engine.Session.commit(Session.java:661)
at
org.h2.command.dml.TransactionCommand.update(TransactionCommand.java:46)
at org.h2.command.CommandContainer.update(CommandContainer.java:102)
at org.h2.command.Command.executeUpdate(Command.java:261)
- locked <0x000000008020c5a8> (a org.h2.engine.Database)
at org.h2.jdbc.JdbcConnection.commit(JdbcConnection.java:497)
- locked <0x000000008020c718> (a org.h2.jdbc.JdbcConnection)
at
com.asetune.sql.conn.DbxConnection.commit(DbxConnection.java:1661)
at
com.asetune.central.pcs.CentralPersistWriterJdbc.saveGraphDataDdl(CentralPer
sistWriterJdbc.java:2666)
at
com.asetune.central.pcs.CentralPersistWriterJdbc.saveGraphData(CentralPersis
tWriterJdbc.java:2520)
at
com.asetune.central.pcs.CentralPersistWriterJdbc.saveCounterData(CentralPers
istWriterJdbc.java:2115)
at
com.asetune.central.pcs.CentralPersistWriterJdbc.saveSample(CentralPersistWr
iterJdbc.java:1853)
at
com.asetune.central.pcs.CentralPcsWriterHandler.consume(CentralPcsWriterHand
ler.java:681)
at
com.asetune.central.pcs.CentralPcsWriterHandler.run(CentralPcsWriterHandler.
java:783)
at java.lang.Thread.run(Thread.java:748)
"MVStore background writer
nio:/sybdev/asetune/data/DBXTUNE_CENTRAL_DB.mv.db" #14 daemon prio=5
os_prio=0 tid=0x00007f3d1c41c990 nid=0x4570 waiting for monitor entry
[0x00007f3d00b43000]
java.lang.Thread.State: BLOCKED (on object monitor)
at org.h2.mvstore.MVStore.commitAndSave(MVStore.java:983)
- waiting to lock <0x000000008055bc88> (a org.h2.mvstore.MVStore)
at org.h2.mvstore.MVStore.writeInBackground(MVStore.java:2477)
at
org.h2.mvstore.MVStore$BackgroundWriterThread.run(MVStore.java:2713)
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.