After upgrading to macOS Sierra, the communication between Spring Data and MongoDB is somehow extremely slow, basically not usable.
Concretely, a collection of interactions with the database which previously took ~100 ms, now takes ~10 minutes.
I'm using the most recent stable versions of the driver and spring data:
MongoDB Java Driver
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver</artifactId>
<version>3.3.0</version>
</dependency>
Spring Data MongoDB
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
<version>1.9.3.RELEASE</version>
</dependency>
Furthermore, I have installed MongoDB using Homebrew.
mongod --version
:
db version v3.2.9
git version: 22ec9e93b40c85fc7cae7d56e7d6a02fd811088c
OpenSSL version: OpenSSL 1.0.2h 3 May 2016
allocator: system
modules: none
build environment:
distarch: x86_64
target_arch: x86_64
I am not really sure how to resolve this issue. Let me know if you think I should post this elsewhere, and I will.
Thanks.
Update 1: Problem of slowness is still there, after trying to run mongodb in a docker container instead of running it on macOS Sierra.
Update 2: Ended up downgrading to El Capitan.
Probably related to https://stackoverflow.com/a/39698914/1469525 with the answer being a modification to the /etc/hosts file for localhost
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With