473,796 Members | 2,621 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MySQL server 99.99% usage

Hello,

On my LAMP webserver, I noticed that sometimes the MySQL daemon uses
99.99% of the CPU, and does not answer SQL queries, while several
minutes.
Does someone know what could be the causes ?

I searched on MySQL.com forums, and I found answers about query cache,
but this is not enabled on my server.
I looked the process list (SHOW FULL PROCESSLIST) :
- almost all the queries where "Locked"
- almost all queries where SELECT
- there was no "difficult" query (big UPDATE or big DELETE or REPAIR or
OPTIMIZE ...)
My database is mainly used with the 'members' table which contains
100000+ records, and a lot of INDEXes. All the queries shown in the
process list were about this table.

Any idea ? Any solution to prevent this periodical server lag ?

Thanks in advance for your help :)
Olivier (and excuse my bad english !)

--
Olivier Ligny
Créateur web free-lance / www.cyber-tamtam.net
Dec 1 '06 #1
2 1849
O.L. wrote:
Hello,

On my LAMP webserver, I noticed that sometimes the MySQL daemon uses
99.99% of the CPU, and does not answer SQL queries, while several
minutes.
Does someone know what could be the causes ?

I searched on MySQL.com forums, and I found answers about query cache,
but this is not enabled on my server.
I looked the process list (SHOW FULL PROCESSLIST) :
- almost all the queries where "Locked"
- almost all queries where SELECT
- there was no "difficult" query (big UPDATE or big DELETE or REPAIR or
OPTIMIZE ...)
My database is mainly used with the 'members' table which contains
100000+ records, and a lot of INDEXes. All the queries shown in the
process list were about this table.

Any idea ? Any solution to prevent this periodical server lag ?

Thanks in advance for your help :)
Olivier (and excuse my bad english !)
Hi Oliver,

You say you have a lot of indexes.
This means that the simple insert or update you mentioned must also update
all these indexes.
Could that explain the high processorload?

Remember that indexes can be usefull, but only if you do a lot more selects
with the indexed columns in the where-clause than you do inserts/updates.
Indexes slow down inserts/updates, but will greatly increase selects, so
use them wisely.

Regards,
Erwin Moller
Dec 1 '06 #2
Erwin Moller a couché sur son écran :
O.L. wrote:
>Hello,

On my LAMP webserver, I noticed that sometimes the MySQL daemon uses
99.99% of the CPU, and does not answer SQL queries, while several
minutes.
Does someone know what could be the causes ?

I searched on MySQL.com forums, and I found answers about query cache,
but this is not enabled on my server.
I looked the process list (SHOW FULL PROCESSLIST) :
- almost all the queries where "Locked"
- almost all queries where SELECT
- there was no "difficult" query (big UPDATE or big DELETE or REPAIR or
OPTIMIZE ...)
My database is mainly used with the 'members' table which contains
100000+ records, and a lot of INDEXes. All the queries shown in the
process list were about this table.

Any idea ? Any solution to prevent this periodical server lag ?

Thanks in advance for your help :)
Olivier (and excuse my bad english !)

Hi Oliver,

You say you have a lot of indexes.
This means that the simple insert or update you mentioned must also update
all these indexes.
Could that explain the high processorload?

Remember that indexes can be usefull, but only if you do a lot more selects
with the indexed columns in the where-clause than you do inserts/updates.
Indexes slow down inserts/updates, but will greatly increase selects, so
use them wisely.

Regards,
Erwin Moller
Hi Erwin, and thank you for your answer.

When I looked the process list, there was only 1 update, and about 20
or 30 SELECTs. My website mainly do SELECTs, rather than UPDATEs. The
INSERTs are rare : only 1 every minute approximatively (each time a new
member join the site). PHPMyAdmin shows me that the average query/sec
is 15 queries by second on the whole server, and I suppose it's SELECTs
at 80%.
--
Olivier Ligny
Créateur web free-lance / www.cyber-tamtam.net
Dec 1 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
449
by: Sonu K Mehrotra | last post by:
mysql server is <172.16.27.39> running on Linux 9.1 I have installed mysql control center (client GUI) on 172.16.27.252 running on Windows 2000 advanced server The machines are connected in LAN When I open the start>programs>mysql control center>mysql control center to register the server
2
1740
by: Lazy Hill Wineries | last post by:
For some reason I cannot get my MySQL server to start. It has been running fine until Friday, when we has a strange issue with the Solaris server which it is running on. The server had a few files get their chmod setting messed up and now after fixing that, MySQL won't start. Exerpt from neuro18.err: 040830 15:55:19 mysqld started 040830 15:55:19 Can't start server : UNIX Socket : Permission denied
1
3027
by: ikrabbe | last post by:
Hi, I want to set up a mysql server in an embedded process. I managed to start the server in my program as described through mysql_server_init() Now I need a client connection to this server. mysql_real_connect
3
17812
by: Pugi! | last post by:
On a freshly installed Fedora C3 (incl. webserver apache php mysql) i get the following problem when connecting to mysql through a browser (phpMyAdmin): : #2002 Can't connect to local MySQL server through socket /var/lib/mysql/mysql.sock On the website of MySQL this error is mentioned but I found no solution. In /var/log/messages the following log occurs :
1
121537
by: jiing | last post by:
Now let me describe what I have done and my purpose: Originally, I want to user ports to install phpBB But I found that phpBB doesn't support mysql 5.x (but the ports installed mySQL 5.0.0 alpha) so I deinstall mysql5-server and mysql5-client And then I install mysql41-server and mysql41-client on FreeBSD 5.3 by ports but now , mysql is not workable
16
27925
by: MLH | last post by:
Using MS Access, I have attached to MySQL servers in other states and other countries on the other side of my router. But when I use the MySQL ODBC driver 3.51 to connect to a MySQL server on my own LAN, the driver tells me it cannot make the connection. Here are the ODBC driver connection parms: Data Source Name: (free field - name my "my linux box" will do nicely) Host/Server Name (or IP) - something like MSQLUserName@ServerName.net...
1
1798
by: Dmitry Davletbaev | last post by:
Hi! I'm working on program that acts as MySQL client. After successful connection program send queries for a long time. When I stop server mysql_query return error (no surprise). But when I start server my program recieve information again without connection reinitialization. I suppose MySQL server track connections somehow but I didn't find any info about it in documentation. Can somebody point me to docs or explain this behaviour?
1
3227
by: manish deshpande | last post by:
Hi, When i'm installing MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm by the following command: rpm -i MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm the following error is being shown: warning: MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5 file /etc/my.cnf from install of MySQL-server-standard-5.0.24a-0.rhel3 conflicts with file from package mysql-3.23.58-1 file...
4
3907
by: Jerim | last post by:
I have a script on one server, trying to access the MySQL database on another server. The server with the script is on an outside network, hosted with another company. The MySQL server is here in the office;behind a firewall. Script works fine when it is on the local machine, but when I moved it to the offsite webserver it gives me: Warning: mysql_connect() : Lost connection to MySQL server during query in...
5
2638
by: scorpionbilli | last post by:
Hi, The local mysql server is running on my Macbook. I can access it through the console client: $ mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.0.45 MySQL Community Server (GPL)
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9531
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7553
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6795
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.