Database Reference
In-Depth Information
process rather than letting it swap for a while before it eventually runs out of
memory itself. Along this same line, if the GCInspector isn't reporting excessively
long GC times but the GC times are regularly taking longer, it may be that the
JVM is dealing with heavy GC pressure and will eventually run out of memory.
Tracking Down OOM Errors
OOM errors are not uncommon in Java, and there are definitely ways of dealing
with them. This is true for Cassandra as well. The following sections present a few
common reasons that Cassandra will die for OOM reasons and what can be done
about them.
Caching Is Too Large
This is commonly attributed to the row cache being too large but can be a function
of either the key cache or the row cache. If your ColumnFamily cache settings are
either ROWS_ONLY or ALL , you can remove at least the row cache and drop it
down to key caching (by using KEYS_ONLY as the cache setting in the Colum-
nFamily). Since caching rows is a high-end optimization, it is likely that Cassandra
can run very well without it.
If you don't want to change the caching levels on each ColumnFamily specific-
ally, you can also change the configuration at a higher level, in the cassandra.yaml
file. The two main settings to adjust are the key_cache_size_in_mb and the
row_cache_size_in_mb . By making these two values smaller, you may be
able to prevent the OOM issues.
It is also possible that you may not be using your caches efficiently. The default
row_cache_provider is the SerializingCacheProvider. It is the most memory
efficient and for non-blob-intensive applications is only about a five to ten times
increase in the amount of memory used. The other option, if you have a more
update-heavy workload, is to use the ConcurrentLinkedHashCacheProvider. Un-
like the SerializingCacheProvider, which updates rows in place on change, the
ConcurrentLinkedHashCacheProvider just invalidates cached rows in memory on
change. Ideally, you want to see about a 90% hit rate for row caches. If you can't
get to that, you should likely switch the cache to KEYS_ONLY to preserve the ex-
tra cache space for other ColumnFamilys.
Search WWH ::




Custom Search