Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Merge branch 'feature/add_nproc_limit' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lae committed Dec 22, 2016
2 parents 48e6675 + b64b52d commit 6117a43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ elasticsearch_max_open_files: 131072
elasticsearch_max_locked_memory: unlimited
# The following configures the vm.max_map_count sysctl entry.
elasticsearch_max_map_count: 262144
# Number of threads allowed by the elasticsearch user
# https://www.elastic.co/guide/en/elasticsearch/reference/current/max-number-of-threads.html
elasticsearch_max_num_threads: 2048

# This one automatically gets configured to the smaller of (RAM/2)-1GB & 31GB.
# This variable must be specified with a suffixed unit such as 'm' or 'g'
#elasticsearch_heap_size:
Expand Down
19 changes: 8 additions & 11 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,16 @@
notify: elasticsearch restart needed
when: '{{ elasticsearch_major_version >= 5 }}'

- name: Configure nofile for Elasticsearch in PAM limits
- name: Configure PAM limits for Elasticsearch
pam_limits:
domain: elasticsearch
limit_type: '-'
limit_item: nofile
value: '{{ elasticsearch_max_open_files }}'

- name: Configure memlock for Elasticsearch in PAM limits
pam_limits:
domain: elasticsearch
limit_type: '-'
limit_item: memlock
value: '{{ elasticsearch_max_locked_memory }}'
limit_type: "{{ item.0 }}"
limit_item: "{{ item.1 }}"
value: "{{ item.2 }}"
with_items:
- [['-', 'nofile', '{{ elasticsearch_max_open_files }}']]
- [['-', 'memlock', '{{ elasticsearch_max_locked_memory }}']]
- [['-', 'nproc', '{{ elasticsearch_max_num_threads }}']]

- block:
- name: Configure nofile for Elasticsearch in systemd unit file
Expand Down

0 comments on commit 6117a43

Please sign in to comment.