diff --git a/dbms/src/Server/Server.cpp b/dbms/src/Server/Server.cpp index 7978445c81c..3e2c29de76c 100644 --- a/dbms/src/Server/Server.cpp +++ b/dbms/src/Server/Server.cpp @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "Server.h" - #include #include #include @@ -56,6 +54,7 @@ #include #include #include +#include #include #include #include diff --git a/dbms/src/Server/ServerInfo.h b/dbms/src/Server/ServerInfo.h index 90f8523d444..9663bd37568 100644 --- a/dbms/src/Server/ServerInfo.h +++ b/dbms/src/Server/ServerInfo.h @@ -13,8 +13,11 @@ // limitations under the License. #pragma once +#include +#include #include +#include #include #pragma GCC diagnostic push @@ -33,9 +36,9 @@ class ServerInfo struct CPUInfo { /// number of logical CPU cores - UInt16 logical_cores = 0; // set default value to 0 which means INVALID server info + UInt16 logical_cores = std::thread::hardware_concurrency(); /// number of physical CPU cores - UInt16 physical_cores = 1; // the minimum number of physical_cores is 1 + UInt16 physical_cores = getNumberOfPhysicalCPUCores(); /// number of L1 cache size /// units: Byte UInt32 l1_cache_size = 16384; // 16KB (typical value) @@ -78,7 +81,7 @@ class ServerInfo { /// total memory size /// units: Byte - UInt64 capacity = 0; + UInt64 capacity = getMemoryAmount(); }; ServerInfo() = default;