Commit 5c03f616 authored by gammazero's avatar gammazero Committed by Andrew Gillis

Add badger2 profile and config spec

parent 0b259059
...@@ -142,6 +142,19 @@ func badgerSpec() map[string]interface{} { ...@@ -142,6 +142,19 @@ func badgerSpec() map[string]interface{} {
} }
} }
func badger2Spec() map[string]interface{} {
return map[string]interface{}{
"type": "measure",
"prefix": "badger2.datastore",
"child": map[string]interface{}{
"type": "badger2ds",
"path": "badger2ds",
"syncWrites": false,
"truncate": true,
},
}
}
func flatfsSpec() map[string]interface{} { func flatfsSpec() map[string]interface{} {
return map[string]interface{}{ return map[string]interface{}{
"type": "mount", "type": "mount",
......
...@@ -130,7 +130,7 @@ This profile may only be applied when first initializing the node. ...@@ -130,7 +130,7 @@ This profile may only be applied when first initializing the node.
This is the most battle-tested and reliable datastore, but it's significantly This is the most battle-tested and reliable datastore, but it's significantly
slower than the badger datastore. You should use this datastore if: slower than the badger datastore. You should use this datastore if:
* You need a very simple and very reliable datastore you and trust your * You need a very simple and very reliable datastore and you trust your
filesystem. This datastore stores each block as a separate file in the filesystem. This datastore stores each block as a separate file in the
underlying filesystem so it's unlikely to loose data unless there's an issue underlying filesystem so it's unlikely to loose data unless there's an issue
with the underlying file system. with the underlying file system.
...@@ -152,7 +152,7 @@ This profile may only be applied when first initializing the node. ...@@ -152,7 +152,7 @@ This profile may only be applied when first initializing the node.
"badgerds": { "badgerds": {
Description: `Configures the node to use the badger datastore. Description: `Configures the node to use the badger datastore.
This is the fastest datastore. Use this datastore if performance, especially This is a fast datastore. Use this datastore if performance, especially
when adding many gigabytes of files, is critical. However: when adding many gigabytes of files, is critical. However:
* This datastore will not properly reclaim space when your datastore is * This datastore will not properly reclaim space when your datastore is
...@@ -170,6 +170,27 @@ This profile may only be applied when first initializing the node.`, ...@@ -170,6 +170,27 @@ This profile may only be applied when first initializing the node.`,
return nil return nil
}, },
}, },
"badger2ds": {
Description: `Configures the node to use the badger2 datastore.
This is the fastest datastore. Use this datastore if performance, especially
when adding many gigabytes of files, is critical. However:
* This datastore will not properly reclaim space when your datastore is
smaller than several gigabytes. If you run IPFS with '--enable-gc' (you have
enabled block-level garbage collection), 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 profile may only be applied when first initializing the node.`,
InitOnly: true,
Transform: func(c *Config) error {
c.Datastore.Spec = badger2Spec()
return nil
},
},
"lowpower": { "lowpower": {
Description: `Reduces daemon overhead on the system. May affect node Description: `Reduces daemon overhead on the system. May affect node
functionality - performance of content discovery and data functionality - performance of content discovery and data
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment