日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql 空闲几分钟速度变慢,MYSQL 运作一小段时间后,速度变得奇慢。而CPU基本空闲状态...

發布時間:2024/9/27 数据库 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql 空闲几分钟速度变慢,MYSQL 运作一小段时间后,速度变得奇慢。而CPU基本空闲状态... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

當前位置:我的異常網? MySQL???MYSQL 運作一小段時間后,速度變得奇慢。而CPU基本

MYSQL 運作一小段時間后,速度變得奇慢。而CPU基本空閑狀態

www.myexceptions.net??網友分享于:2015-08-26??瀏覽:11次

MYSQL 運行一小段時間后,速度變得奇慢。而CPU基本空閑狀態!

【運行環境】:

WIN 2003 + APACHE2.2 + PHP5 + MYSQL 5.1.54

【服務器配置】:雙核2.2G主頻;1.5G內存;150G硬盤

【數據庫情況】:

1. INNODB,ibdata 有30G

2. 有近2萬張表,表的字段比較少(基本上10幾個字段,最多有40個字段);

3. 大部分表的記錄數,不超過3萬條;只有個別表的記錄有百萬條的數量級。

【數據庫使用情況】:

1. 連接只有幾十個,其中,有幾個連接是后臺守護程序在用,查詢和寫入的頻率很高(類似實時系統)。

【問題描述】:

1. 在MYSQL控制臺下面,不管是什么操作(查詢/更新),都非常慢(一張1萬條記錄的用戶表,查記錄數都要幾秒~幾十秒)。而此種情況下:mysqld占用約500M內存,CPU基本上都是2%(好像不工作)。重啟MYSQL后,稍微好一點,但不一會,又開始很慢。

對比:最奇怪的是,之前的速度比較正常,mysqld 占用約500M內存,CPU占用50%,MYSQL查詢速度比較OK(都是0.0X秒)。

我是MYSQL菜鳥,請大蝦指教,是什么原因?

附:MYSQL配置:

# MySQL Server Instance Configuration File

# ----------------------------------

# Generated by the MySQL Server Instance Configuration Wizard

#

#

# Installation Instructions

# ----------------------------------

#

# On Linux you can copy this file to /etc/my.cnf to set global options,

# mysql-data-dir/my.cnf to set server-specific options

# (@localstatedir@ for this installation) or to

# ~/.my.cnf to set user-specific options.

#

# On Windows you should keep this file in the installation directory

# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To

# make sure the server reads the config file use the startup option

# "--defaults-file".

#

# To run run the server from the command line, execute this in a

# command line shell, e.g.

# mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"

#

# To install the server as a Windows service manually, execute this in a

# command line shell, e.g.

# mysqld --install MySQLXY --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"

#

# And then execute this in a command line shell to start the server, e.g.

# net start MySQLXY

#

#

# Guildlines for editing this file

# ----------------------------------

#

# In this file, you can use all long options that the program supports.

# If you want to know the options a program supports, start the program

# with the "--help" option.

#

# More detailed information about the individual options can also be

# found in the manual.

#

#

# CLIENT SECTION

# ----------------------------------

#

# The following options will be read by MySQL client applications.

# Note that only client applications shipped by MySQL are guaranteed

# to read this section. If you want your own MySQL client program to

# honor these values, you need to specify it as an option during the

# MySQL client library initialization.

#

[client]

port=3306

[mysql]

default-character-set=utf8

# SERVER SECTION

# ----------------------------------

#

# The following options will be read by the MySQL Server. Make sure that

# you have installed the server correctly (see above) so it reads this

# file.

#

[mysqld]

skip-name-resolve

# The TCP/IP Port the MySQL Server will listen on

port=3306

#Path to installation directory. All paths are usually resolved relative to this.

basedir="C:/Program Files/MySQL/MySQL Server 5.1/"

#Path to the database root

datadir="D:\Programs\MYSQL\data"

# The default character set that will be used when a new schema or table is

# created and no character set is defined

default-character-set=utf8

# The default storage engine that will be used when create new tables when

default-storage-engine=INNODB

# Replication Master Server (default)

# binary logging is required for replication

log-bin=mysql-bin

文章評論

總結

以上是生活随笔為你收集整理的mysql 空闲几分钟速度变慢,MYSQL 运作一小段时间后,速度变得奇慢。而CPU基本空闲状态...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。