Home Database Mysql Tutorial 合理设置内存让数据库与其他程序共存

合理设置内存让数据库与其他程序共存

Jun 07, 2016 pm 03:23 PM
wi Memory Reasonable database program set up Enter

欢迎进入Windows社区论坛,与300万技术人员互动交流 >>进入 三、多个应用程序共存时的内存分配 。 如果一台服务器上只运行了一个数据库应用程序,或者说数据库的应用比较简单、数据库内存使用量基本上不会超过最小内存数量的花,则可以采用默认多参数配置。

欢迎进入Windows社区论坛,与300万技术人员互动交流 >>进入


    三、多个应用程序共存时的内存分配

  如果一台服务器上只运行了一个数据库应用程序,或者说数据库的应用比较简单、数据库内存使用量基本上不会超过最小内存数量的花,则可以采用默认多参数配置。但是如果在同一台服务器上部署了比较多的应用程序或者数据库设计比较复杂,此时就需要对数据库的最小内存与最大内存进行配置,以实现多个应用程序能够实现和平共处。另外如果数据库本身比较简单,但是其他应用程序比较复杂,可能会占用90%以上的内存时,数据库就需要采用一定的保护措施,需要设置最小内存与最大内存,来保障自己数据库正常运行所需要的内存空间。

  1、数据库管理员需要监测内存的使用情况,并根据监测的数据来进行设置。由于采取的操作系统、部署的应用程序不同;甚至在SQL Server数据库中启用的服务不同,数据库需要使用的内存数量也是不同的。为此没有一个具体的标准说最小内存或者最大内存要配置多少。通常情况下需要数据库管理员跟踪数据库服务器一段时间,看看其内存的使用量。如笔者建议用户,数据库系统正是投入使用后,在头一年内需要每个月观测一下内存的使用情况。由于头几个月可能使用的不稳定,所得到的数据参考价值不大。而从第六个月开始到第12个月近八个月数据库内存的使用情况来看,基本上可以得出一个最小内存与最大内存的合理范围。然后数据库管理员就可以来对内存的最大最小值来进行设置。以后若前台应用程序做了新的调整或者数据库中采用了新的功能,仍然需要对内存的使用情况进行监测,来确定一个合理的内存使用范围。一般来说,最好把最小内存设置的小一点,而把最大内存的花设置的大一点。如此的话,可以让数据库引擎在管理内存的时候有比较大的灵活性。然后再进行后续监测的数据来进行相应的调整,慢慢的把内存配置调整到最优。根据笔者的经验,要达到合理的内存配置之前,往往需要一个比较漫长的时间。不过这对于数据库性能优化来说,可能这个过程也不是很长。

  2、要分析数据库系统内存的使用大户,跟其他应用程序的内存使用高峰分流。数据库中函数、过程、复杂的视图、备份等作业都会用到比较可观的内存。如企业如果在SQL SERVER数据库上面部署了ERP系统,而系统中有一个“库存采购”作业,这个需要用到比较复杂的业务逻辑,需要考虑到库存、安全库存、包装数量等等比较复杂的计算。为此最好能够把这个作业放到服务器比较空的时候运行,以跟其他应用程序错开运行。如在应用程序设计的时候,可以把这个作业放在后台运行,并让其在晚上12点运行。然后在第二天早上之前出来结果。另外每个应用程序都需要对自己的数据进行备份,以防不时之需。而备份程序往往也需要用到比较多的内存。为此最好能够把各种应用程序的备份作业错开来运行。如此的话可以减少应用程序之间内存的占用。

  四、数据库内存分配的特殊情况。

  如果在同一个服务器上部署多个应用程序的话,内存的争用是在所难免的。为此数据库管理员往往需要为数据库分配合适的内存参数,保证数据库即能够满足其日常运行的需要,又尽量减少对其他应用程序的不良影响。在参数配置的过程中,除了需要考虑如上几个建议之外,还需要注意数据库内存分配中的特殊情况。

  如果把最小内存与最大内存的值设置为相同,那么会产生什么情况呢?如果把它们设置为相同的值,则一旦分配给数据库引擎的内存达到这个值的话,则数据库引擎将停止为缓冲池动态释放和获取内存。也就是说,此时数据库内存的分配就是固定的,不会根据数据库引擎的负荷来动态的获取或者释放。显然对于生成用的服务器来说,这并不是一个很好的配置。但是在一些特殊的应用下,却可以起到比较不错的效果。如需要测试数据库某个作业与内存之间的关系,那么就有可能需要把它们的值配置为相同。另外如果服务器中只运行了数据库应用程序,那就有可能需要把这两个参数设置的比较高,以减少数据库内存释放与获取时所发生的额外开销等等。

  另外数据库运行过程中的某些作业是不受这个最大内存的限制的。如数据库中的进程可能会得到超过最大内存选项所指定的内存;数据库的一些外部组建也可以得到缓冲池以外的内存。不过在大部分情况下,数据库运行还是受到这个缓冲池内存的限制的。所以说在内存参数设置的时候,最好能够留有一定的余地。

 

  [1] [2] 

合理设置内存让数据库与其他程序共存

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Large memory optimization, what should I do if the computer upgrades to 16g/32g memory speed and there is no change? Large memory optimization, what should I do if the computer upgrades to 16g/32g memory speed and there is no change? Jun 18, 2024 pm 06:51 PM

For mechanical hard drives or SATA solid-state drives, you will feel the increase in software running speed. If it is an NVME hard drive, you may not feel it. 1. Import the registry into the desktop and create a new text document, copy and paste the following content, save it as 1.reg, then right-click to merge and restart the computer. WindowsRegistryEditorVersion5.00[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager\MemoryManagement]"DisablePagingExecutive"=d

Sources say Samsung Electronics and SK Hynix will commercialize stacked mobile memory after 2026 Sources say Samsung Electronics and SK Hynix will commercialize stacked mobile memory after 2026 Sep 03, 2024 pm 02:15 PM

According to news from this website on September 3, Korean media etnews reported yesterday (local time) that Samsung Electronics and SK Hynix’s “HBM-like” stacked structure mobile memory products will be commercialized after 2026. Sources said that the two Korean memory giants regard stacked mobile memory as an important source of future revenue and plan to expand "HBM-like memory" to smartphones, tablets and laptops to provide power for end-side AI. According to previous reports on this site, Samsung Electronics’ product is called LPWide I/O memory, and SK Hynix calls this technology VFO. The two companies have used roughly the same technical route, which is to combine fan-out packaging and vertical channels. Samsung Electronics’ LPWide I/O memory has a bit width of 512

Kingbang launches new DDR5 8600 memory, offering CAMM2, LPCAMM2 and regular models to choose from Kingbang launches new DDR5 8600 memory, offering CAMM2, LPCAMM2 and regular models to choose from Jun 08, 2024 pm 01:35 PM

According to news from this site on June 7, GEIL launched its latest DDR5 solution at the 2024 Taipei International Computer Show, and provided SO-DIMM, CUDIMM, CSODIMM, CAMM2 and LPCAMM2 versions to choose from. ▲Picture source: Wccftech As shown in the picture, the CAMM2/LPCAMM2 memory exhibited by Jinbang adopts a very compact design, can provide a maximum capacity of 128GB, and a speed of up to 8533MT/s. Some of these products can even be stable on the AMDAM5 platform Overclocked to 9000MT/s without any auxiliary cooling. According to reports, Jinbang’s 2024 Polaris RGBDDR5 series memory can provide up to 8400

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

DDR5 MRDIMM and LPDDR6 CAMM memory specifications are ready for launch, JEDEC releases key technical details DDR5 MRDIMM and LPDDR6 CAMM memory specifications are ready for launch, JEDEC releases key technical details Jul 23, 2024 pm 02:25 PM

According to news from this website on July 23, the JEDEC Solid State Technology Association, the microelectronics standard setter, announced on the 22nd local time that the DDR5MRDIMM and LPDDR6CAMM memory technical specifications will be officially launched soon, and introduced the key details of these two memories. The "MR" in DDR5MRDIMM stands for MultiplexedRank, which means that the memory supports two or more Ranks and can combine and transmit multiple data signals on a single channel without additional physical The connection can effectively increase the bandwidth. JEDEC has planned multiple generations of DDR5MRDIMM memory, with the goal of eventually increasing its bandwidth to 12.8Gbps, compared with the current 6.4Gbps of DDR5RDIMM memory.

Lexar God of War Wings ARES RGB DDR5 8000 Memory Picture Gallery: Colorful White Wings supports RGB Lexar God of War Wings ARES RGB DDR5 8000 Memory Picture Gallery: Colorful White Wings supports RGB Jun 25, 2024 pm 01:51 PM

When the prices of ultra-high-frequency flagship memories such as 7600MT/s and 8000MT/s are generally high, Lexar has taken action. They have launched a new memory series called Ares Wings ARES RGB DDR5, with 7600 C36 and 8000 C38 is available in two specifications. The 16GB*2 sets are priced at 1,299 yuan and 1,499 yuan respectively, which is very cost-effective. This site has obtained the 8000 C38 version of Wings of War, and will bring you its unboxing pictures. The packaging of Lexar Wings ARES RGB DDR5 memory is well designed, using eye-catching black and red color schemes with colorful printing. There is an exclusive &quo in the upper left corner of the packaging.

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

Longsys displays FORESEE LPCAMM2 notebook memory: up to 64GB, 7500MT/s Longsys displays FORESEE LPCAMM2 notebook memory: up to 64GB, 7500MT/s Jun 05, 2024 pm 02:22 PM

According to news from this website on May 16, Longsys, the parent company of the Lexar brand, announced that it will demonstrate a new form of memory - FORESEELPCAMM2 at CFMS2024. FORESEELPCAMM2 is equipped with LPDDR5/5x particles, is compatible with 315ball and 496ball designs, supports frequencies of 7500MT/s and above, and has product capacity options of 16GB, 32GB, and 64GB. In terms of product technology, FORESEELPCAMM2 adopts a new design architecture to directly package 4 x32LPDDR5/5x memory particles on the compression connector, realizing a 128-bit memory bus on a single memory module, providing a more efficient packaging than standard memory modules.

See all articles