<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.4.4">
</HEAD>
<BODY>
This is by design.&nbsp; When you have many thousands of presence subscriptions you need to service them evenly across time instead of in big lumps.<BR>
<BR>
If you don't want this behaviour then you can set the notifier_processes modparam to 0.&nbsp; But, if you do this you should consider not using subs_db_mode 3 as there are many race-hazards in presence that are fixed by using the notifier_processes.<BR>
<BR>
Regards,<BR>
<BR>
Peter<BR>
<BR>
On Fri, 2012-11-09 at 12:01 +0100, Andrew Pogrebennyk wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,
when presence module is running with subs_db_mode=3 it makes an
excessive number of SQL select queries, litelly dozens per second:
&gt;                 25232 Query        select presentity_uri,callid,to_tag,from_tag,event from active_watchers where updated=64 AND event&lt;&gt;'presence.winfo'
&gt;                 25233 Query        select presentity_uri,callid,to_tag,from_tag,event from active_watchers where updated=116 AND event&lt;&gt;'presence.winfo'
&gt;                 25233 Query        select presentity_uri,callid,to_tag,from_tag,event from active_watchers where updated=116 AND event='presence.winfo'
&gt;                 25232 Query        select presentity_uri,callid,to_tag,from_tag,event from active_watchers where updated=64 AND event='presence.winfo'
&gt;                 25231 Query        select presentity_uri,callid,to_tag,from_tag,event from active_watchers where updated=14 AND event&lt;&gt;'presence.winfo'
&gt;                 25231 Query        select presentity_uri,callid,to_tag,from_tag,event from active_watchers where updated=14 AND event='presence.winfo'
&gt;                 25233 Query        select presentity_uri,callid,to_tag,from_tag,event from active_watchers where updated=118 AND event&lt;&gt;'presence.winfo'
&gt;                 25232 Query        select presentity_uri,callid,to_tag,from_tag,event from active_watchers where updated=66 AND event&lt;&gt;'presence.winfo'
&gt;                 25233 Query        select presentity_uri,callid,to_tag,from_tag,event from active_watchers where updated=118 AND event='presence.winfo'
&gt;                 25232 Query        select presentity_uri,callid,to_tag,from_tag,event from active_watchers where updated=66 AND event='presence.winfo'
&gt;                 25231 Query        select presentity_uri,callid,to_tag,from_tag,event from active_watchers where updated=16 AND event&lt;&gt;'presence.winfo'
&gt;                 25231 Query        select presentity_uri,callid,to_tag,from_tag,event from active_watchers where updated=16 AND event='presence.winfo'

Steps to reproduce: registers two subscribers in jitsi and add them to
contact lists of each other.
The kamailio version is 3.3.2. I'm not doing anything special
configuration-wise:

loadmodule &quot;presence.so&quot;
modparam(&quot;presence&quot;, &quot;db_url&quot;, &quot;mysql://kamailio:snbF93@localhost/kamailio&quot;)
# in 3.3 the fallback2db change to subs_db_mode
modparam(&quot;presence&quot;, &quot;subs_db_mode&quot;, 3)
modparam(&quot;presence&quot;, &quot;notifier_processes&quot;, 3)


loadmodule &quot;presence_xml.so&quot;
modparam(&quot;presence_xml&quot;, &quot;db_url&quot;,
&quot;mysql://kamailio:snbF93@localhost/kamailio&quot;)
modparam(&quot;presence_xml&quot;, &quot;force_active&quot;, 0)
modparam(&quot;presence_xml&quot;, &quot;integrated_xcap_server&quot;, 1)
# retry-after 5 minutes
modparam(&quot;presence_xml&quot;, &quot;xcapauth_userdel_reason&quot;,
&quot;probation;retry-after=300&quot;)

Q: it is a bug of a feature? :)
Thanks.
Andrew

_______________________________________________
sr-dev mailing list
<A HREF="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</A>
<A HREF="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</A>
</PRE>
</BLOCKQUOTE>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd
</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>