-
Notifications
You must be signed in to change notification settings - Fork 0
/
14_optional_tune_memory_multiservice.yaml
62 lines (56 loc) · 1.98 KB
/
14_optional_tune_memory_multiservice.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
- hosts: quobyteservers
become: yes
tasks:
- name: remove deprecated environment file
file:
path: /etc/default/quobyte
state: absent
- name: remove deprecated systemd file
file:
path: /etc/systemd/system/quobyte-metadata.service.d/10-memory-cgroup-disabled.conf
state: absent
- name: remove deprecated systemd file
file:
path: /etc/systemd/system/quobyte-data.service.d/10-memory-cgroup-disabled.conf
state: absent
- hosts: dataservices,metadataservices
become: yes
tasks:
- name: Configure dataservice memory consumption
blockinfile:
path: /etc/systemd/system.control/quobyte-data.service.d/50-MemoryMaxScale.conf
state: present
create: true
block: |
[Service]
## MemoryMax=40.0%
MemoryLimit={{ (ansible_memtotal_mb * 0.4 / 1024) |int|abs }}G
Environment=MAX_MEM_DATA={{ (ansible_memtotal_mb * 0.1 / 1024) |int|abs }}G
Environment=MAX_BUFFER_DATA={{ (ansible_memtotal_mb * 0.3 / 1024) |int|abs }}G
- name: Configure metadataservice memory consumption
blockinfile:
path: /etc/systemd/system.control/quobyte-metadata.service.d/50-MemoryMaxScale.conf
state: present
create: true
block: |
[Service]
## MemoryMax=50.0%
MemoryLimit={{ (ansible_memtotal_mb * 0.5 / 1024) |int|abs }}G
Environment=MAX_MEM_METADATA={{ (ansible_memtotal_mb * 0.15 / 1024) |int|abs }}G
Environment=MAX_BUFFER_METADATA={{ (ansible_memtotal_mb * 0.1 / 1024) |int|abs }}G
- name: Reload systemd config
command: systemctl daemon-reload
- hosts: metadataservices
become: yes
tasks:
- name: Restart Quobyte metadata services
service:
state: restarted
name: quobyte-metadata
- hosts: dataservices
become: yes
tasks:
- name: Restart Quobyte data services
service:
state: restarted
name: quobyte-data