Memory consumption of the C++ driver in apache module

16 views
Skip to first unread message

Christophe Angeli

unread,
Oct 5, 2016, 10:15:40 AM10/5/16
to DataStax C++ Driver for Apache Cassandra User Mailing List
Hi everyone,

I have a memory issue with an apache module using Cassandra native driver.
I don't know if this comes from the driver itself or the Apache Web Server.

Using driver 2.4.3, Cassandra 2.1.14 and apache2 2.2.22 worker.
Token aware activated.

I have an application that connects to a Cassandra cluster composed of 2 DCs of 9 nodes each.
This application is compiled as an apache module.
Each apache child creates 4 CassSessions to the Cassandra cluster.

Sometimes, I need to change the Cassandra configuration (i.e change the default DC or add a blacklist host) without reloading the apache server itself. A listener thread is responsible for detecting configuration change.
For each child :
- create 4 new CassSession
- wait for the new CassSessions to connect
- delete the old CassSession

I observe that the apache server memory increases, that seems to be normal since we double the sessions for a few moment. Then the old connections are closed, the old sessions are deleted, but the apache memory doesn't decrease.
I made a test (graph attached) that consist at switching the default DC every 10s :
11h57: apache2 restart (250MB)
12h00-13h00 : switch DC every 10s

The apache memory grows and stabilizes at 800MB.
There seems to be no memory leaks inside the driver (using valgrind), even if the token aware option induces more allocations (TokenMapImpl::build_replicas).

I don't have any explanation for this behavior.
Any help would be appreciated !

Cheers,

Christophe

mem.png
Reply all
Reply to author
Forward
0 new messages