Re: CPU constantly above 15% even when no client is talking to CouchDB

2022-09-02 Thread Al Z.
Thank you very much Nick for the reply.
Most appreciated.

1) I checked _active_tasks  and it return empty array []


2) About +sbwt, we are running on physical hardware ... no container.

+sbwt none
+S ${SCHEDULERS}

Would the above config changes you suggested earlier have any adverse
effect?


3) In my config file, there is

# Set maximum SSL session lifetime to reap terminated replication readers
-ssl session_lifetime 300

Note that I am using HAProxy for SSL.
Could this have any adverse effect?

Thank you very much.

Alfred.


On Thu, Sep 1, 2022 at 6:02 AM Nick Vatamaniuc  wrote:

> Hi Alfred,
>
> It could be you're seeing the effect of busy waiting from Erlang VM
> schedulers. Erlang VM would spawn a scheduler for each CPU core, and
> then after any of those schedulers run out of work, they would still
> spin in a busy loop for a bit waiting for more work. Sometimes that is
> not desirable, especially in containerized environments so then it's
> recommended to disable busy waiting by setting +sbwt to none in the
> vm.args file. Give that a try and see if it helps. More info about it
> can be found at https://adoptingerlang.org/docs/production/kubernetes/
>
> Another reason could be that there are some background index building
> or compaction jobs running.. Check out the output of _active_tasks to
> see if that's the case.
>
> Cheers,
> -Nick
>
> On Sun, Aug 14, 2022 at 11:38 AM Al Z.  wrote:
> >
> > Hello.
> > I have the latest CouchDB 3.2.2 on Ubuntu 22.04
> >
> > Even when there are no active clients talking to couchdb, the CPU is
> always
> > above 15%.
> > Not sure why.
> > couchdb's beam.smp is currently the busiest process on the server.
> >
> > [image: image.png]
> >
> >
> > # ps aux | grep couchdb
> > couchdb  979 13.4  0.1 4647432 100284 ?  Ssl  15:03   2:10
> > /opt/couchdb/bin/../erts-12.2.1/bin/beam.smp -K true -A 16 -Bd -- -root
> > /opt/couchdb/bin/.. -progname couchdb -- -home /opt/couchdb -- -boot
> > /opt/couchdb/bin/../releases/3.2.2/couchdb -name couchdb@localhost
> > -setcookie SOME_SECRET_COOKIE -kernel inet_dist_use_interface {127,0,0,1}
> > -kernel error_logger silent -sasl sasl_error_logger false -noshell
> -noinput
> > -smp enable -ssl session_lifetime 300 -- -config
> > /opt/couchdb/bin/../releases/3.2.2/sys.config --
> > couchdb   0.0  0.0   7136   220 ?S15:03   0:00
> > /opt/couchdb/bin/../erts-12.2.1/bin/epmd -daemon
> > couchdb 1163  0.0  0.0   2780   972 ?Ss   15:03   0:00
> > erl_child_setup 65536
> > couchdb 2727  0.0  0.0   3736  1192 ?Ss   15:04   0:00
> > inet_gethost 4
> > couchdb 2728  0.0  0.0   3736   108 ?S15:04   0:00
> > inet_gethost 4
> > root2982  0.0  0.0   6612  2220 pts/1S+   15:30   0:00 grep
> > --color=auto couchdb
> >
> >
> > Any hint will be appreciated.
> >
> > Thank you very much.
> >
> > Alfred.
>


CPU constantly above 15% even when no client is talking to CouchDB

2022-08-14 Thread Al Z.
Hello.
I have the latest CouchDB 3.2.2 on Ubuntu 22.04

Even when there are no active clients talking to couchdb, the CPU is always
above 15%.
Not sure why.
couchdb's beam.smp is currently the busiest process on the server.

[image: image.png]


# ps aux | grep couchdb
couchdb  979 13.4  0.1 4647432 100284 ?  Ssl  15:03   2:10
/opt/couchdb/bin/../erts-12.2.1/bin/beam.smp -K true -A 16 -Bd -- -root
/opt/couchdb/bin/.. -progname couchdb -- -home /opt/couchdb -- -boot
/opt/couchdb/bin/../releases/3.2.2/couchdb -name couchdb@localhost
-setcookie SOME_SECRET_COOKIE -kernel inet_dist_use_interface {127,0,0,1}
-kernel error_logger silent -sasl sasl_error_logger false -noshell -noinput
-smp enable -ssl session_lifetime 300 -- -config
/opt/couchdb/bin/../releases/3.2.2/sys.config --
couchdb   0.0  0.0   7136   220 ?S15:03   0:00
/opt/couchdb/bin/../erts-12.2.1/bin/epmd -daemon
couchdb 1163  0.0  0.0   2780   972 ?Ss   15:03   0:00
erl_child_setup 65536
couchdb 2727  0.0  0.0   3736  1192 ?Ss   15:04   0:00
inet_gethost 4
couchdb 2728  0.0  0.0   3736   108 ?S15:04   0:00
inet_gethost 4
root2982  0.0  0.0   6612  2220 pts/1S+   15:30   0:00 grep
--color=auto couchdb


Any hint will be appreciated.

Thank you very much.

Alfred.


CouchDB High Availablility deployment and ChangeFeed

2022-03-27 Thread Al Z.
Hello.

I have a single node running couchDB 3 deployed live.
I have a DB-per-user setup with about 2k databases on a single node.
A single Spring-boot API talks to couchDB vis HAProxy ...

1) I would like to have multiple 2 to 3 nodes in the same DC so that in
case one node goes down, the system is still operational.
Each node will have an instance of the Spring-boot API, ...
I am not sure whether I should be looking into clustering or replication.
I do understand that with replication, the nodes can be in different DB.
At this point, the plan is a single DC only. In the future, I may look into
a cross DC setup.

Any hint will me most appreciated.


2) I use the couchDB change feed to update some internal systems and send
notification emails.
Each change feed needs to be processed exactly once.
The change feed seems to be a major point of failure for my setup ...( I
also noticed that if couchDB is restarted, I need to restart the
spring-boot app, otherwise, it does not process the feed).
Given that I am planning to move to a multiple nodes setup, I am not very
sure how I would be able to process each feed only once without having to
manually handle duplicate.
Any experience or hint or alternative would be most appreciated.

Thank you very much.

Best regards.

A.