diff options
author | Daniel Black <daniel@linux.ibm.com> | 2018-11-09 14:38:22 +1100 |
---|---|---|
committer | Anel Husakovic <anel@mariadb.org> | 2020-02-20 08:44:20 +0100 |
commit | fb01cc3766be9131402b82730adfa0e45e6e3511 (patch) | |
tree | f3ef6f22014af71162a0579940f782113f6a307f /config.h.cmake | |
parent | 959fc0c0ccaac0c0946a9c07bceb9b82116c8b47 (diff) | |
download | mariadb-git-fb01cc3766be9131402b82730adfa0e45e6e3511.tar.gz |
my_getncpus based on threads available
Detecting the cpus based on sysconf of the online CPUs can significantly
over estimate the number of cpus available.
Wheither via numactl, cgroups, taskset, systemd constraints, docker
containers and probably other mechanisms, the number of threads mysqld
can be run on can be quite less.
As such we use the pthread_getaffinity_np function on Linux and FreeBSD
(identical API) to get the number of CPUs.
The number of CPUs is the default for the thread_pool_size and a too
high default will resulting in large memory usage and high context
switching overhead.
Closes PR #922
Diffstat (limited to 'config.h.cmake')
-rw-r--r-- | config.h.cmake | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/config.h.cmake b/config.h.cmake index 6e4af65c40e..fdaba640ad6 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -200,6 +200,9 @@ #cmakedefine HAVE_PTHREAD_ATTR_SETSCOPE 1 #cmakedefine HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 #cmakedefine HAVE_PTHREAD_CONDATTR_CREATE 1 +#cmakedefine HAVE_PTHREAD_CONDATTR_SETCLOCK 1 +#cmakedefine HAVE_PTHREAD_GETAFFINITY_NP 1 +#cmakedefine HAVE_PTHREAD_KEY_DELETE 1 #cmakedefine HAVE_PTHREAD_KEY_DELETE 1 #cmakedefine HAVE_PTHREAD_KILL 1 #cmakedefine HAVE_PTHREAD_RWLOCK_RDLOCK 1 |