Why are many CBLRequestWorker threads openened in Android?


We have noticed that there are many CBLRequestWorker threads openened in Android.

What is their purpose?
Is this a “normal” behavior?
Can they affect application performance?

I don’t work on the Java version but they look like threads for network I/O. Does their number steadily grow or is it consistent?

It is used for Replication to retrieve changes from Sync Gateway.

However, I am wondering why so many threads are created.

Hi @borrrden and @hideki.

The processes are appearing each 4 and 8 seconds.
We also are having trouble to keep the sync gateway service up and running. The service stops running each 6 to 12 hours, sometimes in less time.

the configuration for logrotate.conf is:

/var/log/sync-gateway.log {
rotate 1
size 10M

And the configuration for sysctl.conf is:

System default settings live in /usr/lib/sysctl.d/00-system.conf.

To override those settings, enter new settings here, or in an /etc/sysctl.d/.conf file

For more information, see sysctl.conf(5) and sysctl.d(5).

vm.swappiness = 0
fs.file-max = 64000
net.ipv4.tcp_keepalive_time = 900
net.ipv4.tcp_keepalive_intvl = 60
net.ipv4.tcp_keepalive_probes = 3
net.ipv4.tcp_retries1 = 3
net.ipv4.tcp_retries2 = 8

net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296

We are using:

Amazon m4.xlarge

CentOS Linux release 7.1.1503 (Core)
Linux version 3.10.0-229.14.1.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Tue Sep 15 15:05:51 UTC 2015

We are using Amazon ELB for load balancing


On Android:

Android API 19
compile ‘com.couchbase.lite:couchbase-lite-android:{latest-version}’

according to;


If the threads aren’t causing problems for your app, there’s no reason for concern.

The SG issue is something different; please start a new thread for it.