Actually, a minute delay would be a bad thing because replicated usrloc
records, using t_replicate() would not make it in to peer SER server
caches when the server is starting up.<br>
<br>
Given this fact, and given the fact that most SER modules do not hash
data upon server startup [like group.so, etc, etc] we are starting to
see little value in caching usrloc. Our MySQL server is hit 12 times
for an INVITE message and so complete caching of usrloc is of minimal
performace gain.<br>
<br>
Anyhow, we're not in process of modifying SER so that:<br>
<br>
* when ser starts up usrloc is &quot;lazy-loaded&quot;<br>
* if a usrloc record is looked up in cache and is __NOT__ found, then
MySQL will be queried. If found in MySQL then the usrloc record will be
put in to cache for future lookups<br>
<br>
By doing these two things we should not have a problem we excessively large subscriber bases.<br>
<br>
Thoughts?<br>
Paul<br><br><div><span class="gmail_quote">On 5/29/05, <b class="gmail_sendername">Greger V. Teigre</b> &lt;<a href="mailto:greger@teigre.com">greger@teigre.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Interesting discussion.&nbsp;&nbsp;I believe most large-scale deployments (there<br>aren't really that many...) divide the user base across several servers. I<br>believe they use 20K users is a &quot;good number&quot; per server.&nbsp;&nbsp;So, one ser
<br>having to load that many records, is only if you have a cluster with no<br>server divide.&nbsp;&nbsp;Loading all the contacts into memory is impossible to scale,<br>at one point it will take too long time and take too much memory.&nbsp;&nbsp;So, a
<br>better architecture *for such a deployment scenario* would be a cache of<br>some size and then a lookup of records in DB if not present in cache.<br>Loading 330 records per second, you can load about 20,000 contacts in a
<br>minute, which probably is ok.<br>g-)<br><br>Zeus Ng wrote:<br>&gt; See inline comment.<br>&gt;<br>&gt;&gt; Thanks for the info. I did change that config.h define and<br>&gt;&gt; now it works well.<br>&gt;<br>&gt; Great to hear that the little change solve your problem.
<br>&gt;<br>&gt;&gt;<br>&gt;&gt; My newest problem is the ser start time. In my very<br>&gt;&gt; non-scientific test it took ser about 25 minutes before it<br>&gt;&gt; began serving requests because it was loading usrloc information.
<br>&gt;&gt;<br>&gt;&gt; That was using 500000 records in the location table. The<br>&gt;&gt; MySQL server was running on the same box as SER, which is<br>&gt;&gt; also my workstation, so stuff like Firefox, X, etc, were in use.
<br>&gt;&gt;<br>&gt;&gt; But this does bring up an interesting problem namely - how<br>&gt;&gt; can ser service SIP clients while loading large number of<br>&gt;&gt; usrloc records? I'm kind of thinking that this could be a big
<br>&gt;<br>&gt; No, you can't. In fact, you will experience a temporary slow down<br>&gt; when a hugh number of UA is un-registering because the table was<br>&gt; locked during that period of time. I once use sipsak to register 5000
<br>&gt; users in 15s. When they all expired about the same time, SER hang for<br>&gt; a while for locking the table to release the record from memory.<br>&gt;<br>&gt;<br>&gt;&gt; problem. When dealing with massive user bases there is no
<br>&gt;&gt; such thing as a &quot;quick restart&quot;.<br>&gt;<br>&gt; Well, that's the trade-off of memory base db. You need to balance the<br>&gt; startup time verse runtime performance.<br>&gt;<br>&gt;&gt;<br>&gt;&gt; We do have LVS fully &quot;sip-aware&quot; so we are doing true UDP
<br>&gt;&gt; load balancing based on the Call-ID header, but this is still<br>&gt;&gt; a problem [potentially] with replication ucontact records<br>&gt;&gt; while the server is starting up.<br>&gt;&gt;<br>&gt;&gt; I wonder if it is possible to modify the behaviour of usrloc
<br>&gt;&gt; so that it loads in the background while ser is processing<br>&gt;&gt; SIP messages. And when lookup(&quot;location&quot;) is executed, usrloc<br>&gt;&gt; searching the the ser cache and then MySQL if no hit is found
<br>&gt;&gt; in cache -- or something like that.<br>&gt;<br>&gt; This triggers me to bring up the common question asked on this list<br>&gt; before. Can SER use just MySQL for usrloc? A similar concept has been<br>&gt; done on the speeddial module. It would help load distribution, faster
<br>&gt; startup time and better redundancy. Of course, slower lookup as<br>&gt; tradeoff.<br>&gt;<br>&gt; I once consider replacing the build-in memory base DB with MySQL<br>&gt; memory db. However, that idea was dropped due to time constrain and
<br>&gt; compatability (postgresql) issue.<br>&gt;<br>&gt;&gt;<br>&gt;&gt; Can anyone on serusers give some tips as to how to get ser to<br>&gt;&gt; load usrloc entries optimized? I know the usual stuff like<br>&gt;&gt; faster MySQL disks, faster network connection, dedicated app
<br>&gt;&gt; servers, etc, etc. But I'm looking for ser and/or MySQL<br>&gt;&gt; tweaking hacks.<br>&gt;<br>&gt; Good luck on your search.<br>&gt;<br>&gt;<br>&gt;&gt;<br>&gt;&gt; Regards,<br>&gt;&gt; Paul<br>&gt;&gt;<br>&gt;&gt;
<br>&gt;<br>&gt; _______________________________________________<br>&gt; Serusers mailing list<br>&gt; <a href="mailto:serusers@lists.iptel.org">Serusers@iptel.org</a><br>&gt; <a href="http://lists.iptel.org/mailman/listinfo/serusers">
http://lists.iptel.org/mailman/listinfo/serusers</a><br><br></blockquote></div><br>