<p>I think this moment not well documented.</p>

<p>And also something wrong there.<br>
If I have timer_interval 60 with hash_size 5 then for registration with expires=120 we have<br>
rec-&gt;registration_timeout = now + 120 - 60 = now + 60<br>
So, we will update every 60 seconds. It's not good.</p>

<p>Maybe this logic will be better?<br>
rec-&gt;registration_timeout = now + 120 - 120*0.8 (80% of expires)</p>

<p>rec-&gt;registration_timeout = now + rec-&gt;expires - rec-&gt;expires*0.8;<br>
instead of<br>
rec-&gt;registration_timeout = now + rec-&gt;expires - timer_interval;</p>

<p>When you have many registrants and database with many different intervals, you will have many inaccuracies with re-register intervals.</p>

<p>Or we should better document this moment. For example, we should recommend using as small timer_interval as user can.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href='https://github.com/OpenSIPS/opensips/issues/217#issuecomment-43670320'>view it on GitHub</a>.<img src='https://github.com/notifications/beacon/5479561__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxNjIzMjQ4MiwiZGF0YSI6eyJpZCI6MzEwMzY1MDd9fQ==--1f74cda53a4e19f85f745772f155e2ca841b79ff.gif' height='1' width='1'></p>