We have a highly concurrent system with thousands of transactions per second running on postgresql 16.
Each transaction is calling set_config to set some context on the session - so that's thousands of calls per second.
from observation - it seems that the duration of the call is proportional to the value size, which makes sense.
For the most part, calls to set_config are blazing fast - below 1ms.
On some occasions however, intermittently and without a specific pattern, we have observed slow invocations with roughly the same value size taking >200ms. While intermittently, it happens pretty consistently.
I cannot reproduce it locally and am wondering if there's a parameter or something else that might help with that. Any direction is welcome.
Thanks.