Skip to content

Commit

Permalink
enable badger2ds configuration profile
Browse files Browse the repository at this point in the history
  • Loading branch information
gfurstenwerth authored and feld committed Aug 26, 2022
1 parent 76a61e0 commit b19d50f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
13 changes: 13 additions & 0 deletions config/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,19 @@ func badgerSpec() map[string]interface{} {
}
}

func badger2Spec() map[string]interface{} {
return map[string]interface{}{
"type": "measure",
"prefix": "badger.datastore",
"child": map[string]interface{}{
"type": "badger2ds",
"path": "badger2ds",
"syncWrites": false,
"truncate": true,
},
}
}

func flatfsSpec() map[string]interface{} {
return map[string]interface{}{
"type": "mount",
Expand Down
31 changes: 28 additions & 3 deletions config/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ This profile may only be applied when first initializing the node.
"flatfs": {
Description: `Configures the node to use the flatfs datastore.
This is the most battle-tested and reliable datastore.
This is the most battle-tested and reliable datastore.
You should use this datastore if:
* You need a very simple and very reliable datastore, and you trust your
Expand All @@ -146,15 +146,15 @@ This profile may only be applied when first initializing the node.
"badgerds": {
Description: `Configures the node to use the experimental badger datastore.
Use this datastore if some aspects of performance,
Use this datastore if some aspects of performance,
especially the speed of adding many gigabytes of files, are critical.
However, be aware that:
* This datastore will not properly reclaim space when your datastore is
smaller than several gigabytes. If you run IPFS with --enable-gc, you plan
on storing very little data in your IPFS node, and disk usage is more
critical than performance, consider using flatfs.
* This datastore uses up to several gigabytes of memory.
* This datastore uses up to several gigabytes of memory.
* Good for medium-size datastores, but may run into performance issues
if your dataset is bigger than a terabyte.
* The current implementation is based on old badger 1.x
Expand All @@ -168,6 +168,31 @@ This profile may only be applied when first initializing the node.`,
return nil
},
},
"badger2ds": {
Description: `Configures the node to use the experimental badger datastore.
Use this datastore if some aspects of performance,
especially the speed of adding many gigabytes of files, are critical.
However, be aware that:
* This datastore will not properly reclaim space when your datastore is
smaller than several gigabytes. If you run IPFS with --enable-gc, you plan
on storing very little data in your IPFS node, and disk usage is more
critical than performance, consider using flatfs.
* This datastore uses up to several gigabytes of memory.
* Good for medium-size datastores, but may run into performance issues
if your dataset is bigger than a terabyte.
* The current implementation is based on old badger 1.x
which is no longer supported by the upstream team.
This profile may only be applied when first initializing the node.`,

InitOnly: true,
Transform: func(c *Config) error {
c.Datastore.Spec = badger2Spec()
return nil
},
},
"lowpower": {
Description: `Reduces daemon overhead on the system. May affect node
functionality - performance of content discovery and data
Expand Down

0 comments on commit b19d50f

Please sign in to comment.