473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1827
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
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...
2
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...
1
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...
3
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...
1
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...
16
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...
1
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...
1
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: ...
4
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...
5
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.