Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Couchdb 100% CPU usage

Tags:

couchdb

I used Couchdb to create a private NPM mirror, but I found that beam.smp kept my CPU usage to 100%, is there any way to make it lower, like 50%?

Thank you very much.

like image 872
lpy Avatar asked Sep 06 '13 10:09

lpy


1 Answers

You cannot directly limit CPU/memory usage for CouchDB, but you may tweak Replicator options to reduce their usage. Options you're interested:

  • http_connections Defines maximum number of HTTP connections per replication. Keeping them lower reduces transfer bandwidth.

    [replicator]
    http_connections = 20
    
  • worker_batch_size With lower batch sizes checkpoints are done more frequently. Lower batch sizes also reduce the total amount of used RAM memory.

    [replicator]
    worker_batch_size = 500
    
  • worker_processes
    Amount of replication workers. Keeping them lower reduces amount of data replication handled => reduces CPU usage because of less data to process.

    [replicator]
    worker_processes = 4
    

Play with these options to find right combination to fit your limits.

like image 91
Kxepal Avatar answered Oct 02 '22 18:10

Kxepal