Hello,
I am opening this discussion to decide if there is need to adjust some
of the default values we have in Kamailio. Many of them were set even
like 10 years ago, so they might not be very actual anymore.
The main goal is to get the best possible settings for common usage.
To start with, here are some values that should be reviewed:
- default private memory is 4MB - if the config is not that small, it
might not be sufficient free pkg to play with (e.g., for sql_query()
result, storage of $var(...) values). Should it be increased to 8MB or
other value? Debian/Centos have startup script that sets its value to 8
via command line
- default shared memory is 32MB - for a decent deployment with tm,
location, lcr/dispatcher, permissions, and anti-flood, it might leave
not much free space. Should we double it or set to a different value
- usrloc - db_ops_ruid should enabled (1) - seems stable, without it
there are problems updating/deleting location records when UA changes
the call-id for same contact address.
- usrloc - hash_size - now is 9, which results in 512 slots, meaning is
ok for few thousands of registered users, for more, performance will
decrease when doing save/lookup location -- should it be made 10 (1024
slots for internal hash table)?
- auth_db - load_credentials defaults to 'rpid', meaning that the query
to get the password will retrieve also the rpid column. I haven't see
rpid being used that much lately (replaced by PAI/PPI). I would make
this parameter empty by default to avoid querying for an extra column
that is likely to be empty.
Perhaps there are more, I just wanted to get started. Reply with your
comments to above list as well as add new items you thinks their default
values should be adjusted.
Cheers,
Daniel
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Module: sip-router
Branch: master
Commit: 1f1b81ed76dda3a889ffec52c173c53b2225dee4
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1f1b81e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Oct 2 09:51:46 2014 +0200
usrloc: hash_size default value set to 10
- as discussed on mailing lists
---
modules/usrloc/README | 6 +++---
modules/usrloc/doc/usrloc_admin.xml | 6 +++---
modules/usrloc/ul_mod.c | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/modules/usrloc/README b/modules/usrloc/README
index 688b2d9..f480ad9 100644
--- a/modules/usrloc/README
+++ b/modules/usrloc/README
@@ -689,14 +689,14 @@ modparam("usrloc", "fetch_rows", 3000)
3.26. hash_size (integer)
The number of entries of the hash table used by usrloc to store the
- location records is 2^hash_size. For hash_size=4, the number of entries
+ location records is 2^hash_size. For hash_size=4, the number of slots
of the hash table is 16.
- Default value is "9".
+ Default value is "10" (1024 slots).
Example 1.26. Set hash_size parameter
...
-modparam("usrloc", "hash_size", 10)
+modparam("usrloc", "hash_size", 12)
...
3.27. preload (string)
diff --git a/modules/usrloc/doc/usrloc_admin.xml b/modules/usrloc/doc/usrloc_admin.xml
index a256e7a..0f99681 100644
--- a/modules/usrloc/doc/usrloc_admin.xml
+++ b/modules/usrloc/doc/usrloc_admin.xml
@@ -722,19 +722,19 @@ modparam("usrloc", "fetch_rows", 3000)
<title><varname>hash_size</varname> (integer)</title>
<para>
The number of entries of the hash table used by usrloc to store the
- location records is 2^hash_size. For hash_size=4, the number of entries
+ location records is 2^hash_size. For hash_size=4, the number of slots
of the hash table is 16.
</para>
<para>
<emphasis>
- Default value is <quote>9</quote>.
+ Default value is <quote>10</quote> (1024 slots).
</emphasis>
</para>
<example>
<title>Set <varname>hash_size</varname> parameter</title>
<programlisting format="linespecific">
...
-modparam("usrloc", "hash_size", 10)
+modparam("usrloc", "hash_size", 12)
...
</programlisting>
</example>
diff --git a/modules/usrloc/ul_mod.c b/modules/usrloc/ul_mod.c
index d3a1021..5992258 100644
--- a/modules/usrloc/ul_mod.c
+++ b/modules/usrloc/ul_mod.c
@@ -166,7 +166,7 @@ int desc_time_order = 0; /*!< By default do not enable timestamp ordering */
int handle_lost_tcp = 0; /*!< By default do not remove contacts before expiration time */
int ul_fetch_rows = 2000; /*!< number of rows to fetch from result */
-int ul_hash_size = 9;
+int ul_hash_size = 10;
int ul_db_insert_null = 0;
/* flags */