Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
bb0a0c52
Commit
bb0a0c52
authored
Dec 29, 2011
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make threadpool_stall_limit variable really dynamic
parent
539a7ebe
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
2 deletions
+22
-2
sql/sys_vars.cc
sql/sys_vars.cc
+10
-2
sql/threadpool.h
sql/threadpool.h
+1
-0
sql/threadpool_unix.cc
sql/threadpool_unix.cc
+11
-0
No files found.
sql/sys_vars.cc
View file @
bb0a0c52
...
@@ -2211,6 +2211,12 @@ static bool fix_threadpool_size(sys_var*, THD*, enum_var_type)
...
@@ -2211,6 +2211,12 @@ static bool fix_threadpool_size(sys_var*, THD*, enum_var_type)
tp_set_threadpool_size
(
threadpool_size
);
tp_set_threadpool_size
(
threadpool_size
);
return
false
;
return
false
;
}
}
static
bool
fix_threadpool_stall_limit
(
sys_var
*
,
THD
*
,
enum_var_type
)
{
tp_set_threadpool_stall_limit
(
threadpool_size
);
}
#endif
#endif
#ifdef _WIN32
#ifdef _WIN32
...
@@ -2241,12 +2247,14 @@ static Sys_var_uint Sys_threadpool_size(
...
@@ -2241,12 +2247,14 @@ static Sys_var_uint Sys_threadpool_size(
);
);
static
Sys_var_uint
Sys_threadpool_stall_limit
(
static
Sys_var_uint
Sys_threadpool_stall_limit
(
"thread_pool_stall_limit"
,
"thread_pool_stall_limit"
,
"Maximum query execution time
before
in milliseconds,"
"Maximum query execution time in milliseconds,"
"before an executing non-yielding thread is considered stalled."
"before an executing non-yielding thread is considered stalled."
"If a worker thread is stalled, additional worker thread "
"If a worker thread is stalled, additional worker thread "
"may be created to handle remaining clients."
,
"may be created to handle remaining clients."
,
GLOBAL_VAR
(
threadpool_stall_limit
),
CMD_LINE
(
REQUIRED_ARG
),
GLOBAL_VAR
(
threadpool_stall_limit
),
CMD_LINE
(
REQUIRED_ARG
),
VALID_RANGE
(
60
,
UINT_MAX
),
DEFAULT
(
500
),
BLOCK_SIZE
(
1
)
VALID_RANGE
(
60
,
UINT_MAX
),
DEFAULT
(
500
),
BLOCK_SIZE
(
1
),
NO_MUTEX_GUARD
,
NOT_IN_BINLOG
,
ON_CHECK
(
0
),
ON_UPDATE
(
fix_threadpool_stall_limit
)
);
);
#endif
/* !WIN32 */
#endif
/* !WIN32 */
static
Sys_var_uint
Sys_threadpool_max_threads
(
static
Sys_var_uint
Sys_threadpool_max_threads
(
...
...
sql/threadpool.h
View file @
bb0a0c52
...
@@ -41,6 +41,7 @@ extern TP_STATISTICS tp_stats;
...
@@ -41,6 +41,7 @@ extern TP_STATISTICS tp_stats;
extern
void
tp_set_min_threads
(
uint
val
);
extern
void
tp_set_min_threads
(
uint
val
);
extern
void
tp_set_max_threads
(
uint
val
);
extern
void
tp_set_max_threads
(
uint
val
);
extern
int
tp_set_threadpool_size
(
uint
val
);
extern
int
tp_set_threadpool_size
(
uint
val
);
extern
void
tp_set_threadpool_stall_limit
(
uint
val
);
/* Activate threadpool scheduler */
/* Activate threadpool scheduler */
extern
void
tp_scheduler
(
void
);
extern
void
tp_scheduler
(
void
);
...
...
sql/threadpool_unix.cc
View file @
bb0a0c52
...
@@ -1324,6 +1324,7 @@ bool tp_init()
...
@@ -1324,6 +1324,7 @@ bool tp_init()
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
void
tp_end
()
void
tp_end
()
{
{
DBUG_ENTER
(
"tp_end"
);
DBUG_ENTER
(
"tp_end"
);
...
@@ -1365,3 +1366,13 @@ int tp_set_threadpool_size(uint size)
...
@@ -1365,3 +1366,13 @@ int tp_set_threadpool_size(uint size)
group_count
=
size
;
group_count
=
size
;
return
0
;
return
0
;
}
}
void
tp_set_threadpool_stall_limit
(
uint
limit
)
{
if
(
!
started
)
return
;
mysql_mutex_lock
(
&
(
pool_timer
.
mutex
));
pool_timer
.
tick_interval
=
limit
;
mysql_cond_signal
(
&
(
pool_timer
.
cond
));
mysql_mutex_unlock
(
&
(
pool_timer
.
mutex
));
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment