Maybe we could just log when one of the semaphores is exhausted, but there's another request waiting, e.g. something like this in place of the plain MSem.with sem action calls that are currently used:
waitAndLogExhausted name sem action = do
open <- MSem.peekAvail sem
when (open < 1) $
hPutStrLn stderr $ name ++ " has exhausted its available resources, but there is further demand."
MSem.with sem action
with waitAndLogExhausted "Compiles" (compileSem ctx) someIO
Then we can see how often requests have to queue up because of the current limit and can try increasing the values.
Originally posted by @patritzenfeld in #65 (comment)
Maybe we could just log when one of the semaphores is exhausted, but there's another request waiting, e.g. something like this in place of the plain
MSem.with sem actioncalls that are currently used:with
waitAndLogExhausted "Compiles" (compileSem ctx) someIOThen we can see how often requests have to queue up because of the current limit and can try increasing the values.
Originally posted by @patritzenfeld in #65 (comment)