summaryrefslogtreecommitdiff
path: root/sql/threadpool_generic.cc
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-24341 Innodb - do not block in foreground thread in log_write_up_to(Vladislav Vaintroub2021-02-141-1/+4
|
* Merge branch '10.5' into 10.6Oleksandr Byelkin2020-09-021-0/+11
|\
| * Merge 10.4 into 10.5Marko Mäkelä2020-08-141-0/+11
| |\
| | * Merge 10.3 into 10.4, except MDEV-22543Marko Mäkelä2020-08-131-0/+11
| | |\ | | | | | | | | | | | | Also, fix GCC -Og -Wmaybe-uninitialized in run_backup_stage()
| | | * Merge 10.2 into 10.3Marko Mäkelä2020-08-131-0/+11
| | | |\
| | | | * MDEV-23378 - fix an alleged memory "leak" in threadpool.Vladislav Vaintroub2020-08-101-0/+11
| | | | | | | | | | | | | | | | | | | | Implement a workaround to shut the "memory not freed" message.
* | | | | Merge 10.5 into 10.6Marko Mäkelä2020-08-041-6/+16
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.4 into 10.5Marko Mäkelä2020-08-011-6/+16
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.3 into 10.4Marko Mäkelä2020-07-311-6/+16
| | |\ \ \ | | | |/ /
| | | * | MDEV-21101 unexpected wait_timeout with pool-of-threadsVladislav Vaintroub2020-07-301-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to restricted size of the threadpool, execution of client queries can be delayed (queued) for a while. This delay was interpreted as client inactivity, and connection is closed, if client idle time + queue time exceeds wait_timeout. But users did not expect queue time to be included into wait_timeout. This patch changes the behavior. We don't close connection anymore, if there is some unread data present on connection, even if wait_timeout is exceeded. Unread data means that client was not idle, it sent a query, which we did not have time to process yet.
* | | | | Merge branch '10.5' into 10.6Vladislav Vaintroub2020-07-041-204/+241
|\ \ \ \ \ | |/ / / /
| * | | | Remove some trailing whitespaces.Vladislav Vaintroub2020-05-291-191/+184
| | | | |
| * | | | MDEV-22696 TP_pool_generic::set_pool_size logic so that it marks each ↵Vladislav Vaintroub2020-05-251-10/+32
| | | | | | | | | | | | | | | | | | | | connection to change group before the next socket read.
| * | | | Threadpool - support changing group on Windows with generic thread poolVladislav Vaintroub2020-05-251-5/+30
| | | | |
* | | | | MDEV-22990 Threadpool : Optimize network/named pipe IO for WindowsVladislav Vaintroub2020-06-261-40/+29
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reduces the overhead of system calls prior to a query, for threadpool. Previously, 3 system calls were done 1. WSARecv() to get notification of input data from client, asynchronous equivalent of select() in one-thread-per-connection 2. recv(4 bytes) - reading packet header length 3. recv(packet payload) Now there will be usually, just WSARecv(), which pre-reads user data into a buffer, so we spared 2 syscalls Profiler shows the most expensive call WSARecv(16%CPU) becomes 4% CPU, after the patch, benchmark results (network heavy ones like point-select) improve by ~20% The buffer management was rather carefully done to keep buffers together, as Windows would keeps the pages pinned in memory for the duration of async calls. At most 1MB memory is used for the buffers, and overhead per-connection is only 256 bytes, which should cover most of the uses. SSL does not yet use the optmization, so far it does not properly use VIO for reads and writes. Neither one-thread-per-connection would get any benefit, but that should be fine, it is not even default on Windows.
* | | | Merge 10.4 into 10.5Marko Mäkelä2020-03-301-13/+18
|\ \ \ \ | |/ / /
| * | | num_worker_threads my_atomic to Atomic_counterSergey Vojtovich2020-03-271-2/+2
| | | |
| * | | shutdown_group_count my_atomic to Atomic_counterSergey Vojtovich2020-03-271-2/+2
| | | |
| * | | next_timeout_check my_atomic to std::atomicSergey Vojtovich2020-03-271-9/+14
| | | |
* | | | MDEV-20372 thread_pool_info fails randomly in 10.5Vladislav Vaintroub2020-03-281-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | Rework stats a bit, so we're not missing any queue_get() now. Don't do stats_reset_table(), if generic threadpool is off.
* | | | perfschema memory related instrumentation changesSergei Golubchik2020-03-101-1/+2
| | | |
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-12-271-1/+1
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2019-12-271-1/+1
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2019-12-271-1/+1
| | |\ \ | | | |/
| | | * MDEV-21343 Threadpool/Unix- wait_begin() function does not wake/create ↵Vladislav Vaintroub2019-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | threads, when it should Fixed the condition for waking up/creating another thread. If there is some work to do (if the request queue is not empty), a thread should be woken or created. The condition was incorrect since 18c9b345b43b62b7c4dbac8ce0289c1c8103c2d1
* | | | MDEV-19312 Make throttling interval depend on thread_pool_stall_limitVladislav Vaintroub2019-05-311-9/+11
| | | | | | | | | | | | | | | | | | | | A thread_pool_stall_limit which is smaller than default would result in quicker creation of threads.
* | | | Add some variables to the generic threadpool, that could help to analyzeVladislav Vaintroub2019-05-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | stalls etc better. - thread_pool_exact_stats - uses high precision timestamp for the time when connection was added to the queue. This timestamp helps calculating queuing time shown in I_S.THREADPOOL_QUEUES entries. - If thread_pool_dedicated_listener is on, then each group will have its own dedicated listener, that does not convert to worker. With this variable on, the queueing time in I_S.THREADPOOL_QUEUES , and actual queue size in I_S.THREADPOOOL_GROUPS will be more exact, since IO request are immediately dequeued from poll, without delay. Part of MDEV-19313.
* | | | MDEV-19313 Threadpool : provide information schema tables for internals of ↵Vladislav Vaintroub2019-05-261-140/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | generic threadpool Added thread_pool_groups, thread_pool_queues, thread_pool_waits and thread_pool_stats tables to information_schema.
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-05-231-1/+1
|\ \ \ \ | |/ / /
| * | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-1/+1
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
| | |\ \ | | | |/
| | | * Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
| | | |
* | | | Moved vio allocation to connection threadSergey Vojtovich2019-05-211-5/+4
|/ / / | | | | | | | | | Part of MDEV-19515 - Improve connect speed
* | | Move THD list handling to THD_listSergey Vojtovich2019-01-281-32/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented and integrated THD_list as a replacement for the global thread list. It uses own mutex instead of LOCK_thread_count for THD list protection. Removed unused first_global_thread() and next_global_thread(). delayed_insert_threads is now protected by LOCK_delayed_insert. Although this patch doesn't fix very wrong synchronization of this variable. After this patch there are only 2 legitimate uses of LOCK_thread_count left, both in mysqld.cc: thread_count and ready_to_exit. Aim is to reduce usage of LOCK_thread_count and COND_thread_count. Part of MDEV-15135.
* | | Removed \n from sql_print_error()Monty2019-01-261-1/+1
|/ /
* | Make possible to use clang on Windows (clang-cl)Vladislav Vaintroub2018-02-201-4/+4
| | | | | | | | | | | | -DWITH_ASAN can be used as well now, on x64 Fix many clang-cl warnings.
* | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-02-151-2/+1
|\ \ | |/
| * threadpool: release mutex on io_poll_create failureDaniel Black2018-01-311-2/+1
| | | | | | | | Also use the group pointer previously allocated.
* | Cleanup - removed warning suppression - no longer needed.Vladislav Vaintroub2018-02-071-3/+0
| |
* | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-11-301-52/+77
|\ \ | |/
| * Windows, generic threadpool cleanupsVladislav Vaintroub2017-11-281-52/+77
| | | | | | | | | | | | | | | | - get rid of casts between int and HANDLE. - store file descriptor in TP_connection_generic to get rid of multiple mysql_socket_getfd(c->thd->net.vio->mysql_socket)) Also support named pipes (no reason not to support, since it is easy)
* | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-10-041-5/+8
|\ \ | |/
| * MDEV-13384 - misc Windows warnings fixedVladislav Vaintroub2017-09-281-3/+6
| |
| * MDEV-13844 : Fix Windows warnings. Fix DBUG_PRINT.Vladislav Vaintroub2017-09-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | - Fix win64 pointer truncation warnings (usually coming from misusing 0x%lx and long cast in DBUG) - Also fix printf-format warnings Make the above mentioned warnings fatal. - fix pthread_join on Windows to set return value.
* | Enusure that my_global.h is included firstMichael Widenius2017-08-241-1/+1
|/ | | | | | | | | | - Added sql/mariadb.h file that should be included first by files in sql directory, if sql_plugin.h is not used (sql_plugin.h adds SHOW variables that must be done before my_global.h is included) - Removed a lot of include my_global.h from include files - Removed include's of some files that my_global.h automatically includes - Removed duplicated include's of my_sys.h - Replaced include my_config.h with my_global.h
* Merge branch '10.1' into 10.2Sergei Golubchik2017-03-301-1/+1
|
* MDEV-10297 Add priorization to threadpoolVladislav Vaintroub2016-09-221-0/+1769
Also MDEV-10385 Threadpool refactoring