草庐IT

innodb_buffer_pool_instances

昱桑~ 2023-05-14 原文

 The number of regions that the InnoDB buffer pool is divided into. For systems with buffer pools in the multi-gigabyte range, dividing the buffer pool into separate instances can improve concurrency,by reducing contention as different threads read and write to cached pages. Each page that is stored in or read from the buffer pool is assigned to one of the buffer pool instances randomly, using a hashing function. Each buffer pool manages its own free lists, flush lists, LRUs, and all other data structures connected to a buffer pool, and is protected by its own buffer pool mutex.

InnoDB缓冲池划分的区域数。对于具有数千GB范围的缓冲池的系统,将缓冲池划分为单独的实例可以通过减少不同线程对缓存页进行读写时的争用来提高并发性。使用散列函数将存储在缓冲池中或从缓冲池读取的每个页面随机分配给其中一个缓冲池实例。每个缓冲池管理自己的空闲列表、刷新列表、LRU和连接到缓冲池的所有其他数据结构,并由自己的缓冲池互斥体保护。

This option only takes effect when setting innodb_buffer_pool_size to 1GB or more. The total
buffer pool size is divided among all the buffer pools. For best efficiency, specify a combination of
innodb_buffer_pool_instances and innodb_buffer_pool_size so that each buffer pool
instance is at least 1GB.

此选项仅在将innodb_buffer_pool_size设置为1GB或更大时生效。缓冲池的总大小在所有缓冲池之间分配。为获得最佳效率,请指定innodb_buffer_pool_instances和innodb_buffer_pool_size的组合,以便每个缓冲池实例至少为1GB。

The default value on 32-bit Windows systems depends on the value of
innodb_buffer_pool_size, as described below:

32位Windows系统上的默认值取决于 nnodb_buffer_pool_size,如下所述:

• If innodb_buffer_pool_size is greater than 1.3GB, the default for
innodb_buffer_pool_instances is innodb_buffer_pool_size/128MB, with individual
memory allocation requests for each chunk. 1.3GB was chosen as the boundary at which there is
significant risk for 32-bit Windows to be unable to allocate the contiguous address space needed
for a single buffer pool.


• Otherwise, the default is 1.

On all other platforms, the default value is 8 when innodb_buffer_pool_size is greater than or
equal to 1GB. Otherwise, the default is 1.

有关innodb_buffer_pool_instances的更多相关文章

  1. ruby-on-rails - 如何使用 instance_variable_set 正确设置实例变量? - 2

    我正在查看instance_variable_set的文档并看到给出的示例代码是这样做的:obj.instance_variable_set(:@instnc_var,"valuefortheinstancevariable")然后允许您在类的任何实例方法中以@instnc_var的形式访问该变量。我想知道为什么在@instnc_var之前需要一个冒号:。冒号有什么作用? 最佳答案 我的第一直觉是告诉你不要使用instance_variable_set除非你真的知道你用它做什么。它本质上是一种元编程工具或绕过实例变量可见性的黑客攻击

  2. ruby - 为什么在类上调用 instance_eval() 时定义类方法? - 2

    Foo=Class.newFoo.instance_evaldodefinstance_bar"instance_bar"endendputsFoo.instance_bar#=>"instance_bar"putsFoo.new.instance_bar#=>undefinedmethod‘instance_bar’我的理解是调用instance_eval在对象上应该允许您为该对象定义实例变量或方法。但是在上面的例子中,当你在类Foo上调用它来定义instance_bar方法时,instance_bar变成了一个可以用“Foo.instance_bar”调用的类方法。很明显这段代码没

  3. 带有 attr_accessor 的类上的 Ruby instance_eval - 2

    我了解instance_eval和class_eval之间的基本区别。我在玩弄时发现的是一些涉及attr_accessor的奇怪东西。这是一个例子:A=Class.newA.class_eval{attr_accessor:x}a=A.newa.x="x"a.x=>"x"#...expectedA.instance_eval{attr_accessor:y}A.y="y"=>NoMethodError:undefinedmethod`y='forA:Classa.y="y"=>"y"#WHATTT?这是怎么回事:instance_eval没有访问我们的A类(对象)然后它实际上将它添加到

  4. ruby - 模块中的 instance_eval 与 class_eval - 2

    classFooincludeModule.new{class_eval"deflab;puts'm'end"}deflabsuperputs'c'endendFoo.new.lab#=>mc======================================================================classFooincludeModule.new{instance_eval"deflab;puts'm'end"}deflabsuperputs'c'endend注意这里我把class_eval改成了instance_evalFoo.new.labresc

  5. ruby - 调用 instance_eval(&lambda) 传递当前上下文时出现错误 'wrong number of arguments' - 2

    要清楚-此代码运行完美-codewithproc但如果我将Proc.new更改为lambda,则会出现错误ArgumentError:wrongnumberofarguments(1for0)这可能是因为instance_eval想要将self作为参数传递,而lambda将其视为一种方法并且不接受未知参数?有两个例子-第一个是工作:classRuledefget_ruleProc.new{putsname}endendclassPersonattr_accessor:namedefinit_rule@name="ruby"instance_eval(&Rule.new.get_rule

  6. ruby-on-rails - Rspec 的 instance_double 创建间歇性规范失败 - 2

    我在使用instance_double时遇到间歇性测试失败。我有一个包含4个规范的文件。这是来源:require'rails_helper'describeSubmitPostdobefore(:each)do@post=instance_double('Post')allow(@post).toreceive(:submitted_at=)endcontext'onsuccess'dobefore(:each)doallow(@post).toreceive(:save).and_return(true)@result=SubmitPost.call(post:@post)endit

  7. Ruby 类实例方法 def 初始化 : instance or class method? - 2

    让我们来看一个普通的ruby​​类:classPersonattr_accessor:namedefinitializename@name=nameendendbob=Person.new("bob")我的问题是初始化的性质。事情是这样的,new显然是一个类方法,但在我看来initialize是一个实例方法(不是类),它在类方法创建的实例上调用new被调用。我有这个权利吗?或者有人可以阐明一些新的观点吗?我做了一些谷歌搜索,但找不到任何清晰度。 最佳答案 当一个新对象被初始化时(也就是说,当你在一个类上调用new时)有效调用的是这个

  8. c - (U) Ruby 扩展 : rb_gc_mark() and instance variables - 2

    我正在编写定义类的ruby​​扩展。如果我使用Data_Wrap_Struct()来实现我对rb_define_alloc_func()的回调,我是否需要手动标记和释放实例变量?还是仍然为我处理? 最佳答案 Ruby的GC将收集在您的Ruby对象的实例变量中引用的所有Ruby对象。您不必也不应该自己释放Ruby实例变量(即在您的扩展中使用rb_iv_set()/rb_iv_get()访问的任何对象)。但是,如果包装的Cstruct引用Ruby对象,那么您必须在传递给Data_Wrap_Struct()的mark回调中标记这些对象。(

  9. ruby-on-rails - `allow_any_instance_of` 模拟不在范围内工作 - 2

    我的mock只有在如下所示的beforeblock中时才有效。这只是我对我的问题的快速而肮脏的表述。从字面上看,当我将行从beforeblock移动到doesnotquack断言时,它停止模拟:(describe'Ducks',type::featuredobeforedo...allow_any_instance_of(Duck).toreceive(:quack).and_return('bark!')visitanimal_farm_pathendcontext'isanoddduck'it'doesnotquack'doexpect(Duck.new.quack).toeq('

  10. ruby - 引发异常 : use instance or class? - 2

    我见过使用类引发异常的Ruby代码:raiseGoatException,"Maximumof3goatsperbumpercar."其他代码使用实例:raiseGoatException.new"Noleotardfoundsuitableforgoat."这两个都是以同样的方式获救的。是否有理由使用实例而不是类? 最佳答案 没有区别;在任何一种情况下都会实例化异常类。如果您提供一个字符串,作为new的参数或作为raise的第二个参数,它会被传递给initialize并且将成为异常实例的.message。例如:classGoatE

随机推荐