<div><div dir="auto">Maybe not the nicest solution, but you can use (from inside the routing script) the jsonrpc_exec() to get stats and grab the shmem usage, and build your logic there... if this do that...</div></div><div dir="auto"><br></div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Mar 1, 2020 at 12:54 Juha Heinanen <<a href="mailto:jh@tutpro.com">jh@tutpro.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">John Petrini writes:<br>
<br>
> The times we've seen this is when transactions are waiting on something so<br>
> they pile up consuming shared memory. Do you have any database lookups or<br>
> calls out to external services or scripts?<br>
<br>
John,<br>
<br>
Thanks for your reply.  Yes, there are MySQL operations both during<br>
request/reply processing and also accounting to db.  I would assume that<br>
any problems with those should show up in /var/log/mysql/error.log.<br>
<br>
> Long timeouts can also contribute if something stops responding because<br>
> transactions are waiting for a long timeout to expire.<br>
<br>
There is quite long "fr_inv_timer" value, that could cause problems is<br>
lots of INVITEs are ringing at the same time.<br>
<br>
> It's typically a balance between setting reasonable timeouts and allocating<br>
> enough shm. In addition we implemented some watcher scripts that monitor<br>
> shm and will set gflags to disable non-critical external calls beyond a<br>
> certain threshold as well as send us an alert.<br>
<br>
I also created an external script to watch shm memory usage.  I would<br>
have liked K to watch itself, but could not find pseudo variables<br>
corresponding to core.shmmem entries.  Do they exist?<br>
<br>
-- Juha<br>
<br>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div></div>