u/Far_Childhood_7829

mongodb-atlas-local in GitHub Actions CI: mongot indexing takes 6-15s per spec even on empty collections — any tricks to speed it up?

Hey everyone,

We're running integration tests against mongodb/mongodb-atlas-local:8.0.4 in GitHub Actions and hitting a painful flakiness/performance problem caused by Atlas Search indexing latency. Looking for anyone who's solved this.

Setup

- Rails + Mongoid test suite, ~500+ specs that use $search

- 9 parallel job matrix on ubuntu-latest, each spins up its own mongodb-atlas-local service container

- Ruby polling helper that queries the Atlas Search index every 0.2s until the record appears (up to 15s timeout)

Problem

After inserting a document, it takes anywhere from 2 to 12+ seconds before it's visible via $search, even on an empty test database with a handful of documents. On local dev (Mac M1/M2) it's consistently under 1 second.

We understand why this happens:

- mongot (the Atlas Search indexer inside the image) is a JVM/Lucene process that starts cold on every CI job

- JVM startup + JIT warmup takes a few seconds before mongot can even process the first oplog entry

- Then the Lucene flush cycle writes segments to virtualized disk, which is 3-5x slower than NVMe

- With 9 parallel jobs on potentially the same physical host, disk I/O contention makes it worse

The result: many of our Atlas Search specs sit waiting for up to 15 seconds. It's making CI significantly slower and more expensive.

What we've already tried / ruled out

- ✅ Polling instead of fixed sleep — fixed flakiness but not the latency itself

- ✅ Waiting for the correct "last inserted" record (not an arbitrary count)

- ❌ Tuning mongot sync/flush interval — couldn't find any exposed config for this in mongodb-atlas-local

- ❌ Sharing one MongoDB container across partitions — breaks test isolation

Happy to share our polling helper implementation if useful for anyone hitting the same issue.

Any advice from teams running Atlas Search in CI at scale would be really appreciated.

reddit.com
u/Far_Childhood_7829 — 4 days ago