Hi there,
I have now approximately 400,000 routes defined in my LCR table and I would like to make sure that I have enough memory allocated for it. I read somewhere (a non official Kamailio site) about PKG_MEM_POOL_SIZE and SHM_MEM_SIZE needing to be altered to handle the increased routes.
System is dedicated for the Kamailio 1.5.5 install and has 4GB of RAM. Thoughts to what I need to change these values (or anything else) to accommodate?
Thanks,
-graham
I set the shared memory to 512M via the command line at program start and do not have any problems with my 500k routes.
Thank You Stagg Shelton
For support please email support@vocalcloud.com
Sent from my mobile phone
On Mar 12, 2011, at 7:50 PM, Graham Wooden graham@g-rock.net wrote:
Hi there,
I have now approximately 400,000 routes defined in my LCR table and I would like to make sure that I have enough memory allocated for it. I read somewhere (a non official Kamailio site) about PKG_MEM_POOL_SIZE and SHM_MEM_SIZE needing to be altered to handle the increased routes.
System is dedicated for the Kamailio 1.5.5 install and has 4GB of RAM. Thoughts to what I need to change these values (or anything else) to accommodate?
Thanks,
-graham
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
2011/3/13 Graham Wooden graham@g-rock.net:
I have now approximately 400,000 routes defined in my LCR table and I would like to make sure that I have enough memory allocated for it. I read somewhere (a non official Kamailio site) about PKG_MEM_POOL_SIZE and SHM_MEM_SIZE needing to be altered to handle the increased routes.
System is dedicated for the Kamailio 1.5.5 install and has 4GB of RAM. Thoughts to what I need to change these values (or anything else) to accommodate?
Hi Graham.
PKG_MEM_POOL_SIZE means fixed private memory allocated for each kamailio process. You can edit config.h and set a higher value (i.e. 16 MB): #define PKG_MEM_POOL_SIZE 16*1024*1024
About SHM_MEM_SIZE that's shared memory for all the processes. It value can be modified with the -m paramenter when running kamailio command: kamailio -m 256
In case of LCR module with so many rules, indeed you need a high shared memory value as rules are stored in shared memory. And I also think that you need to increase private memory as well since the database load task (gws and rules) is done using private memory (hope I'm not wrong here).
Regards.
Thanks Stagg and Iñaki.
I already had the -m 512 in my init file, so it appears I am ok there. I went ahead and recompiled with PKG_MEM_POOL_SIZE to 16MB and I'll see how it goes.
Thanks again,
-graham
On 3/13/11 7:39 AM, "Iñaki Baz Castillo" ibc@aliax.net wrote:
2011/3/13 Graham Wooden graham@g-rock.net:
I have now approximately 400,000 routes defined in my LCR table and I would like to make sure that I have enough memory allocated for it. I read somewhere (a non official Kamailio site) about PKG_MEM_POOL_SIZE and SHM_MEM_SIZE needing to be altered to handle the increased routes.
System is dedicated for the Kamailio 1.5.5 install and has 4GB of RAM. Thoughts to what I need to change these values (or anything else) to accommodate?
Hi Graham.
PKG_MEM_POOL_SIZE means fixed private memory allocated for each kamailio process. You can edit config.h and set a higher value (i.e. 16 MB): #define PKG_MEM_POOL_SIZE 16*1024*1024
About SHM_MEM_SIZE that's shared memory for all the processes. It value can be modified with the -m paramenter when running kamailio command: kamailio -m 256
In case of LCR module with so many rules, indeed you need a high shared memory value as rules are stored in shared memory. And I also think that you need to increase private memory as well since the database load task (gws and rules) is done using private memory (hope I'm not wrong here).
Regards.
Graham Wooden writes:
I already had the -m 512 in my init file, so it appears I am ok there. I went ahead and recompiled with PKG_MEM_POOL_SIZE to 16MB and I'll see how it goes.
graham,
lcr module (at least the later versions) does not use any pkg memory. it keeps all gws and rules in shm memory. you can check with kamctl command how much shm memory you have left/used/etc.
-- juha
Hello,
popping in to add some clarifications/hints regarding some statements in this thread...
Loading of LCR rules from database is done through private memory, but the records are loaded in chunks. So you should be fine with 4MB of memory. If it is not enough for startup/reload time, just lower the valuu of fetch_rows parameter (usually present in other modules that load from database, as well).
http://kamailio.org/docs/modules/stable/modules/lcr.html#id2502056
Also note that private memory is sued temporary to load the rules, just to transit from database to shared memory, then no private memory is used for lcr records as Juha said.
Regarding the shared memory, looking at the source code will help to see the overhead per lcr record and then just add the size of the data loaded from memory (some such as domain names are variable size). However, there is a simple way to estimate the need of shared memory by loading for example 1000 records and then 2000 records. Using 'kamctl fifo get_statistics all' you can see the used shared memory size in the both cases, make the difference and then estimate the size per record. As I said, that is practically to approximate average size per record.
If you reload the rules at runtime, you may need 2x shared memory size for lcr rules - Juha can confirm that the module is (re-)loading rules in a separate memory structure and then swaps with the active one, and frees the old one afterwards, since I am not really using much this module.
Besides the lcr records, you need to have extra shared memory for transaction processing.
Cheers, Daniel
On 3/13/11 9:13 PM, Juha Heinanen wrote:
Graham Wooden writes:
I already had the -m 512 in my init file, so it appears I am ok there. I went ahead and recompiled with PKG_MEM_POOL_SIZE to 16MB and I'll see how it goes.
graham,
lcr module (at least the later versions) does not use any pkg memory. it keeps all gws and rules in shm memory. you can check with kamctl command how much shm memory you have left/used/etc.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Daniel-Constantin Mierla writes:
If you reload the rules at runtime, you may need 2x shared memory size for lcr rules - Juha can confirm that the module is (re-)loading rules in a separate memory structure and then swaps with the active one, and frees the old one afterwards, since I am not really using much this module.
where are two shm tables (for gws and rules) per lcr instance and then one extra of each that is used during reload.
-- juha