Why are many CBLRequestWorker threads openened in Android?


#1

Hello.

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?


#2

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?


#3

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

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


#4

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 {
daily
rotate 1
size 10M
copytruncate
delaycompress
compress
notifempty
missingok
}

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

couchbase-sync-gateway-community_1.1.0-28_x86_64.rpm
couchbase-server-community-3.0.1-centos6.x86_64.rpm

On Android:

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

according to;

http://developer.couchbase.com/documentation/mobile/1.1.0/get-started/get-started-mobile/android/get-started-studio/index.html


#5

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.