apache / apache/couchdb

Slow couchdb after many queries

Open
#5,044 40 comments 0 reactions 0 assignees View on GitHub
bug needs-triage
Dominant language
Erlang
Stars
7k
Forks
1.1k
Avg merge
1d 16h
Merged PRs (30d)
9

Description

## Description
CouchDB gets tremendously slow after many queries are made. The situation gets better after some pause in the process. But as soon as the queries resume the system gets slow really really fast.

## Steps to Reproduce
1. Make loads of queries
2. See the time go up really fast

note: we are using couchdb as part of our Hyperledger Fabric Cluster. The queries are then made through blockchain requests.

## Expected Behaviour
We expect that the same query takes roughly the same amount of time, regardless of the number of queries in the previous amount of time (let's say the previous 5 minutes)

## Your Environment

* CouchDB version used: 3.3.3
* Browser name and version: N/A
* Operating system and version: Ubuntu 22.04.4 LTS

## Additional Context

We're using Hyperledger Fabric. After the service of couchdb is restarted with `/etc/init.d/couchdb restart` the situation goes back to normal, but it only takes a couple of minutes (which is something like 5 x 5 x 60 = 1500 queries) and the situation starts degrade real quick.

Contributor guide

Open the contributing guide

Research direction

The report names CouchDB 3.3.3 on Ubuntu 22.04.4 and observes recovery after `/etc/init.d/couchdb restart`, but no source file or test. Start by reproducing the slowdown with sustained queries and compare behavior before and after restart; done means identifying a reproducible cause and verifying that query time remains stable without periodic service restarts.

Written by the indexing model from the issue text.

Assessment

Tech stack
ubuntu
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.