diff options
author | heikki@hundin.mysql.fi <> | 2004-09-06 13:01:29 +0300 |
---|---|---|
committer | heikki@hundin.mysql.fi <> | 2004-09-06 13:01:29 +0300 |
commit | b3325a06d1a2bb35f1ae0d75758190b4cfaf8cb3 (patch) | |
tree | 597ef1f4b99d7426d8e3428af732bde46218b1e1 /innobase/srv | |
parent | ad6ad34b45ed8414eec08885334d540eafafb0fc (diff) | |
download | mariadb-git-b3325a06d1a2bb35f1ae0d75758190b4cfaf8cb3.tar.gz |
srv0start.c:
Fix bug #5414 in 4.1: srv_max_n_threads was always set to only 1000, regardless of the buffer pool size; undelr very high concurrent loads this could cause an assertion failure in sync0arr.c line 384 when we ran out of wait slots for threads; also innodb_thread_concurrency did not work, because the wait queue also there overflowed at 1000 concurrent threads; also remove redundant code
trx0undo.c:
Add a missing newline to fprints
Diffstat (limited to 'innobase/srv')
-rw-r--r-- | innobase/srv/srv0start.c | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index 4a0335086f0..8e48034e09c 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -1055,34 +1055,15 @@ innobase_start_or_create_for_mysql(void) srv_file_flush_method_str); return(DB_ERROR); } - - /* Set the maximum number of threads which can wait for a semaphore - inside InnoDB */ -#if defined(__WIN__) || defined(__NETWARE__) -/* Create less event semaphores because Win 98/ME had difficulty creating -40000 event semaphores. -Comment from Novell, Inc.: also, these just take a lot of memory on -NetWare. */ - srv_max_n_threads = 1000; -#else - if (srv_pool_size >= 8 * 1024) { - /* Here we still have srv_pool_size counted - in kilobytes, srv_boot converts the value to - pages; if buffer pool is less than 8 MB, - assume fewer threads. */ - srv_max_n_threads = 10000; - } else { - srv_max_n_threads = 1000; /* saves several MB of memory, - especially in 64-bit - computers */ - } -#endif /* Note that the call srv_boot() also changes the values of srv_pool_size etc. to the units used by InnoDB internally */ /* Set the maximum number of threads which can wait for a semaphore - inside InnoDB */ + inside InnoDB: this is the 'sync wait array' size, as well as the + maximum number of threads that can wait in the 'srv_conc array' for + their time to enter InnoDB. */ + #if defined(__WIN__) || defined(__NETWARE__) /* Create less event semaphores because Win 98/ME had difficulty creating @@ -1091,11 +1072,16 @@ Comment from Novell, Inc.: also, these just take a lot of memory on NetWare. */ srv_max_n_threads = 1000; #else - if (srv_pool_size >= 8 * 1024 * 1024) { + if (srv_pool_size >= 1000 * 1024) { /* Here we still have srv_pool_size counted - in bytes, srv_boot converts the value to - pages; if buffer pool is less than 8 MB, + in kilobytes (in 4.0 this was in bytes) + srv_boot() converts the value to + pages; if buffer pool is less than 1000 MB, assume fewer threads. */ + srv_max_n_threads = 50000; + + } else if (srv_pool_size >= 8 * 1024) { + srv_max_n_threads = 10000; } else { srv_max_n_threads = 1000; /* saves several MB of memory, @@ -1103,7 +1089,7 @@ NetWare. */ computers */ } #endif - err = srv_boot(); + err = srv_boot(); /* This changes srv_pool_size to units of a page */ if (err != DB_SUCCESS) { |