aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars <larsh@apache.org>2020-11-08 12:30:38 -0800
committerlhofhansl <larsh@apache.org>2020-11-12 09:04:10 -0800
commitbe8d1d2d99ad835b5de7277b7b518c334113e795 (patch)
treec663fcbb3e6edb7955f9c5f5fab0e4dbd0fdeb45 /src
parentbe3fe161fc831c9e6da1357dc908ed4a7681c46c (diff)
downloadminetest-be8d1d2d99ad835b5de7277b7b518c334113e795.tar.gz
minetest-be8d1d2d99ad835b5de7277b7b518c334113e795.tar.bz2
minetest-be8d1d2d99ad835b5de7277b7b518c334113e795.zip
Increase default emerge queue limits and limit enqueue requests for active blocks.
Diffstat (limited to 'src')
-rw-r--r--src/defaultsettings.cpp6
-rw-r--r--src/emerge.cpp4
2 files changed, 7 insertions, 3 deletions
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index dc0276733..177955589 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -396,9 +396,9 @@ void set_default_settings(Settings *settings)
settings->setDefault("debug_log_level", "action");
settings->setDefault("debug_log_size_max", "50");
settings->setDefault("chat_log_level", "error");
- settings->setDefault("emergequeue_limit_total", "512");
- settings->setDefault("emergequeue_limit_diskonly", "64");
- settings->setDefault("emergequeue_limit_generate", "64");
+ settings->setDefault("emergequeue_limit_total", "1024");
+ settings->setDefault("emergequeue_limit_diskonly", "128");
+ settings->setDefault("emergequeue_limit_generate", "128");
settings->setDefault("num_emerge_threads", "1");
settings->setDefault("secure.enable_security", "true");
settings->setDefault("secure.trusted_mods", "");
diff --git a/src/emerge.cpp b/src/emerge.cpp
index 0ac26a682..12e407797 100644
--- a/src/emerge.cpp
+++ b/src/emerge.cpp
@@ -426,6 +426,10 @@ bool EmergeManager::pushBlockEmergeData(
m_qlimit_generate : m_qlimit_diskonly;
if (count_peer >= qlimit_peer)
return false;
+ } else {
+ // limit block enqueue requests for active blocks to 1/2 of total
+ if (count_peer * 2 >= m_qlimit_total)
+ return false;
}
}