diff --git a/packaging/aleph-vm/etc/ipfs/kubo.json b/packaging/aleph-vm/etc/ipfs/kubo.json index 9957b142e..2b28b3ca3 100644 --- a/packaging/aleph-vm/etc/ipfs/kubo.json +++ b/packaging/aleph-vm/etc/ipfs/kubo.json @@ -9,9 +9,12 @@ "Strategy": "roots" }, "Swarm": { - "EnableHolePunching":false, + "EnableHolePunching": false, "RelayService": { "Enabled": false + }, + "ResourceMgr": { + "MaxMemory": "1GB" } } -} +} \ No newline at end of file diff --git a/packaging/aleph-vm/etc/systemd/system/ipfs.service b/packaging/aleph-vm/etc/systemd/system/ipfs.service index 2009361e3..77cbdab36 100644 --- a/packaging/aleph-vm/etc/systemd/system/ipfs.service +++ b/packaging/aleph-vm/etc/systemd/system/ipfs.service @@ -50,6 +50,11 @@ ProtectHome=true RemoveIPC=true RestrictSUIDSGID=true CapabilityBoundingSet=CAP_NET_BIND_SERVICE +# set memory limit to avoid taking all the CRN ressource and getting OOM +# https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgrmaxmemory +Environment=GOMEMLIMIT=1900m +MemoryHigh=2G +MemoryMax=4G # enable for 1-1024 port listening #AmbientCapabilities=CAP_NET_BIND_SERVICE