Hello,

the db_timer_clean is actually needed only you face situations when some contact records remain in the database after they expired. Normally should be deleted by the process detecting that they are deleted, however, there are some corner cases when the operation to database failed when the record in memory is removed (e.g., you restart mysql server). Over long time, if Kamailio is not restarted, but the "corner" cases keep happening, many invalid records can accumulate to database.

The "secondary" timer is from core and was added to execute the tasks that are not "real-time" critical and can take longer time to execute, to offload the primary timer system (composed by fast+slow timer processes), which is more sensitive as it takes care of retransmissions, etc ...

Many modules started to create own timer processes to offload primary timer, and that can still be useful when dealing with some heavy tasks, but for some modules, creating a dedicated timer process just to execute a lengthy task from time to time is a waste of resource, so they can use the secondary timer.

The timer_procs is not related to db_timer_clean. Set timer_procs>=1 when having to manage a lot of active contacts, no matter is just in-memory storage or together with database. For write back (sycn the db peridiocally) it would be probably better to have at least timer_proc=1, so the db sync operations are done by this timer, provided you have more than a few active contacts.

Cheers,
Daniel

On 20.02.20 01:11, Joel Serrano wrote:
Hello,

I have an installation using usrloc + db_mode=1.

If I want on db_mode=1 or db_mode=2 the expired contacts to be cleaned up I have to enable the modparam db_timer_clean:

https://www.kamailio.org/docs/modules/devel/modules/usrloc.html#usrloc.p.db_timer_clean

The docs say:

"Enable (1) or disable (0) cleaning of expired db records on timer basis for db_mode WRITE-BACK and WRITE-THROUGH. It uses the secondary timer process."

I have the following doubts:

1- What does the reference "it uses the secondary timer process" mean? Is there a specific secondary timer just for this purpose?
2- Is  #1 related to the modparam timer_procs? (so it uses one of those when enabled?)
3- Why/When would you need a timer_proces modparam with a value higher than "1"? 


Thanks, 
Joel.



_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - March 9-11, 2020, Berlin - www.asipto.com
Kamailio World Conference - April 27-29, 2020, in Berlin -- www.kamailioworld.com