Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to query database "no private memory left". Kamailio daemon automatic shutdown. #156

Closed
debojitkakoti opened this issue May 12, 2015 · 8 comments

Comments

@debojitkakoti
Copy link

I am using kamailio mysql module to read my route information and route the calls according to it but from few days kamailio process is shutdown automatically. When I have checked the log file I got following Error messages.

ERROR: db_mysql [km_res.c:81]: db_mysql_get_columns(): no private memory left
ERROR: [db_row.c:116]: db_allocate_row(): no private memory left

@miconda
Copy link
Member

miconda commented May 12, 2015

What is the version of your kamailio?

How many rows are loaded at same time? Is it big size over all?

@debojitkakoti
Copy link
Author

Hi miconda thanks.
It is kamailio 4.2 version
At the same time it load 1 row from one table and from another table among 9-10 rows one row is selected.
I am using Ubuntu 12.04.5 LTS with 4 GB memory , average only 1 GB is used

@miconda
Copy link
Member

miconda commented May 12, 2015

Minor version number is important, provide the output of the command 'kamailio -v'.

Kamailio is not using all the system memory, you have to specify the maximum size to use via -m for shared memory (used by all kamailio processes, allocated per kamailio instance) or -M for private memory (used by one process and allocated for each process).

@debojitkakoti
Copy link
Author

Output of 'kamailio -v'
version: kamailio 4.2.0 (x86_64/linux) 6d89d2
flags: STATS: Off, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, F_MALLOC, DBG_F_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 6d89d2
compiled on 15:35:21 Oct 19 2014 with gcc 4.6.3

So I need to increase the shared and private memory using "kamailio -m 512 -M 8" command?

@miconda
Copy link
Member

miconda commented May 12, 2015

First upgrade to latest kamailio 4.2.x, you are running 4.2.0 and there were many fixes since then. All versions that start with 4.2 (e.g., 4.2.0 or 4.2.4) use the same configuration and database structure, so you just install new binaries and restart kamailio, there is nothing else to do, it will work with existing config and database.

It seems you already have 8MB of private memory and if you don't load a lot of records, should be enough. You can set it to 12MB (via -M) if you like, but the important thing is to monitor the evolution of used private memory. You can do that from command line with:

kamcmd pkg.stats

See if the used pkg memory per process increases continuously over time, then it is a leak somewhere.

@debojitkakoti
Copy link
Author

Ok thanks for the info !
I will first increase the private memory and also monitor the private memory usage. If after this the problem exist, then I will update my kamailio version.

@miconda
Copy link
Member

miconda commented May 12, 2015

I do recommend the other way around. 4.2.0 should not be used as long as there is something newer in 4.2 series. Right now 4.2.4 is the one to use and you should upgrade to it first thing.

Note also that 4.2.5 is planned to be released soon.

@debojitkakoti
Copy link
Author

Issue is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants