mapbox/tilelive.js — pull request #108 by rclark (2014-12-24 19:52:15+00:00)
Title: [discussion] Experiments in backpressure

Question: Is checking `putStream._multiwriting` an honest way to ascertain the number of currently pending write requests?

If so, I don't see any effect of `highWaterMark` on the concurrency of writes. From that perspective I'm inclined to set `highWaterMark = 1` for the tightest possible correlation between read speed and write speed.

On the other hand the lack of effect was not what I expected and I'm not sure I have an explanation for it. My gut says `highWaterMark` should be like `2 * concurrency`, so that whenever a write finishes, there's already another one waiting in `_writableState.buffer` for it to queue.

cc @yhahn