diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2011-12-31 05:24:11 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2011-12-31 05:24:11 +0100 |
commit | c216c9f0f039836f2b8c9edad0884511303101fd (patch) | |
tree | 0e07375300ca8ee89960313f3749258de167a890 /sql/threadpool_unix.cc | |
parent | bb0a0c52a65ce3a0621fcfc133d724b0485bb5c3 (diff) | |
download | mariadb-git-c216c9f0f039836f2b8c9edad0884511303101fd.tar.gz |
Allow for faster creation of threads in corner cases where pool would be overloaded with long non-yielding queries.
To allow it, change minimum of thread_pool_stall_limit to be 10 milliseconds.
Also introduce a new parameter to oversubscribe a group . Number of threads running in parallel would be higher than it normally should, leading to thrashing, but it may improving preemptiveness, which is useful for the described corner case.
Diffstat (limited to 'sql/threadpool_unix.cc')
-rw-r--r-- | sql/threadpool_unix.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc index d9eb90532af..ec9f5a91d40 100644 --- a/sql/threadpool_unix.cc +++ b/sql/threadpool_unix.cc @@ -839,13 +839,13 @@ static void post_event(thread_group_t *thread_group, pool_event_t* ev) /* - Check if pool is already overcommited. This is used to prevent too many threads executing at the same time, if the workload is not CPU bound. */ static bool too_many_threads(thread_group_t *thread_group) { - return (thread_group->active_thread_count >= 4 && !thread_group->stalled); + return (thread_group->active_thread_count >= 1+(int)threadpool_oversubscribe + && !thread_group->stalled); } |