Skip to content

Commit 3bd2343

Browse files
authored
Merge pull request #1 from mig5/memory-max-systemd
Allow optionally setting MemoryMax in systemd for ipfs
2 parents b23cc85 + b0353ab commit 3bd2343

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

defaults/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ ipfs_routing: dht
1717
ipfs_disable_bandthwidth_metrics: false
1818
ipfs_reprovider_strategy: all
1919

20+
# If you find IPFS uses too much RAM, you can
21+
# limit the max amount in the systemd service
22+
# file by setting this to something suitable:
23+
# ipfs_memory_max: "1.5G"
24+
2025
# IPFS Cluster
2126

2227
# override to disable ipfs cluster setup

templates/ipfs/etc/systemd/system/ipfs.service

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Group=ipfs
99
StateDirectory=ipfs
1010
TimeoutStartSec=10800
1111
LimitNOFILE={{ ipfs_fd_max }}
12+
{% if ipfs_memory_max is defined %}
13+
MemoryMax={{ ipfs_memory_max }}
14+
{% endif %}
1215
MemorySwapMax=0
1316
Environment="IPFS_FD_MAX={{ ipfs_fd_max}}"
1417
ExecStart=/usr/local/bin/ipfs daemon --migrate {%- if ipfs_enable_gc | default(False) %} --enable-gc{% endif %}

0 commit comments

Comments
 (0)