Time spent with garbage collection


How can I tell how much time is spent during garbage collection?
I’ve been looking at ns_server.stats.log and found this piece of information:


I’m guessing that numbers have something to do but not sure about their meaning.
Does anyone have a clue?
Should I be looking somewhere else?


I wouldn’t worry too much about that as ns_server is not in the critical path for most operations. The cluster manager is intentionally out of the way, for the most part, but comes into play for monitoring and failover.

Is it cluster management garbage collection that you’re concerned with, or affecting something else?


I’ve been getting these type of errors:

Caused by: net.spy.memcached.OperationTimeoutException: Timeout waiting for value: waited 5,000 ms. Node status: Connection Status { memcache03.mri.tools/ active: false, authed: true, last read: 5,115 ms ago memcache06.mri.tools/ active: false, authed: true, last read: 5,334 ms ago dai-memcache20.dai/ active: false, authed: true, last read: 5,417 ms ago memcache01.mri.tools/ active: false, authed: true, last read: 5,180 ms ago dai-memcache19.mri.tools.dai/ active: false, authed: true, last read: 5,009 ms ago dai-memcache18.dai/ active: false, authed: true, last read: 5,262 ms ago memcache02.mri.tools/ active: false, authed: true, last read: 5,161 ms ago memcache04.mri.tools/ active: false, authed: true, last read: 5,028 ms ago }
at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:1241)
at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:1257)
at com.ezrez.common.memcached.MemcachedServiceCouchbaseBase.primitiveGet(MemcachedServiceCouchbaseBase.java:243)
… 144 more

From other posts, the suggestion is that it could be related to garbage collection, that’s why I’m trying to find out if that’s the case.


The garbage collection in this case is the Java JVM one at the application server side and not the Couchbase Server side.

Timeout can be a trick problem to debug as the problem can be any where in the stack: Application/network/Couchbase Server/ Hardware. From the backtrace provide it looks like get operations are timing out after 5 seconds. Get requests go directly to the Data service (memcached process). I would recommend looking at the memcached.log. On the newer versions of Couchbase Server, the data service will log any operation that took over 500ms. For example they look like this:

2016-06-20T15:39:25.744852+01:00 WARNING 132: Slow GET operation on connection: 4421 ms ([ - ])

If you do see those messages on the server side then you know that the problem is on the server side, again this could be a sizing issue or a hardware problem. The next steps in this case would be to check the resident ratio of the bucket and the disk utilization.

If you do not see those messages I would start looking at the network and application.


Thanks for the help.
Indeed it seems to be environment related.