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
a5a22e9f
Commit
a5a22e9f
authored
Dec 18, 2011
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small adjustements to threadpool
parent
46810456
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
14 additions
and
13 deletions
+14
-13
sql/net_serv.cc
sql/net_serv.cc
+4
-0
sql/sql_class.cc
sql/sql_class.cc
+1
-0
sql/sql_class.h
sql/sql_class.h
+3
-0
sql/sql_parse.cc
sql/sql_parse.cc
+1
-1
sql/sys_vars.cc
sql/sys_vars.cc
+3
-3
sql/threadpool.h
sql/threadpool.h
+0
-3
sql/threadpool_common.cc
sql/threadpool_common.cc
+2
-4
sql/threadpool_unix.cc
sql/threadpool_unix.cc
+0
-1
sql/threadpool_win.cc
sql/threadpool_win.cc
+0
-1
No files found.
sql/net_serv.cc
View file @
a5a22e9f
...
@@ -1159,6 +1159,8 @@ void my_net_set_read_timeout(NET *net, uint timeout)
...
@@ -1159,6 +1159,8 @@ void my_net_set_read_timeout(NET *net, uint timeout)
{
{
DBUG_ENTER
(
"my_net_set_read_timeout"
);
DBUG_ENTER
(
"my_net_set_read_timeout"
);
DBUG_PRINT
(
"enter"
,
(
"timeout: %d"
,
timeout
));
DBUG_PRINT
(
"enter"
,
(
"timeout: %d"
,
timeout
));
if
(
net
->
read_timeout
==
timeout
)
DBUG_VOID_RETURN
;
net
->
read_timeout
=
timeout
;
net
->
read_timeout
=
timeout
;
#ifdef NO_ALARM
#ifdef NO_ALARM
if
(
net
->
vio
)
if
(
net
->
vio
)
...
@@ -1172,6 +1174,8 @@ void my_net_set_write_timeout(NET *net, uint timeout)
...
@@ -1172,6 +1174,8 @@ void my_net_set_write_timeout(NET *net, uint timeout)
{
{
DBUG_ENTER
(
"my_net_set_write_timeout"
);
DBUG_ENTER
(
"my_net_set_write_timeout"
);
DBUG_PRINT
(
"enter"
,
(
"timeout: %d"
,
timeout
));
DBUG_PRINT
(
"enter"
,
(
"timeout: %d"
,
timeout
));
if
(
net
->
write_timeout
==
timeout
)
DBUG_VOID_RETURN
;
net
->
write_timeout
=
timeout
;
net
->
write_timeout
=
timeout
;
#ifdef NO_ALARM
#ifdef NO_ALARM
if
(
net
->
vio
)
if
(
net
->
vio
)
...
...
sql/sql_class.cc
View file @
a5a22e9f
...
@@ -749,6 +749,7 @@ THD::THD()
...
@@ -749,6 +749,7 @@ THD::THD()
derived_tables_processing
(
FALSE
),
derived_tables_processing
(
FALSE
),
spcont
(
NULL
),
spcont
(
NULL
),
m_parser_state
(
NULL
),
m_parser_state
(
NULL
),
skip_wait_timeout
(
false
),
#if defined(ENABLED_DEBUG_SYNC)
#if defined(ENABLED_DEBUG_SYNC)
debug_sync_control
(
0
),
debug_sync_control
(
0
),
#endif
/* defined(ENABLED_DEBUG_SYNC) */
#endif
/* defined(ENABLED_DEBUG_SYNC) */
...
...
sql/sql_class.h
View file @
a5a22e9f
...
@@ -1697,6 +1697,9 @@ class THD :public Statement,
...
@@ -1697,6 +1697,9 @@ class THD :public Statement,
/* True if we want to log all errors */
/* True if we want to log all errors */
bool
log_all_errors
;
bool
log_all_errors
;
/* Do not set socket timeouts for wait_timeout (used with threadpool) */
bool
skip_wait_timeout
;
/* container for handler's private per-connection data */
/* container for handler's private per-connection data */
Ha_data
ha_data
[
MAX_HA
];
Ha_data
ha_data
[
MAX_HA
];
...
...
sql/sql_parse.cc
View file @
a5a22e9f
...
@@ -701,7 +701,7 @@ bool do_command(THD *thd)
...
@@ -701,7 +701,7 @@ bool do_command(THD *thd)
the client, the connection is closed or "net_wait_timeout"
the client, the connection is closed or "net_wait_timeout"
number of seconds has passed.
number of seconds has passed.
*/
*/
if
(
!
skip_net
_wait_timeout
)
if
(
!
thd
->
skip
_wait_timeout
)
my_net_set_read_timeout
(
net
,
thd
->
variables
.
net_wait_timeout
);
my_net_set_read_timeout
(
net
,
thd
->
variables
.
net_wait_timeout
);
...
...
sql/sys_vars.cc
View file @
a5a22e9f
...
@@ -2220,7 +2220,7 @@ static Sys_var_uint Sys_threadpool_size(
...
@@ -2220,7 +2220,7 @@ static Sys_var_uint Sys_threadpool_size(
"Number of concurrently executing threads in the pool. "
"Number of concurrently executing threads in the pool. "
"Leaving value default (0) sets it to the number of processors."
,
"Leaving value default (0) sets it to the number of processors."
,
GLOBAL_VAR
(
threadpool_size
),
CMD_LINE
(
REQUIRED_ARG
),
GLOBAL_VAR
(
threadpool_size
),
CMD_LINE
(
REQUIRED_ARG
),
VALID_RANGE
(
0
,
128
),
DEFAULT
(
0
),
BLOCK_SIZE
(
1
)
VALID_RANGE
(
1
,
128
),
DEFAULT
(
my_getncpus
()
),
BLOCK_SIZE
(
1
)
);
);
static
Sys_var_uint
Sys_threadpool_stall_limit
(
static
Sys_var_uint
Sys_threadpool_stall_limit
(
"thread_pool_stall_limit"
,
"thread_pool_stall_limit"
,
...
@@ -2231,12 +2231,12 @@ static Sys_var_uint Sys_threadpool_stall_limit(
...
@@ -2231,12 +2231,12 @@ static Sys_var_uint Sys_threadpool_stall_limit(
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
)
);
);
#endif
/*!
WIN32 */
#endif
/* !
WIN32 */
static
Sys_var_uint
Sys_threadpool_max_threads
(
static
Sys_var_uint
Sys_threadpool_max_threads
(
"thread_pool_max_threads"
,
"thread_pool_max_threads"
,
"Maximum allowed number of worker threads in the thread pool"
,
"Maximum allowed number of worker threads in the thread pool"
,
GLOBAL_VAR
(
threadpool_max_threads
),
CMD_LINE
(
REQUIRED_ARG
),
GLOBAL_VAR
(
threadpool_max_threads
),
CMD_LINE
(
REQUIRED_ARG
),
VALID_RANGE
(
1
,
UINT_MAX
),
DEFAULT
(
30
00
),
BLOCK_SIZE
(
1
),
VALID_RANGE
(
1
,
UINT_MAX
),
DEFAULT
(
5
00
),
BLOCK_SIZE
(
1
),
NO_MUTEX_GUARD
,
NOT_IN_BINLOG
,
ON_CHECK
(
0
),
NO_MUTEX_GUARD
,
NOT_IN_BINLOG
,
ON_CHECK
(
0
),
ON_UPDATE
(
fix_tp_max_threads
)
ON_UPDATE
(
fix_tp_max_threads
)
);
);
...
...
sql/threadpool.h
View file @
a5a22e9f
/* Threadpool parameters */
/* Threadpool parameters */
#ifdef _WIN32
extern
uint
threadpool_min_threads
;
/* Minimum threads in pool */
extern
uint
threadpool_min_threads
;
/* Minimum threads in pool */
#else
extern
uint
threadpool_idle_timeout
;
/* Shutdown idle worker threads after this timeout */
extern
uint
threadpool_idle_timeout
;
/* Shutdown idle worker threads after this timeout */
extern
uint
threadpool_size
;
/* Number of parallel executing threads */
extern
uint
threadpool_size
;
/* Number of parallel executing threads */
extern
uint
threadpool_stall_limit
;
/* time interval in 10 ms units for stall checks*/
extern
uint
threadpool_stall_limit
;
/* time interval in 10 ms units for stall checks*/
#endif
extern
uint
threadpool_max_threads
;
/* Maximum threads in pool */
extern
uint
threadpool_max_threads
;
/* Maximum threads in pool */
/*
/*
...
...
sql/threadpool_common.cc
View file @
a5a22e9f
...
@@ -17,13 +17,11 @@ extern void thd_cleanup(THD *thd);
...
@@ -17,13 +17,11 @@ extern void thd_cleanup(THD *thd);
extern
void
delete_thd
(
THD
*
thd
);
extern
void
delete_thd
(
THD
*
thd
);
/* Threadpool parameters */
/* Threadpool parameters */
#ifdef _WIN32
uint
threadpool_min_threads
;
uint
threadpool_min_threads
;
#else
uint
threadpool_idle_timeout
;
uint
threadpool_idle_timeout
;
uint
threadpool_size
;
uint
threadpool_size
;
uint
threadpool_stall_limit
;
uint
threadpool_stall_limit
;
#endif
uint
threadpool_max_threads
;
uint
threadpool_max_threads
;
...
@@ -127,7 +125,7 @@ int threadpool_add_connection(THD *thd)
...
@@ -127,7 +125,7 @@ int threadpool_add_connection(THD *thd)
thd
->
net
.
reading_or_writing
=
1
;
thd
->
net
.
reading_or_writing
=
1
;
}
}
}
}
thd
->
skip_wait_timeout
=
true
;
thread_detach
(
thd
,
psi_thread
);
thread_detach
(
thd
,
psi_thread
);
return
retval
;
return
retval
;
}
}
...
...
sql/threadpool_unix.cc
View file @
a5a22e9f
...
@@ -1198,7 +1198,6 @@ bool tp_init()
...
@@ -1198,7 +1198,6 @@ bool tp_init()
DBUG_ENTER
(
"tp_init"
);
DBUG_ENTER
(
"tp_init"
);
started
=
true
;
started
=
true
;
scheduler_init
();
scheduler_init
();
skip_net_wait_timeout
=
1
;
if
(
threadpool_size
==
0
)
if
(
threadpool_size
==
0
)
{
{
threadpool_size
=
my_getncpus
();
threadpool_size
=
my_getncpus
();
...
...
sql/threadpool_win.cc
View file @
a5a22e9f
...
@@ -520,7 +520,6 @@ bool tp_init(void)
...
@@ -520,7 +520,6 @@ bool tp_init(void)
}
}
#endif
#endif
skip_net_wait_timeout
=
1
;
return
0
;
return
0
;
}
}
...
...
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