Check for stale nonce in pre_auth, before actual auth request. It decreases
dramatically the number of requests to the actual auth backend thus improving
performance greatly. Take a look at the following plot where the results of
this patch can be seen clearly:
The similar approach was implemented already in Kamailio.