H2 Database running really slow on mac OS sierra

748 views
Skip to first unread message

Jonathan Serranyaw

unread,
Oct 27, 2016, 5:22:43 AM10/27/16
to H2 Database
I've observed severe slowdown after mac os sierra update i wonder if anyone is experiencing the same problems as i

Jonathan Serranyaw

unread,
Nov 2, 2016, 2:50:58 AM11/2/16
to H2 Database
The slow down was specifically on the creation of new connections and the shutting down of opened connections

dob...@gmail.com

unread,
Nov 9, 2016, 3:50:42 AM11/9/16
to H2 Database
Hey, i had the same problem.
I could resolve it with using localhost:8082 instead of MyIP-Adress:8082

res...@gmail.com

unread,
Nov 14, 2016, 11:35:33 PM11/14/16
to H2 Database
I'm seeing the same thing: both starting up an H2 server and shutting it down take somewhat longer.  I'm always using "localhost" as the server host name.

Frank Berger

unread,
Nov 15, 2016, 5:05:24 PM11/15/16
to H2 Database
I assume this will help:

in a nutshell: resolving localhost is doing whatever,  and adding this
127.0.0.1   localhost aNicerName
::1         localhost 

to /etc/host should resolve the issue

<rant>
I still remember Jobs claiming that OSX should be the best platform for Java..... things changed a lot.....
</rant>

Tomas Pospichal

unread,
Nov 15, 2016, 5:29:56 PM11/15/16
to H2 Database
One possibility for slowdowns when opening a connection: sometimes even innocent looking net calls from Java produce reverse DNS attempts, which could cause visible slowdowns on a local network. In this situation, using an IP address might be paradoxically slower than using a host name.

This behavior might be very system dependent, so it is better to state what version of system and Java you have, and what URL string you used (was it SSL?).

For illustration, see
http://stackoverflow.com/questions/3193936/how-to-disable-javas-ssl-reverse-dns-lookup?rq=1
or
https://github.com/spray/spray/issues/993

Regards,
Tomas

res...@gmail.com

unread,
Nov 19, 2016, 2:32:14 PM11/19/16
to H2 Database
Some further testing in my case shows the issue is related to Java 8, because Java 7 does not show the slowdown.
I am still seeing the issue with Java 8u112 (which has several Sierra-related fixes in it).
Using h2 version 1.4.193 with url:
jdbc:h2:ssl://localhost:8955///Users/bob/path-to-my/db;MVCC=TRUE;MAX_COMPACT_TIME=5000;MV_STORE=FALSE

Bob

res...@gmail.com

unread,
Nov 19, 2016, 3:13:22 PM11/19/16
to H2 Database
Update: I downloaded the tester from thoeni.io and ran the test before and after applying the /etc/hosts change.
The tester did not show any improvement at all: still about 5ms to execute.

However, my real app (a Spring Boot web-app running in Tomcat 8 accessing H2 in server mode) now appears to start and stop as quickly as it did before I installed MacOS Sierra.
So I call that a win!

Bob

Thomas Mueller Graf

unread,
Nov 24, 2016, 12:01:58 PM11/24/16
to h2-da...@googlegroups.com
Hi,

Yes, I guess the problem is that somehow it's trying to resolve "localhost". I'm hoping there is a simple workaround for H2, but I'm not sure.

Regards,
Thomas

--
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 h2-database+unsubscribe@googlegroups.com.
To post to this group, send email to h2-da...@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Thomas Mueller Graf

unread,
Nov 24, 2016, 12:04:12 PM11/24/16
to h2-da...@googlegroups.com
Hi,

Yes, I guess the problem is that somehow it's trying to resolve "localhost". I'm hoping there is a simple workaround for H2, but I'm not sure.

Regards,
Thomas



On Saturday, November 19, 2016, <res...@gmail.com> wrote:
--

Jay Ravindra

unread,
Dec 15, 2018, 1:02:51 PM12/15/18
to H2 Database
Thank you so much. it really works for me
Reply all
Reply to author
Forward
0 new messages