Files
wekan/docs/Databases/MongoDB
Lauri Ojansivu b87858baaf Problems / Database: report queries without an index and a high read rate.
The database health probe (server/lib/databaseHealth.js) saw restarts, slow
storage and a full disk, but not what made one instance slow: a 10 GB
collection scanned three times per search, and an hourly job reading all
1.1 million cards (#6824, #6825). Both were visible only in MongoDB's own
log, as "Slow query" lines with COLLSCAN, and in serverStatus: 1.6 billion
documents read in two hours.

Two more checks, every 5 minutes with the others:

- db.collection-scan: the "Slow query" lines MongoDB keeps (getLog
  'global'), newer than the last probe, where a query read a whole
  collection of at least 10,000 documents. Grouped by collection and the
  field names filtered on - never values - with count, documents read and
  time. Small tables read whole by design (settings, roles) and internal
  namespaces are left out. Needs the getLog privilege; without it, and on
  FerretDB, the check finds nothing and is skipped.
- db.scan-rate: serverStatus.metrics.queryExecutor.scannedObjects between
  two probes above 50,000 documents per second. A database restart, which
  resets the counter, is not counted.

Both are rows in Admin Panel / Problems / Database with what to do;
docs/Databases/MongoDB/Storage-Requirements.md lists them.

tests/databaseHealthScans.test.cjs drives the log parsing and the rate,
including that a filter's values never reach the row. From the reporter's
patch.

Thanks to Raymond-Voogt and xet7 !

Fixes #6826.
2026-10-27 21:19:51 +02:00
..

MongoDB

WeKan's classic database. WeKan runs on MongoDB 3.0 … 8.0, and picks the Node driver for the server it finds; docker-compose-mongodb-v7.yml is the compose file for it. The default database of WeKan is FerretDB v1 instead, which needs no database server.

File What it answers
Driver-System.md Which Node driver is used for which server version, and how that is decided
Version-Management.md Detecting the server version and switching to the matching binary + driver
Compatibility-Guide.md What breaks between MongoDB 3.0 and 8.0 with Meteor, and the fixes
Storage-Requirements.md Why the data directory must be on a local filesystem, and what an SMB/NFS-backed one does (fsync ENOSPC aborts, slow queries)
Oplog-Configuration.md Why the OpLog matters for pub/sub, and how to turn it on
OpLog-Enablement.md Whether it IS on, per deployment platform
avx-qemu.md Running MongoDB 5+ on a CPU with no AVX, through qemu-user
raspi4-qemu.md The same on a Raspberry Pi 4 and older (ARMv8.0, no ARMv8.2-A)

Both qemu pages describe what WeKan's cpu-exec helper now does by itself: it runs a binary under qemu-user when the CPU lacks the features that binary needs.

See also