Merge pull request #4 from 67P/feature/reduce_memory_usage
Reduce the memory usage of go-ipfs
This commit is contained in:
commit
c6a0159e82
@ -10,7 +10,7 @@ GRAPH
|
|||||||
build-essential (8.1.1)
|
build-essential (8.1.1)
|
||||||
mingw (>= 1.1)
|
mingw (>= 1.1)
|
||||||
seven_zip (>= 0.0.0)
|
seven_zip (>= 0.0.0)
|
||||||
ipfs (0.1.0)
|
ipfs (0.1.3)
|
||||||
ark (>= 0.0.0)
|
ark (>= 0.0.0)
|
||||||
mingw (2.1.0)
|
mingw (2.1.0)
|
||||||
seven_zip (>= 0.0.0)
|
seven_zip (>= 0.0.0)
|
||||||
|
@ -83,3 +83,26 @@ end
|
|||||||
ipfs_config 'Swarm.AddrFilters' do
|
ipfs_config 'Swarm.AddrFilters' do
|
||||||
value node['ipfs']['config']['swarm']['addr_filter']
|
value node['ipfs']['config']['swarm']['addr_filter']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Do not keep track of bandwidth metrics. Disabling bandwidth metrics can
|
||||||
|
# lead to a slight performance improvement, as well as a reduction in memory
|
||||||
|
# usage.
|
||||||
|
ipfs_config 'Swarm.DisableBandwidthMetrics' do
|
||||||
|
value true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Disable the p2p-circuit relay transport
|
||||||
|
ipfs_config 'Swarm.DisableRelay' do
|
||||||
|
value true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Number of connections that, when exceeded, will trigger a connection GC
|
||||||
|
# operation
|
||||||
|
ipfs_config 'Swarm.ConnMgr.HighWater' do
|
||||||
|
value 10
|
||||||
|
end
|
||||||
|
|
||||||
|
# Minimum number of connections to maintain
|
||||||
|
ipfs_config 'Swarm.ConnMgr.LowWater' do
|
||||||
|
value 1
|
||||||
|
end
|
||||||
|
@ -2,7 +2,7 @@ require 'json'
|
|||||||
require 'mixlib/shellout'
|
require 'mixlib/shellout'
|
||||||
|
|
||||||
property :key, String, name_property: true
|
property :key, String, name_property: true
|
||||||
property :value, [String, Hash, Array, TrueClass, FalseClass], required: true
|
property :value, [String, Hash, Array, TrueClass, FalseClass, Integer], required: true
|
||||||
|
|
||||||
action :create do
|
action :create do
|
||||||
include_recipe 'ipfs'
|
include_recipe 'ipfs'
|
||||||
|
@ -2,12 +2,14 @@
|
|||||||
Description=Start ipfs
|
Description=Start ipfs
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/local/bin/ipfs daemon --migrate
|
ExecStart=/usr/local/bin/ipfs daemon --migrate --routing=dhtclient
|
||||||
User=ipfs
|
User=ipfs
|
||||||
Group=ipfs
|
Group=ipfs
|
||||||
Restart=always
|
Restart=always
|
||||||
# Raise the ulimit (max number of open files)
|
# Raise the ulimit (max number of open files)
|
||||||
LimitNOFILE=64000
|
LimitNOFILE=64000
|
||||||
|
# Limit the memory usage to 256MB
|
||||||
|
MemoryMax=256M
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
Loading…
x
Reference in New Issue
Block a user