Thanks, the new page should rather use 8 as the default, so I've changed it there and mentioned the Windows 32-bit oddity on the other pages.

 On 06/08/2014 23:45, Jeremy Cole wrote:
Haha, this is the code in storage/innobase/handler/ha_innodb.cc:

3260 ▸       if (innobase_buffer_pool_instances == 0) {
3261 ▸       ▸       innobase_buffer_pool_instances = 8;
3262 
3263 #if defined(__WIN__) && !defined(_WIN64)
3264 ▸       ▸       if (innobase_buffer_pool_size > 1331 * 1024 * 1024) {
3265 ▸       ▸       ▸       innobase_buffer_pool_instances
3266 ▸       ▸       ▸       ▸       = ut_min(MAX_BUFFER_POOLS,
3267 ▸       ▸       ▸       ▸       ▸       (long) (innobase_buffer_pool_size
3268 ▸       ▸       ▸       ▸       ▸       / (128 * 1024 * 1024)));
3269 ▸       ▸       }
3270 #endif /* defined(__WIN__) && !defined(_WIN64) */
3271 ▸       }

So basically 0 means 8 unless you're on 32-bit Windows where it means one per 128 MiB of buffer pool, but only if the buffer pool is bigger than 1.3 GiB.

Gotta love the lack of comments.

Basically 0 is the default for the actual parameters, but it's fixed up to 8 at runtime. So the --help output will show 0 even though it will end up with 8 (or N). It's basically using 0 as a way to say "the user didn't specify, so figure it out".

Regards,

Jeremy



On Wed, Aug 6, 2014 at 2:26 PM, Daniel Bartholomew <dbart@mariadb.com> wrote:
I was chatting with some folks on IRC and someone pointed this out to me.

On the "Upgrading From MariaDB 5.5 to MariaDB 10.0" page, it says that
the new default value for innodb-buffer-pool-instances is '0':

https://mariadb.com/kb/en/upgrading-from-mariadb-55-to-mariadb-100/

And when I run the following, it says the default is indeed '0':

mysqld --no-defaults --verbose --help | grep innodb-buffer-pool-instances
...
innodb-buffer-pool-instances                               0


But when I'm in the client, I get the following:

MariaDB [(none)]> select @@innodb_buffer_pool_instances;
+--------------------------------+
| @@innodb_buffer_pool_instances |
+--------------------------------+
|                              8 |
+--------------------------------+

So when innodb-buffer-pool-instances is set to '0', does that mean the
actual value is dynamic or calculated in some way based on my other
settings?

Just trying to understand what's going on, and once I do, use it to
update the XtraDB/InnoDB buffer-pool page (which doesn't appear to
have been updated for 10.0).

https://mariadb.com/kb/en/xtradbinnodb-buffer-pool/