Skip to content

Commit

Permalink
ansible: did performance optimizations according to couchdb docs
Browse files Browse the repository at this point in the history
  • Loading branch information
klues committed May 26, 2023
1 parent fc4053f commit e69cfaf
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ansible/roles/couchDBDockerCouchdb/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,23 @@
debug:
var: result

- name: copy files local to remote (vm.args)
template:
src: vm-args
dest: ./couchdb/conf/vm.args
register: result
- name: debug [copy files local to remote with a template (vm.args)]
debug:
var: result

- name: copy files local to remote (100-couchdb.conf)
template:
src: 100-couchdb-conf
dest: ./couchdb/conf/100-couchdb.conf
register: result
- name: debug [copy files local to remote with a template (100-couchdb.conf)]
debug:
var: result

- debug:
msg: END DOCKER COUCHDB...
5 changes: 5 additions & 0 deletions ansible/roles/couchDBDockerCouchdb/templates/100-couchdb-conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#<domain> <type> <item> <value>
couchdb hard nofile 102400
couchdb soft nofile 102400
root hard nofile 102400
root soft nofile 102400
2 changes: 2 additions & 0 deletions ansible/roles/couchDBDockerCouchdb/templates/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FROM couchdb:3.3.1

COPY ./couchdb/conf/local.ini /opt/couchdb/etc/
COPY ./couchdb/conf/vm.args /opt/couchdb/etc/
COPY ./couchdb/conf/100-couchdb.conf /etc/security/limits.d/
38 changes: 38 additions & 0 deletions ansible/roles/couchDBDockerCouchdb/templates/vm-args
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.

# Ensure that the Erlang VM listens on a known port
-kernel inet_dist_listen_min 9100
-kernel inet_dist_listen_max 9100

# Tell kernel and SASL not to log anything
-kernel error_logger silent
-sasl sasl_error_logger false

# This will toggle to true in Erlang 25+. However since we don't use global
# any longer, and have our own auto-connection module, we can keep the
# existing global behavior to avoid surprises. See
# https://github.com/erlang/otp/issues/6470#issuecomment-1337421210 for more
# information about possible increased coordination and messages being sent on
# disconnections when this setting is enabled.
#
-kernel prevent_overlapping_partitions false

# Increase the pool of dirty IO schedulers from 10 to 16
# Dirty IO schedulers are used for file IO.
+SDio 16

# Comment this line out to enable the interactive Erlang shell on startup
+Bd -noinput

# allow more than 65536 open files, https://docs.couchdb.org/en/main/maintenance /performance.html
+Q 102400

0 comments on commit e69cfaf

Please sign in to comment.