Use min/max_flusher_count=32/256, 128M journal and autosync_writes=512 for non-capacitor SSDs by default
parent
f6cd9f9153
commit
2ae859fbc6
|
@ -8,6 +8,7 @@
|
||||||
int disk_tool_t::prepare_one(std::map<std::string, std::string> options, int is_hdd)
|
int disk_tool_t::prepare_one(std::map<std::string, std::string> options, int is_hdd)
|
||||||
{
|
{
|
||||||
static const char *allow_additional_params[] = {
|
static const char *allow_additional_params[] = {
|
||||||
|
"autosync_writes",
|
||||||
"data_io",
|
"data_io",
|
||||||
"meta_io",
|
"meta_io",
|
||||||
"journal_io",
|
"journal_io",
|
||||||
|
@ -99,12 +100,9 @@ int disk_tool_t::prepare_one(std::map<std::string, std::string> options, int is_
|
||||||
options["disable_journal_fsync"] = options["disable_data_fsync"];
|
options["disable_journal_fsync"] = options["disable_data_fsync"];
|
||||||
}
|
}
|
||||||
// Calculate offsets if the same device is used for two or more of data, meta, and journal
|
// Calculate offsets if the same device is used for two or more of data, meta, and journal
|
||||||
if (options["journal_size"] == "")
|
if (options["journal_size"] == "" && (options["journal_device"] == "" || options["journal_device"] == options["data_device"]))
|
||||||
{
|
{
|
||||||
if (options["journal_device"] == "")
|
options["journal_size"] = is_hdd || !json_is_true(options["disable_data_fsync"]) ? "128M" : "32M";
|
||||||
options["journal_size"] = is_hdd ? "128M" : "32M";
|
|
||||||
else if (is_hdd)
|
|
||||||
options["journal_size"] = DEFAULT_HYBRID_JOURNAL;
|
|
||||||
}
|
}
|
||||||
bool is_hybrid = is_hdd && options["journal_device"] != "" && options["journal_device"] != options["data_device"];
|
bool is_hybrid = is_hdd && options["journal_device"] != "" && options["journal_device"] != options["data_device"];
|
||||||
if (is_hdd)
|
if (is_hdd)
|
||||||
|
@ -114,6 +112,15 @@ int disk_tool_t::prepare_one(std::map<std::string, std::string> options, int is_
|
||||||
if (is_hybrid && options["throttle_small_writes"] == "")
|
if (is_hybrid && options["throttle_small_writes"] == "")
|
||||||
options["throttle_small_writes"] = "1";
|
options["throttle_small_writes"] = "1";
|
||||||
}
|
}
|
||||||
|
else if (!json_is_true(options["disable_data_fsync"]))
|
||||||
|
{
|
||||||
|
if (options.find("min_flusher_count") == options.end())
|
||||||
|
options["min_flusher_count"] = "32";
|
||||||
|
if (options.find("max_flusher_count") == options.end())
|
||||||
|
options["max_flusher_count"] = "256";
|
||||||
|
if (options.find("autosync_writes") == options.end())
|
||||||
|
options["autosync_writes"] = "512";
|
||||||
|
}
|
||||||
json11::Json::object sb;
|
json11::Json::object sb;
|
||||||
blockstore_disk_t dsk;
|
blockstore_disk_t dsk;
|
||||||
try
|
try
|
||||||
|
@ -616,6 +623,7 @@ int disk_tool_t::prepare(std::vector<std::string> devices)
|
||||||
options.erase("disable_meta_fsync");
|
options.erase("disable_meta_fsync");
|
||||||
options.erase("disable_journal_fsync");
|
options.erase("disable_journal_fsync");
|
||||||
}
|
}
|
||||||
|
auto journal_size = options["journal_size"];
|
||||||
for (auto & dev: devinfo)
|
for (auto & dev: devinfo)
|
||||||
{
|
{
|
||||||
if (!hybrid || dev.is_hdd)
|
if (!hybrid || dev.is_hdd)
|
||||||
|
@ -633,11 +641,13 @@ int disk_tool_t::prepare(std::vector<std::string> devices)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
options.erase("journal_size");
|
||||||
}
|
}
|
||||||
// Treat all disks as SSDs if not in the hybrid mode
|
// Treat all disks as SSDs if not in the hybrid mode
|
||||||
prepare_one(options, dev.is_hdd ? 1 : 0);
|
prepare_one(options, dev.is_hdd ? 1 : 0);
|
||||||
if (hybrid)
|
if (hybrid)
|
||||||
{
|
{
|
||||||
|
options["journal_size"] = journal_size;
|
||||||
options.erase("journal_device");
|
options.erase("journal_device");
|
||||||
options.erase("meta_device");
|
options.erase("meta_device");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue