[asterisk-dev] Re: Realtime and call states in SIP

Benny Amorsen benny+usenet at amorsen.dk
Wed May 30 03:25:42 MST 2007


>>>>> "OEJ" == Olle E Johansson <oej at edvina.net> writes:

OEJ> Realtime buddies in SIP was designed in a way to reduce amount of
OEJ> memory used and also to add some sense of "realtime", being able
OEJ> to add peers in the database at any given time and have them
OEJ> activated immediately.

I don't see the point of limiting the number of peers in the cache. I
bet very few people are using realtime in order to save memory --
for the price of one phone you can buy memory enough to cache
thousands.

Asterisk needs a way to have dynamic peers while still keeping the
same functionality that static peers get -- the current system with
"caching" is almost there, just badly misnamed.

OEJ> If we implement this, we can implement *real* caching for the
OEJ> realtime buddies, where the system is in control and release when
OEJ> it needs to re-use the memory. With that, we can say "keep up to
OEJ> a maximum of 500 peers in the cache. Manage it yourself, thank
OEJ> you." I have something similar implemented for ASTUM users
OEJ> already. Everytime an object in the cache is used, it's moved to
OEJ> the top. When the cache it full, the one's at the bottom is
OEJ> released from memory. With a time limit, expiration time, of
OEJ> course.

The moment you have 501 phones registering with the same interval and
a cache size of 500, you have a 100% miss rate. Don't size the cache
based on what the system administrator says, he will get it wrong.
Just grow it as needed, and only drop peers which you haven't heard
from or used for a long time.


/Benny





More information about the asterisk-dev mailing list