bpe编码

Introduced on SQL Server 2014, the Buffer Pool Extension came to build up a new layer of cache, helping to maintain the “hot” pages accessible with less effort. With the introduction of Hekaton, the BPE has also an important role. In this article we will explore all the aspects of this new feature as well as understand how it works.

在SQL Server 2014中引入的缓冲池扩展(Buffer Pool Extension)来建立新的缓存层,从而帮助维护“热点”页面而无需花费太多精力。 随着Hekaton的引入,BPE也发挥了重要作用。 在本文中,我们将探讨此新功能的所有方面,并了解其工作原理。

With the release of SQL Server 2014, earlier this year, some new features were released, with a special remark to the In-memory OLTP (Hekaton). Together with that new feature, new challenges were brought. The available memory is, of course, one of the main challenges. More ahead, we will understand better why.

随着今年早些时候发布SQL Server 2014,发布了一些新功能,其中特别注明了内存OLTP(Hekaton)。 伴随着这一新功能,带来了新的挑战。 可用内存当然是主要挑战之一。 更进一步,我们将更好地理解原因。

Buffer Pool Extension is another new feature on SQL Server 2014. The essence behind this is simple: A file is created in a fast disk (SDD) in order to extend the Buffer Pool size – as the feature name suggests – taking advantage of a fast disk, which results in a improvement of the instance performance. This capability allows the buffer pool to retain more “buffers”, avoiding an extra paging activity. Basically, the Buffer Pool Extension will be another level of cache. Not so efficient as the memory – in the end of the day this is a SSD disk, not a RAM memory – but way better than access the disk to get the pages.

缓冲池扩展是SQL Server 2014的另一个新功能。其本质很简单:在快速磁盘(SDD)中创建文件以扩展缓冲池的大小(如功能名称所示),它利用了快速磁盘,从而提高了实例性能。 此功能允许缓冲池保留更多的“缓冲区”,从而避免了额外的分页活动。 基本上,缓冲池扩展将是另一级缓存。 效率不如内存-归根结底,这是SSD磁盘,而不是RAM存储器-但比访问磁盘获取页面要好得多。

If you quickly search on Google about Buffer Pool Extension, you will find some information, not too many results, but much of the same. On this article I will try to go more deep into this feature, showing how it works and what’s the behavior of SQL Server when you have Buffer Pool Extension enabled.

如果您在Google上快速搜索有关缓冲池扩展的信息,则会发现一些信息,而不是太多的结果,但大部分都是相同的。 在本文中,我将尝试更深入地了解此功能,展示其功能以及启用了缓冲池扩展后SQL Server的行为。

The main question that I always hear is: “For what is this used for?”. The main purpose of the Buffer Pool Extension is misunderstood as a way to give “the last chance” to that old server that we have, but is already very limited to run the current workload. This doesn’t make sense.

我经常听到的主要问题是:“这是做什么用的?”。 缓冲池扩展的主要目的被误解为一种为我们拥有的旧服务器提供“最后机会”的方法,但已经非常有限,无法运行当前的工作负载。 这没有道理。

Let’s think: If we have a server with memory limitations, it would make sense to enable the Buffer Pool Extension, in order to extend the available memory and improve the performance, right? Yes. But wait! The Buffer Pool Extension feature is… a SQL Server 2014 feature! Why would I install a SQL Server 2014 instance in an old and limited box?

让我们考虑一下:如果我们的服务器具有内存限制,那么启用缓冲池扩展是有意义的,以便扩展可用内存并提高性能,对吗? 是。 可是等等! 缓冲池扩展功能是…SQL Server 2014功能! 为什么我要在旧的受限框中安装SQL Server 2014实例?

You can do this, is up to who is architecting the infrastructure, and I believe that there are valid possibilities to this scenario. Anyway, the main idea of Buffer Pool Extension is not extend the lifetime of an old server. There’s more behind this.

您可以做到这一点,取决于谁来设计基础结构,我相信这种情况下存在有效的可能性。 无论如何,缓冲池扩展的主要思想是不延长旧服务器的寿命。 这背后还有更多。

About the Buffer Pool

关于缓冲池

Before start to dig into the Buffer Pool Extension itself, we need to understand more about the Buffer Pool purpose and how it works, in a very high level. If you already know for what the Buffer Pool is used for, you can skip this part and go to the next section.

在开始深入研究缓冲池扩展本身之前,我们需要从一个非常高的层次进一步了解缓冲池的用途及其工作原理。 如果您已经知道缓冲池的用途,则可以跳过此部分并转到下一部分。

When a SQL Server instance is started, a range of virtual addresses, in memory, is assigned to its assigned process. This range of addresses has a name: Virtual Address Space, or simply, VAS. Inside of the SQL Server VAS we can distinguish two main areas: the Buffer Pool area and the other components. But why generalize the “other components” and remark the buffer pool? Because the Buffer Pool is the main component, using most of the space in the VAS of SQL Server.

启动SQL Server实例时,会将内存中的虚拟地址范围分配给其分配的进程。 此地址范围的名称为:虚拟地址空间,或简称为VAS。 在SQL Server VAS内部,我们可以区分两个主要区域:“缓冲池”区域和其他组件。 但是,为什么要泛化“其他组件”并标记缓冲池呢? 因为缓冲池是主要组件,所以使用SQL Server的VAS中的大部分空间。

What’s the objective of the Buffer Pool? Being direct, the Buffer Pool’s role is to minimize disk access, to speed up SQL Server performance. SQL Server files are organized in 8Kb pages, and anytime a page is requested, by a SELECT query i.e., SQL Server first checks if this page (Buffer) is in the Buffer Pool, if not, it will access the disk, copy the page to the Buffer Pool and than return the page handler to the requester. Plan Cache, Lock Structures and Buffer Cache are examples of structures contained in the Buffer Pool.

缓冲池的目的是什么? 直截了当,缓冲池的作用是最小化磁盘访问,以提高SQL Server性能。 SQL Server文件以8Kb页的形式组织,并且每次通过SELECT查询请求一个页时,即SQL Server首先检查此页(缓冲区)是否在缓冲池中,如果没有,它将访问磁盘,复制该页到缓冲池,然后将页面处理程序返回给请求者。 计划缓存,锁定结构和缓冲区缓存是缓冲池中包含的结构的示例。

The reason behind all this work is because the memory access is way faster than disk access. Remember, Buffer Pool is part of SQL Server’s VAS, so it lives in the memory.

所有这些工作背后的原因是因为内存访问比磁盘访问快得多。 请记住,缓冲池是SQL Server VAS的一部分,因此它位于内存中。

Now that we understand the page flow, and the purpose of the copy from the disk to the memory, we can predict that the more pages we have in the buffer pool, the better it is for the instance’s performance. At this stage, we also find a problem: The space in memory is finite. At some point the Buffer Pool will be packed out… What happens now? SQL Server will start to free up space, by evicting pages from the Buffer Pool. Those pages are evicted based on a policy responsible to select pages to be evicted in order to free space, but still keeping in the Buffer Pool, pages that have a high probability to be requested again in a near future.

现在我们了解了页面流以及从磁盘复制到内存的目的,我们可以预测缓冲池中拥有的页面越多,实例性能就越好。 在这个阶段,我们还发现一个问题:内存中的空间是有限的。 在某个时候,缓冲池将被打包……现在发生了什么? 通过从缓冲池中逐出页面,SQL Server将开始释放空间。 根据负责选择要逐出的页面以释放空间的策略将这些页面逐出,但仍保留在缓冲池中,极有可能在不久的将来再次请求这些页面。

Size Definition

尺寸定义

The instance administrator influences in the Buffer Pool size. Sometimes I see a misconception about the Maximum and Minimum server memory settings on instance’s properties.

实例管理员会影响缓冲池的大小。 有时,我对实例属性的最大和最小服务器内存设置有误解。

Till SQL Server 2008 R2, when we define min and max server memory, we are defining precisely the size of the Buffer Pool. From SQL Server 2012 this changed. Earlier versions of SQL Server are now including the Multi-Page Allocations (MPA) and CLR Allocations into this range, which means that we need to rethink the way to define the minimum and maximum server memory settings, knowing ahead what we will host in the instance we are administering.

直到SQL Server 2008 R2,当我们定义最小和最大服务器内存时,我们才精确地定义了缓冲池的大小。 从SQL Server 2012开始,此更改。 现在,SQL Server的早期版本已将多页分配(MPA)和CLR分配包括在此范围内,这意味着我们需要重新考虑定义最小和最大服务器内存设置的方式,提前知道我们将在托管服务器中托管什么。我们正在管理的实例。

Clean vs. Dirty

清洁与肮脏

We can find two kinds of page into the Buffer Pool – Clean Pages and Dirty Pages. When a page is copied from the disk into the memory, its first state is always Clean. Once modified, it’s marked as Dirty.

我们可以在缓冲池中找到两种页面-干净页面和脏页面。 当页面从磁盘复制到内存时,其第一个状态始终为“干净”。 修改后,将其标记为“脏”。

There’s an effort to keep the less amount of Dirty pages as possible, in the buffer pool, in order to minimize data loss if a crash occurs. As the memory is volatile, SQL Server have three processes that are periodically writing dirty pages back to the disk, namely the Lazy Writing, Eager Writing and Checkpoint processes.

为了尽量减少崩溃发生时的数据丢失,我们正在努力在缓冲池中保留尽可能少的脏页。 由于内存易失,因此SQL Server具有三个进程,这些进程会定期将脏页写回到磁盘上,分别是惰性写,急切写和检查点进程。

We reviewed the role, the behavior and challenges of the Buffer Pool, we are ready to understand how Buffer Pool Extension works, but before, I will introduce another component, that makes the Buffer Pool Extension makes sense – the In-Memory technology. In the next part of this series, we will understand how In-Memory OLTP (Hekaton) works, in general, and the memory challenge that justifies the use of the Buffer Pool Extension.

我们回顾了缓冲池的作用,行为和挑战,我们准备了解缓冲池扩展的工作原理,但是在此之前,我将介绍另一个使缓冲池扩展有意义的组件–内存技术。 在本系列的下一部分中,我们将大致了解内存中OLTP(Hekaton)的工作原理,以及证明使用缓冲池扩展是合理的内存挑战。

翻译自: https://www.sqlshack.com/buffer-pool-extension-bpe-introduction-buffer-pool/

bpe编码

bpe编码_缓冲池扩展(BPE)–缓冲池简介相关推荐

  1. bpe编码_缓冲池扩展(BPE)–如何工作?

    bpe编码 You already understand the benefits of the BPE and how to deal with the feature, now it's time ...

  2. bpe编码_缓冲池扩展(BPE)–实施另一级缓存

    bpe编码 This third part of the BPE series shows the basics of Buffer Pool Extension and know how to im ...

  3. 信道编解码(2)LDPC编码_译码

    LDPC编码_译码 1 LDPC码简介 2 LDPC编译码实例 3 仿真程序 1 LDPC码简介 LDPC码即低密度奇偶校验码(Low Density Parity Check Code,LDPC), ...

  4. nlp中bpe_缓冲池扩展(BPE)–内存中OLTP:内存挑战

    nlp中bpe In continuation of the previous post "Buffer Pool Extension (BPE) – Introduction to the ...

  5. 尚医通_第1章-项目简介

    尚医通_第1章-项目简介 文章目录 尚医通_第1章-项目简介 二.业务流程 三.系统架构 一.功能简介 尚医通即为网上预约挂号系统,网上预约挂号是近年来开展的一项便民就医服务,旨在缓解看病难.挂号难的 ...

  6. 异常处理第一讲(SEH),筛选器异常,以及__asm的扩展,寄存器注入简介

    异常处理第一讲(SEH),筛选器异常,以及__asm的扩展,寄存器注入简介 参考文章: (1)异常处理第一讲(SEH),筛选器异常,以及__asm的扩展,寄存器注入简介 (2)https://www. ...

  7. 程序阅读_全面详解LTE:MATLAB建模仿真与实现_自学笔记(1)调制与编码_程序阅读

    程序阅读_全面详解LTE:MATLAB建模仿真与实现_自学笔记(1)调制与编码_程序阅读 在粗浅地掌握了LTE知识后,从今天开始对<全面详解LTE:MATLAB建模仿真与实现>一书的学习. ...

  8. 中国行政区编码_邮政编码_区号编码

    原文:中国行政区编码_邮政编码_区号编码 源代码下载地址:http://www.zuidaima.com/share/1550463699946496.htm 中国行政区编码_邮政编码_区号编码SQL ...

  9. 路面附着系数估计_无迹?扩展卡尔曼滤波(UKF EKF)

    路面附着系数估计_无迹?扩展卡尔曼滤波(UKF EKF) 软件使用:Matlab Simulink 适用场景:采用无迹 扩展卡尔曼滤波UKF进行路面附着系数估计,可实现"不变路面,对接路面和 ...

最新文章

  1. 院士论坛 | 郭毅可院士:人工智能的热望与冷思考
  2. 阿里云 centos 6.9 安装 mysql 5.7
  3. 小程序不同页面之间通讯的解决方案
  4. 目前我国家庭计算机用户接入因特网的下述,目前我国家庭计算机用户接入因特网的下述几种方法中,速度最快的是________ 。...
  5. 【java设计模式】迭代子模式
  6. 在asp.net中调用process.start执行程序
  7. dir函数_PHP dir()函数与示例
  8. 以下各节已定义,但尚未为布局页“~/Views/_LayoutHome.cshtml”呈现:“mainContent; jsSrc”。...
  9. [小雨学编程之C#] 18.1 数据类型转换,数据类型别名
  10. mysql 磁盘满_mysql磁盘满了如何恢复
  11. 【C 语言】文件操作 ( fopen 文件打开方式详解 )
  12. Android自定义录制视频
  13. Android CTS测试
  14. HttpMessageNotReadableException: Required request body is missing
  15. Linux底层IIC 总线的理解、调用函数以及常见面试问题
  16. 彻底解决Vsart无法拖拽问题!!!Win10无法拖拽问题
  17. 大数据技术——Hadoop3.X入门搭建+安装调优(1.入门)
  18. 大数据统计大量股票开盘平均价和收盘平均价
  19. 【转】Ubuntu18将Launcher(启动栏/任务栏)移到屏幕下方
  20. C++ signal() 函数

热门文章

  1. python word自动化_python操作word,自动化办公
  2. 响应式 Web 设计 - 媒体查询
  3. python学习-- django 2.1.7 ajax 请求 进阶版
  4. 是的,又一次立FLAG了
  5. Python学习笔记三(文件操作、函数)
  6. ASP 無組件上傳類
  7. 前端—每天5道面试题(1)
  8. php倒计时不停止,php – 当窗口不在焦点时停止的Javascript倒计时器
  9. es6 日期字符串转日期_小数转成百分数,日期字符串互相转换,这几个SQL问题该如何解决?...
  10. Visual Studio Code是什么