Mysql InnoDB bufferpool_MySQL
bitsCN.com
Mysql InnoDB bufferpool
今博客一位朋友找到问这个问题,上网找出以下的解释,希望能帮到他使用
问题:
发现在bufferpool用完后,insert完成后提交,select和update操作时数据如果不在bufferpool里,就需要从磁盘读,这时insert或者update操作会执行1s以上,导致那段时间的insert操作减少
innoDB在内存中维护一个缓存池用于缓存数据和索引。缓存池管理一个数据块列表,该列表又分为2个字列表,一个子列表存放new blocks,另一个子列表存放old blocks。old blocks默认占整个列表大小的3/8(可通过innodb_old_blocks_pct改变默认值,该值范围在5-95之间,这是一个百分比),其余大小为new blocks占用。
当有新数据添加到缓存池中时,如果缓存池的空间不足,则根据LRU算法清除数据。
-----重点解释
新插入缓存池的数据插入到存放old blocks的子列表的头部,如果数据被用户访问,则将这个数据移至new blocks的头部。如果设置了innodb_old_blocks_time大于0,比如innodb_old_blocks_time=1000,当新数据插入缓存池后过1s之后被访问,才会把数据移至new blocks的头部,在刚插入的一秒之内被访问改数据不会被移动,仍然在old blocks的头部。
------
www.bitsCN.com
当访问old blocks中的数据时,该数据会被移至new blocks的头部,但是当访问new blocks中的数据时,只有在该数据离new blocks的头部有一定距离时才移动。
为了更好的并发性能,通过指定innodb_buffer_pool_instances(该值取值范围为1-64)创建多个缓存池,每个缓存池的大小为
innodb_buffer_pool_size/innodb_buffer_pool_instances,通常需要保持当个缓存池的大小大于1GB。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Google Chrome is one of the most popular browsers in the world and many users prefer to use it as the default browser on their Windows PCs. Chrome offers a wide range of features that make the browsing experience enjoyable and effortless, and therefore, it remains one of the most trusted browsers. But just like any other browser, even Chrome has its own shortcomings, and it's equally prone to bugs and glitches when you need it most. One such error is Error Code 3: 0x80040154, which occurs while checking for Google Chrome updates. The error message reads "An error occurred while checking for updates. The update check failed to start (Error code 3: 0x80080005) or (Error

Starting from scratch, I will teach you step by step how to install Flask and quickly build a personal blog. As a person who likes writing, it is very important to have a personal blog. As a lightweight Python Web framework, Flask can help us quickly build a simple and fully functional personal blog. In this article, I will start from scratch and teach you step by step how to install Flask and quickly build a personal blog. Step 1: Install Python and pip Before starting, we need to install Python and pi first

Blog, also translated as web log, blog or blog, is a website that is usually managed by individuals and posts new articles from time to time. So how to set up a blog? What are the PHP blog systems? Which blogging system is best to use? Below, PHP Chinese website will summarize and share the top ten open source PHP blog systems with you. Let’s take a look!

If you are using Visual Studio Code (VSCode) and thinking about how to disable its automatic software updates and how to disable the automatic updates of its extensions, then read this article. If you don't use VSCode often, open the editor after a long period of time and want to enable automatic updates, this article will also guide you in doing so. Let us discuss in detail the different ways to enable or disable VSCode automatic updates. Table of Contents Method One: Use Settings to Enable/Disable VSCode Automatic Updates Step 1: Open VS Code and click the gear-shaped symbol in the lower left corner. Step 2: Click Settings in the list that appears. Step 3: Type update in the search bar and hit enter. Find Updates: Pattern 4

As one of the most popular short video platforms in China, Douyin has attracted a large number of users and fans. On TikTok, we often hear about fans and friends, but do you know what the difference is between TikTok fans and friends? This question will be answered in detail below. 1. What is the difference between Douyin fans and friends? On TikTok, fans are people who are interested in your content and choose to follow you. They will interact with you through likes, comments, etc. to establish a virtual connection. Friends, on the other hand, are people who know each other in real life and have real social relationships with each other. On social platforms like Douyin, the methods and depth of interactions between fans and friends may vary, but they are all important elements in building and maintaining a social network. The number of fans refers to those who follow your account

With the development of the Internet, blogs have become a platform for more and more people to share their lives, knowledge and ideas. If you also want to create a blog of your own, then this article will introduce how to use PHP and SQLite to create a simple blog. Determine the needs Before starting to create a blog, we need to determine the functions we want to achieve. For example: Create a blog post Edit a blog post Delete a blog post Display a list of blog posts Display blog post details User authentication and permission control Install PHP and SQLite We need to install PHP and S

After several pre-releases, the KDE Plasma development team unveiled version 6.0 of its desktop environment for Linux and BSD systems on 28 February, using the Qt6 framework for the first time. KDE Plasma 6.1 now comes with a number of new features t

When we use the win10 system, we sometimes encounter situations where the computer becomes stuck. Then when we check the background process, we find that a Microsoftcompatibilitytelemetry process takes up a particularly high amount of resources. So what is going on? Users can try to uninstall the third-party protection software and then try a clean boot to operate. Let this site carefully introduce to users the solution to the high CPU usage of Microsoftcompatibilitytelemetry. Solution to the high CPU usage of Microsoftcompatibilitytelemetry Method 1: Try after uninstalling the third-party protection software
