lpy
lpy

Reputation: 587

Couchdb 100% CPU usage

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.

Upvotes: 6

Views: 5092

Answers (1)

Kxepal
Kxepal

Reputation: 4679

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.

Upvotes: 6

Related Questions