Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CouchDB not starting with default parameters #660

Open
guanana opened this issue May 31, 2023 · 1 comment
Open

CouchDB not starting with default parameters #660

guanana opened this issue May 31, 2023 · 1 comment

Comments

@guanana
Copy link

guanana commented May 31, 2023


BUG REPORT

Description

swarmpit does not start. It seems to be a problem with couchdb container

Steps to reproduce the issue:

  1. Try to install it
  2. Couch DB gets stuck in 137 exit error
  3. Increase mem limits on CouchDB and then the app cannot connect

What happens:

The app never starts since couch db is NOT available

What should happen:

CouchDB should start properly so the app can connect and start using the DB

Additional information (e.g. docker version, cluster setup,...):

I solved the problem by adding manually the following on the deployment file:

  db_couch:
    image: couchdb:2.3.1 <-- I as well updated to latest bug fix version from 2.3.0 to 2.3.1 just in case that made a difference but not
    volumes:
      - db-data:/opt/couchdb/data
    networks:
      - net

Section separated for clarity on what was added:

    ulimits:
      nofile:
        soft: 1000
        hard: 2000
    deploy:
      resources:
        limits:
          cpus: '0.90' <-- Increased cpu to see if that made a difference... it didn't
          memory: 2048M <-- Increased mem

Before that the DB was just hanging and the app unable to connect saying Connection refused.

Waiting for more than 10% CPU topping up and nothing happened.

Change the ulimits for the couchdb container and I get a healthy connection almost immediately.

@heatzync
Copy link

heatzync commented Jul 7, 2023

I also experienced this and @guanana's solution above is the simplest solution.

I'm adding my symptoms here for anybody else that might encounter the same...

Symptoms

  • The swarmpit_db service kept restarting after a couple of seconds (closer to every minute)
  • The swarmpit_app service was complaining that it couldn't reach http://db:5984
  • The swarmpit_db CPU usage was 100%
  • There were no logs for swarmpit_db except for the warning about "Admin Party" being printed each time a new swarmpit_db container was started

Bad solution

I suspected the CouchDB container wasn't getting enough resources, so I commented out the deploy.resources section in the swarmpit/docker-compose.yml file to see how much it needs:

#    deploy:
#      resources:
#        limits:
#          cpus: '0.30'
#          memory: 256M
#        reservations:
#          cpus: '0.15'
#          memory: 128M

The memory usage climbed to ±1.5GB and the CPU was still 100%, but the swarmpit_db service wasn't restarting any more, so I left it running for a while. It eventually started successfully after ±25 minutes and the CPU went down to less than 10%. I thought that was the solution, but I wasn't satisfied.

I also tried bumping the CouchDB version to 2.3.1, but the same symptoms persisted - it only starts after using ±1.5GB memory and 100% CPU for many minutes.

I kept searching the webs and found this reported issue with @guanana's solution! 🕺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants