search
HomeDatabaseMysql TutorialHow do CPU resources and available memory size affect database performance?
How do CPU resources and available memory size affect database performance?Sep 18, 2018 pm 04:45 PM
cpumysqlmysql optimizationMemory managementDatabase performance optimization

What this article brings to you is about the impact of CPU resources and available memory size on database performance? It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

Preface

There are several points that may affect database performance. One of them is the server hardware, which is also the CPU and available memory discussed in this section.

Introduction

When hot data exceeds the available memory size, the MemCache storage engine cache layer is prone to failure (when a large number of cache failures occur, a large amount of network transmission is likely to occur), thus affecting the performance of the server.

When this type of I/O system bottleneck occurs, we need to upgrade the I/O subsystem to add more memory. Network and I/O resources are the second impact on the performance of our database. Hardware factors.

CPU Selection

Purchasers often ask us what parameters of CPU hardware they need to buy, etc.

I will buy the best whatever I want! But for things like cost, you can only choose one.

So, do we need frequency or quantity of CPU?

First we should know whether our application is CPU-intensive?

In fact, most of the time we have to choose better rather than more
For the current version of MYSQL, multiple CPUs are not supported for concurrent processing of the same SQL

Of course, we also have to How about the concurrency of the system? (Concurrency is at the nanosecond level)

QPS, an indicator that measures database processing capabilities: the number of SQLs processed simultaneously (here is per second)

MYSQL is currently used in a large number of Web applications , the concurrency of this type of application is also very large, so the number of CPU cores is more important than the frequency

At the same time, the version of MYSQL used must also be considered (higher versions have better support for multi-core CPUs, at least you You can safely use a 16-core or 32-core CPU)

Of course, if you want to use a multi-core CPU, you also need to use the latest version of MYSQL to achieve the best performance.

About memory

MYSQL itself is single-threaded

  • The size of memory directly affects the performance of MYSQL

  • Storing data into the cache can greatly improve the performance of the data

Commonly used MYSQL storage engine

MyISAM stores the index in memory and the data in In the operating system,
InnoDB stores indexes and data in memory at the same time, thereby improving the efficiency of database operation.

Memory configuration tips

1. Although the more memory, the better, but it is not good for performance. The impact is limited and cannot increase performance infinitely
2. Of course, excess memory can increase the performance of other services such as the operating system

Cache is beneficial to reading, and it is also beneficial to writing operations.

CPU -》Memory-》Disk

The cache can delay write operations and turn multiple writes into one write (Eg: View Counter

The above is the detailed content of How do CPU resources and available memory size affect database performance?. For more information, please follow other related articles on the PHP Chinese website!

Statement
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
核心数和线程数是什么意思核心数和线程数是什么意思Sep 01, 2022 pm 04:52 PM

核心数指的是CPU内核数量,表示一个CPU由多少个核心组成;cpu核心是CPU的重要组成部件,在内核频率、缓存大小等条件相同的情况下,CPU核心数量越多,CPU的整体性能越强。线程数是一种逻辑的概念,简单地说,就是模拟出的CPU核心数。CPU之所以要增加线程数,是源于多任务处理的需要;线程数越多,越有利于同时运行多个程序,因为线程数等同于在某个瞬间CPU能同时并行处理的任务数。

多核和单核的区别是什么多核和单核的区别是什么Aug 02, 2022 pm 02:04 PM

区别:1、单核就是CPU集成了一个运算核心,多核就是CPU集成了两个或多个运算核心;2、单核能同时运行的线程数较多核更少,不利于同时运行多个程序,而多核有利于同时运行多个程序;3、单核的执行速度较多核更慢,容易造成卡顿;4、多核的多任务处理效率比单核高;5、多核的性能比单核高,散热量、耗电量也比单核大;6、单核多用于部分要求轻薄、待机时间长、而对性能要求不高的笔记本电脑上。

12核16线程是什么意思12核16线程是什么意思Aug 24, 2022 am 11:45 AM

12核16线程指的是CPU中有12个内核,CPU的线程是16个,最多可以模拟16个核心;CPU的核心是运算器和控制器,多核可以增强并行处理能力,线程是进程中某个单一顺序的控制流,在单个程序中同时运行多个线程完成不同的工作,称为多线程。

cpu温度高是什么原因引起的cpu温度高是什么原因引起的Nov 28, 2022 am 10:25 AM

cpu温度高的原因:1、散热不良;2、机器内灰尘过多也会引起死机故障;3、内存条故障;4、CPU超频;5、 硬盘故障;6、软硬件不兼容;7、驱动程序安装有误;8、应用软件的缺陷;9、病毒感染;10、启动的程序太多;11、用非法格式或参数非法打开或释放有关程序;12、误删除了系统文件;13、CMOS设置不当。

cpu能直接存取内存储器上的数据吗cpu能直接存取内存储器上的数据吗Nov 25, 2022 pm 02:02 PM

能直接存取。内存储器又称内存,是外存与CPU进行沟通的桥梁,计算机中所有程序的运行都是在内存中进行。内存的作用是用于暂时存放CPU中的运算数据,以及与硬盘等外部存储器交换的数据。只要计算机运行,操作系统就会把需要运算的数据从内存调到CPU中进行运算;当运算完成后,CPU再将结果传送出来,内存的运行也决定了计算机的稳定运行。

cpu长期100度会烧吗cpu长期100度会烧吗Feb 20, 2023 am 11:14 AM

cpu长期100度是会烧的;cpu的温度达到100度,短时间不会烧坏,只是会影响到CPU的运算效率,但是长时间保持100度就会出现烧坏硬件的情况;发热量由CPU的功率决定,而功率又和电压成正比,因此要控制好温度就要控制好CPU的核心电压。

cpu温度过高会导致什么情况cpu温度过高会导致什么情况Feb 01, 2023 am 10:53 AM

cpu温度过高导致的影响:1、CPU有自我保护功能,CPU过高会自动开启保护系统,降低电脑运行速率,系统越来越慢,直至死机,反复重启;2、长时间高温(长时间85度以上),CPU的自我保护功能可能失效,会烧坏CPU;3、自动关机,且关机之后,温度未降低之前无法开机。

手机的cpu和gpu是什么意思手机的cpu和gpu是什么意思Nov 16, 2022 pm 02:13 PM

手机CPU指的是手机处理器,它是整台手机的控制中枢系统,也是逻辑部分的控制中心;手机CPU通过运行存储器内的软件及调用存储器内的数据库,达到控制目的。手机CPU指的是手机的图形处理器,是显示卡的大脑,它决定了该显卡的档次和大部分性能,在手机主板上,GPU芯片一般都是紧挨着CPU芯片的。

See all articles

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.