Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Data + MongoDB somehow extremely slow after upgrade to macOS Sierra

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.

like image 749
Håvard Geithus Avatar asked Sep 22 '16 10:09

Håvard Geithus


1 Answers

Probably related to https://stackoverflow.com/a/39698914/1469525 with the answer being a modification to the /etc/hosts file for localhost

like image 101
Jeff Sheets Avatar answered Oct 09 '22 05:10

Jeff Sheets