You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by rohit bhatia <ro...@gmail.com> on 2012/08/31 07:33:17 UTC

Memory Usage of a connection

I was wondering how much would be the memory usage of an established
connection in cassandra's heap space.

We are noticing extremely frequent young generation garbage collections
(3.2gb young generation, ParNew gc every 2 seconds) at a traffic of
20,000qps for 8 nodes.
We do connection pooling but with 1 connection for 6 requests with phpcassa.
So, essentially every node has on an average 500 connections
created/destroyed every second.
Could these 500 connections/second cause (on average) 2600Mb memory usage
per 2 second ~ 1300Mb/second.
or For 1 connection around 2-3Mb.

Is this value expected? (our write requests are simple counter increments
and cannot take up 500KB per request as calculation suggests, rather should
take up only a few hundred bytes).

Thanks
Rohit

Re: Memory Usage of a connection

Posted by rohit bhatia <ro...@gmail.com>.
PS: everything above is in bytes, not bits.

On Fri, Aug 31, 2012 at 11:03 AM, rohit bhatia <ro...@gmail.com> wrote:

> I was wondering how much would be the memory usage of an established
> connection in cassandra's heap space.
>
> We are noticing extremely frequent young generation garbage collections
> (3.2gb young generation, ParNew gc every 2 seconds) at a traffic of
> 20,000qps for 8 nodes.
> We do connection pooling but with 1 connection for 6 requests with
> phpcassa.
> So, essentially every node has on an average 500 connections
> created/destroyed every second.
> Could these 500 connections/second cause (on average) 2600Mb memory usage
> per 2 second ~ 1300Mb/second.
> or For 1 connection around 2-3Mb.
>
> Is this value expected? (our write requests are simple counter increments
> and cannot take up 500KB per request as calculation suggests, rather should
> take up only a few hundred bytes).
>
> Thanks
> Rohit
>

Re: Memory Usage of a connection

Posted by Peter Schuller <pe...@infidyne.com>.
> "write requests are simple counter increments" and in memtables existing in
> memory.

Counters are pretty big compared to regular columns. Whether it adds
up to what you're reporting I'm not sure. Maybe.

> So the gc should be independent of reads.

It's not. Reads do various forms of allocation just like anything else
in Cassandra. It is probably insignificant in your case so you're not
noticing a difference though.

-- 
/ Peter Schuller (@scode, http://worldmodscode.wordpress.com)

Re: Memory Usage of a connection

Posted by rohit bhatia <ro...@gmail.com>.
On Fri, Aug 31, 2012 at 11:27 AM, Peter Schuller <
peter.schuller@infidyne.com> wrote:

> > Could these 500 connections/second cause (on average) 2600Mb memory usage
> > per 2 second ~ 1300Mb/second.
> > or For 1 connection around 2-3Mb.
>
> In terms of garbage generated it's much less about number of
> connections as it is about what you're doing with them. Are you for
> example requesting large amounts of data? Large or many columns (or
> both), etc. Essentially all "working" data that your request touches
> is allocated on the heap and contributes to allocation rate and ParNew
> frequency.
>
>
"write requests are simple counter increments" and in memtables existing in
memory.
There is negligible read traffic (100/200 reads/second).
Also, increasing write traffic si the one that increases gc frequency while
keeping read traffic constant.
So the gc should be independent of reads.


> --
> / Peter Schuller (@scode, http://worldmodscode.wordpress.com)
>

Re: Memory Usage of a connection

Posted by Peter Schuller <pe...@infidyne.com>.
> Could these 500 connections/second cause (on average) 2600Mb memory usage
> per 2 second ~ 1300Mb/second.
> or For 1 connection around 2-3Mb.

In terms of garbage generated it's much less about number of
connections as it is about what you're doing with them. Are you for
example requesting large amounts of data? Large or many columns (or
both), etc. Essentially all "working" data that your request touches
is allocated on the heap and contributes to allocation rate and ParNew
frequency.

-- 
/ Peter Schuller (@scode, http://worldmodscode.wordpress.com)