[AUTO_SERVER] Connection takes 2 minutes

120 views
Skip to first unread message

LRichard

unread,
Nov 12, 2012, 3:38:39 AM11/12/12
to h2-da...@googlegroups.com
We're using H2 to embed a database with our product for some months now and we really appreciate the functionalities of H2.
We're using the auto-mixed (AUTO_SERVER) mode in order to allow concurrent access from several processes without imposing our customers to set up a H2 server. This works fine but one of our customer recently complained that its connection to the database was too slow. So we asked him to activate the traces in order to get more information and we realized that putting the file lock on the database indeed took 2 minutes. Such a delay is not acceptable for our customer.
Here is an extract of the log our customer gave us :
[...]
17:26:34.475 INFO  h2database - big:database opening C:/PSOCGEN/WBIG/BIGBASES/big (build 168)
17:26:34.475 DEBUG h2database - big:fileLock load {method=file, id=13ae5fbf3f5e871d65716139fb167107b5b605250b8}
17:26:34.522 DEBUG h2database - big:fileLock load {method=file, id=13ae5fbf3f5e871d65716139fb167107b5b605250b8}
17:26:34.522 DEBUG h2database - big:fileLock save {id=13ae5fe889a9f541ad0ae7697cce954ae1c3f81b439, method=file}
17:26:36.522 DEBUG h2database - big:fileLock load {method=file, id=13ae5fe889a9f541ad0ae7697cce954ae1c3f81b439}
17:26:36.522 DEBUG h2database - big:fileLock save {id=13ae5fe889a9f541ad0ae7697cce954ae1c3f81b439, method=file}
17:26:36.554 DEBUG h2database - big:fileLock load {method=file, id=13ae5fe889a9f541ad0ae7697cce954ae1c3f81b439}
17:28:36.710 DEBUG h2database - big:fileLock save {server=192.32.86.230:8090, id=13ae5fe889a9f541ad0ae7697cce954ae1c3f81b439, method=file}
17:28:36.725 DEBUG h2database - big:pageStore log recover
17:28:36.725 DEBUG h2database - big:pageStore log recover stage: 0
17:28:36.725 DEBUG h2database - big:pageStore log recovery completed
17:28:36.725 DEBUG h2database - big:pageStore log recover stage: 1
17:28:36.725 DEBUG h2database - big:index PAGE_INDEX_DATA opened rows: 149
17:28:36.725 DEBUG h2database - big:pageStore addMeta id=0 type=0 root=12 parent=0 columns=0,1,2,3
17:28:36.725 DEBUG h2database - big:index T0_DATA opened rows: 354
17:28:36.725 DEBUG h2database - big:pageStore addMeta id=2 type=0 root=11 parent=2 columns=0,1,2
17:28:36.725 DEBUG h2database - big:index T2_DATA opened rows: 0
17:28:36.725 DEBUG h2database - big:pageStore addMeta id=6 type=0 root=9 parent=6 columns=0,1,2,3,4
[...]
Such a lock is almost immediate in our own configurations. What can explain this 2 minutes delay ? We thought our customer might have a firewall slowing the available port search and we asked him to force the value of the port using AUTO_SERVER_PORT but that changed nothing. On the other hand, not using the AUTO_SERVER mode made the connection very fast (but this could be done only for test and cannot be kept in production).

Any help of any kind would be much appreciated since we don't know what to investigate.

Thanks by advance

Thomas Mueller

unread,
Nov 12, 2012, 3:18:50 PM11/12/12
to h2-da...@googlegroups.com
Hi,

Could you try to find out what the database is doing during the 2 minutes? To find out, you could use "jps -l" (to get the process id) and then "jstack -l <pid>" (to get a few full thread dumps). I guess it's some kind of networking issue, but I'm not sure. Could you also run "./build.sh testNetwork" on this system and post the result?

Regards,
Thomas




--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/Q-n6XCrCaZEJ.
To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.

LRichard

unread,
Nov 12, 2012, 6:00:27 PM11/12/12
to h2-da...@googlegroups.com
Thanks a lot for your answer Thomas.

I'll do my best to get the information you mention but I don't have access to the system encountering the problem and I don't know if a JDK can easily be installed on it.
Is there a way to execute something equivalent to "build testNetwork" without the whole H2 sources ? I can get this on my own workstation but I guess it will be more difficult on the system with the issue (our customer won't feel comfortable with it).
I also asked him to try to connect with his firewall disabled (it's the MS Windows built-in firewall).
I'll keep you informed as soon as I can get something useful.

Best regards,
Laurent

LRichard

unread,
Nov 12, 2012, 6:13:23 PM11/12/12
to h2-da...@googlegroups.com
OK. Found the code of testNetwork in Build.java. I will package it in a standalone jar in order to help our customer executing it.

LRichard

unread,
Nov 14, 2012, 4:06:53 AM11/14/12
to h2-da...@googlegroups.com
Hi,

I joined the results of jstack (stack.txt) and testNetwork (network.txt) from the system. I don't feel able to conclude anything from this...
I'll ask our customer to do one more test because I wonder if the cause could not be the definition of proxies on the system (by default, our application sets the java property java.net.useSystemProxies to true).
Thank you

Regards,
Laurent
network.txt
stack.txt

LRichard

unread,
Nov 21, 2012, 5:43:49 AM11/21/12
to h2-da...@googlegroups.com

Hi,

We had to set the system java property java.net.useSystemProxies to false to get rid of this 2 minutes connection delay in AUTO_SERVER mode.
However, I don't understand why this setting led to this delay. After waiting 2 minutes, the connection was OK. Moreover, our customer gave his Windows proxy settings (see joined screen captures) and the local IPs are excluded.
So I can't explain the source of this 2 minutes delay. Moreover, we weren't able to reproduce these symptoms in our own test environment when Windows proxies are defined.

Does any one have any clue ?
Thanks

Keeping java.net.useSystemProxies to false is not a very big deal but we planned to set it to true in order ease access to several web resources without having to deal with our own proxies settings for the application...

Regards,
Laurent

Noel Grandin

unread,
Nov 22, 2012, 10:54:14 AM11/22/12
to h2-da...@googlegroups.com, LRichard
sounds like a DNS misconfiguration.
Something is trying to do a DNS resolution, timing out, then continuing.
--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/120zrV4TGDEJ.

LRichard

unread,
Nov 25, 2012, 5:50:13 AM11/25/12
to h2-da...@googlegroups.com, LRichard
Thank you Noel

We will investigate this and check if all names in the proxy exclusion list (or even the proxy name itself) are OK on the system with the issue.

Regards
Laurent
Reply all
Reply to author
Forward
0 new messages