On Dec 19, 2024, at 12:41 pm, Ben Kaufman bkaufman@bcmone.com wrote:
Unless I'm wrong (and testing shows this to be the case), http_async_client will send an http request, store the request to memory, and release the process. As long as there is no http reply, there is no blocked process. Only when a reply is received is the SIP request processing resumed.
The query is initiated by a delegate as well:
https://github.com/kamailio/kamailio/blob/master/src/modules/http_async_clie...
But you are correct that there's a libevent loop that prevents these from blocking while waiting for a response.
These questions of mechanics don't change the argument about the limited benefit of async processing, IMHO. The question is more fundamental and isn't really related to Kamailio per se. There's only so much work a system can do, and HTTP is intensive and slow. Run the queries here, run them there, there are better and worse ways to do it, but this doesn't change the broader picture.
Think of it this way: you get 2000 CPS and a modestly-resourced Kamailio system. You build your call processing architecture with http_async_client. I build mine without doing HTTP queries at all. Then, we measure units of throughput per cloud resource spend. Who do you think wins?
-- Alex