You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "sergey-safarov (via GitHub)" <gi...@apache.org> on 2025/09/06 08:17:14 UTC

[I] profiling with small overhead [couchdb]

sergey-safarov opened a new issue, #5640:
URL: https://github.com/apache/couchdb/issues/5640

   ## Summary
   Time to time, we catch CPU high load like
   
   <img width="1320" height="932" alt="Image" src="https://github.com/user-attachments/assets/1d4b9ae4-a20c-4793-8a0b-b362a3a3ccc7" />
   During this time, CouchDB returns an error response.
   To resolve this, we are restarting all CouchDB nodes in the cluster.
   To troubleshoot this issue, it will be fine to get CouchDB profiling with the busiest functions at this time.
   Like it was done for RabbitMQ.
   https://www.rabbitmq.com/blog/2022/05/31/flame-graphs
   
   Could you implement a similar feature for CouchDB?
   
   ## Desired Behaviour
   
   Attach the performance profiling tool to the running CouchDB process and record function performance metrics.
   Then use these metrics to draw a graph with most busiest functions.
   
   ## Possible Solution
   Probably it can be done like in RabbitMQ
   https://www.rabbitmq.com/blog/2022/05/31/flame-graphs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] profiling with small overhead [couchdb]

Posted by "nickva (via GitHub)" <gi...@apache.org>.
nickva commented on issue #5640:
URL: https://github.com/apache/couchdb/issues/5640#issuecomment-3332277535

   That could work but it may be simpler to start with some synthetic benchmarks, for example I found a few k6 scripts floating around:
   
   https://gist.github.com/nickva/d5312248635534315e76d25b31a86faa : a simple get,put,post for individual docs script. Not as configurable
   
   https://gist.github.com/nickva/cd6679595146c3cb83fe4368cda89c3f : a more complete one with configurable test types (via env variables or command lines). This one also tries to make requests come at constant rate.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] profiling with small overhead [couchdb]

Posted by "nickva (via GitHub)" <gi...@apache.org>.
nickva commented on issue #5640:
URL: https://github.com/apache/couchdb/issues/5640#issuecomment-3324591627

   That would neat to have @sergey-safarov, thanks for the link to https://www.rabbitmq.com/blog/2022/05/31/flame-graphs
   
   Our Erlang version is high enough and we can set `+JPperf true` and limit scheduler threads (`+S 4`) in vm.args easily.
   
   We used this a few times to various bottlenecks in the past. I also have various snippet to use eprof and fprof but Linux perf-stack is so much nicer of course.
   
   One missing part is generating load. There is an internal `fabric_bench` but it's a very simply, sequential cluster benchmark, just to "kick the tires" as they say.  I have a few k6 scripts I use sometimes for a concurrent load but those may need some cleanup and k6 may not be everyone's favorite.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] profiling with small overhead [couchdb]

Posted by "sergey-safarov (via GitHub)" <gi...@apache.org>.
sergey-safarov commented on issue #5640:
URL: https://github.com/apache/couchdb/issues/5640#issuecomment-3327177458

   We can provide anonymized database dumps of different sizes (1 million, 16 million, 64 million documents) and a script to upload this dump to CouchDB.
   This can be used as a load generation tool.
   This will trigger an index rebuild and view compactions during docs upload.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org