Thursday, June 25, 2015

Kamailio - TLSF – High Performance Memory Manager

Kamailio v4.3.0, Camille Oudout from Orange/Libon, France, pushed a new memory manager (named tlsf) focused on high performances on handling memory operations.
It is well known that Kamailio (from its very beginning as SER project back in 2001) has its own memory manager. That simplifies especially the handling of shared memory on different oeprating systems. There were two available, that can be enabled at compile time, so  called:
  • f_malloc (aka fast malloc) – the one mostly used as default for stable releases
  • q_malloc (aka quick malloc) – the one more suitable for memory operations troubleshooting
While these two memory managers were designed to be fast for multi-process applications such as Kamailio (e.g., avoid thread locking for private memory) as well as dealing with the patterns of routing SIP traffic, few special cases could result in slowing down — one of this is when needing to free a lot of allocated chucks of same size.
Worth to mention that system memory manager could be (and can still be) enabled to be used for private memory needs. Some other attempts to add new memory managers were not yet completed, therefore not being ready for use (e.g., the Doug Lea allocator or Lock Less allocator — you can check the source code tree, inside mem/ folder, for more details).
Camille implemented the Two Level Segregated Fit (TLSF) memory allocator, know to be O(1) for both malloc() and free() operations (no worse case behavior). It has a 4 byte block overhead, but hardware memory it cheap these days. You can read more about it at:
It is not enabled by default, being rather young code now, but it is a good candidate to become in the near future. To enable it, you have to install Kamailio from sources and compile using:
make MEMDBG=1 MEMMNG=2 cfg
make all
make install
It will enable the debugging mechanism as well, that can be disabled by using MEMDBG=0.
If you start using it, do provide us feedback about how it performs, because it helps to assert its relevance and stability. Also, do not hesitate to start a discussion if you have questions or suggestions via the sr-dev mailing list.
Have a great summer!

Tuesday, June 23, 2015

Kamailio Server Maintenance – Wed-Thu Night

During the night between Wed (June 24, 2015) and Thu (June 25, 2015), planned to start not early than 00:00 GMT+1, there will be some schedule maintenance work to the infrastructure that is hosting some of the servers.
The main affected services will be:
  • main website (
  • wiki portals
  • mailing lists (
  • git mirror (
It is expected to have short downtimes of few minutes.

Wednesday, June 10, 2015

Kamailio v4.3.0 Released

June 10, 2015Kamailio v4.3.0 is out –  a new major release, collecting new features and improvements added during about six months of development and one and a half month of testing.
In short, this major release brings 9 new modules and enhancements to more than 50 existing modules, plus components of the core and internal libraries. Detailed release notes are available at:
Development for next major release, 4.4.0 (expected to be out in the first part of 2016) has started already, even a new module is already present in master branch: smsops. Watch the project’s web site closely for further updates and news about evolution of Kamailio.
Enjoy SIP routing in a secure, flexible and easier way with Kamailio v4.3.0!
Thank you for flying Kamailio!

Thursday, June 4, 2015

Kamcli – command line control tool

Recently a new command line tool for Kamailio management was published by Asipto, named kamcli, available at:
It is written in Python and at this stage it is more an attempt to see if the community finds it useful and worth to get it developed further as part of Kamailio project.
  • Short about the benefits/flexibility:
  • python is by default installed on OSes (including Mac OS X) (as opposite to Lua, for example)
  • became rather fast since Google invested in it
  • lot more knowledge base and developers out there (as opposite to Lua or Perl), along with tons of extensions
  • implementation is based on a CLI framework (Click) that makes it extremely easy to add new commands in a plugin-like fashion, therefore is easy to have custom commands when having specific needs (e.g., managing a custom database table used in kamailio.cfg via sqlops => add a new in commands subfolder, without touching other files, not even the config)
  • help message is embedded in the command code file, making it easier to document commands
  • easy to validate parameters as well as format the output
  • handling kamcli configuration file options is also easy (ini format)
One of the reasons of pushing this out was in the perspective of deprecating MI and working with JSONRPC fifo from command line — there is not an easy ways to manage json docs with shell and common tools (e.g., cat, echo, grep, awk) only. Kamcli has implemented the JSONRPC over fifo command (see also jsonrpc-s kamailio module). Still, given the old initial implementation, at this moment, kamcli is relying on MI via fifo (mi_fifo) for some of the commands (e.g., dumping usrloc records from memory).
So far, couple of commands were implemented when comparing with kamctl:
  • subscriber management (kamctl add/rm/passwd…)
  • user location management (kamctl ul …)
  • database querying (kamctl db …)
  • statistics (kamctl stats …)
  • mi commands (kamctl mi …)
  • jsonrpc commands (not in kamctl)
If there is enough interest in developing this tool further, it can be migrated to Kamailio organization on Github to have all developers able to work on it.
For further discussions about this tool, email to development mailing list .

Tuesday, June 2, 2015

Releasing Kamailio v4.3.0

Next major version of Kamailio (v4.3.0) is planned to be out on Wednesday (June 10) or Thursday (June 11). The pool of things to fix is minor, deb packaging for 4.3 is ready, thanks to Victor Seva. Some bits are still left to do: add docs for 4.3 series in wiki, prepare RPM packaging and build
proper ‘what is new’ list of features.
Testing didn’t reveal new issues in the recent past as we run in two servers with live traffic. If you have issues with 4.3 branch, be sure you report them on Github tracker:
Meanwhile, contributions to enhance the related pages on the wiki are very appreciated:
Stay tuned for updates!