You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/09/17 23:23:14 UTC

[GitHub] [couchdb] chewbranca commented on issue #3160: Work around statistics(run_queue) returning incorrect data

chewbranca commented on issue #3160:
URL: https://github.com/apache/couchdb/issues/3160#issuecomment-694551709


   I've got a proof of concept implementation separating out the scheduler and dirty scheduler run_queues in [1].
   
   That PR uses the relatively new statistic call `statistics(run_queue_lengths)` which was introduced in OTP-18.3. This statistic returns a list of length N + 1 where N is the number of regular schedulers, and +1 is the currently fixed value of the number of dirty CPU schedulers in Erlang. You can see in the PR [1] that I'm using that data to also construct a new stat entry for the dirty CPU queue. We could use the even newer `statistics(run_queue_lengths_all)` statistic which returns a list of N + 2 for the N schedulers and the 2 dirty scheduler queues, however, Erlang does not yet use dirty IO NIFs for file IO, so that value will always be zero, and that function was introduced in OTP-20, and we still kinda sorta maybe tolerate OTP-19. I'm not opposed to requiring OTP-20, but there's not a big rush on this front as we don't use dirty IO schedulers yet.
   
   Btw, the PR is against 3.x, we'll want to have a separate PR for 4.x, which is why I'm adding the details here in the issue.
   
   [1] https://github.com/apache/couchdb/pull/3161
   [2] https://erlang.org/doc/man/erlang.html#statistics_run_queue_lengths
   [3] https://erlang.org/doc/man/erlang.html#statistics_run_queue_lengths_all


----------------------------------------------------------------
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.

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