473,799 Members | 3,061 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Slow queries

I just got a new dual opteron system, with raid 01, 2gb ram, and fedora
core linux running 2.4.22-smp kernel. For some reason mysql is running
pathetically slow. Queries that should take 2ms occasionally take up to
20 seconds. It isn't every time, but almost once per page. The problem
usually occurs with queries accessing the large tables (up to 1gb), but
not always. I've tried 2 versions I compiled myself (with flags
suggested in the readme), as well as the version off the mysql website.
All were 4.0.18, and all had the problem.

Has anyone heard of this problem before, or have any idea why this might
be happening?

Timo
Jul 19 '05 #1
9 1814
Timo wrote:
I just got a new dual opteron system, with raid 01, 2gb ram, and fedora
core linux running 2.4.22-smp kernel. For some reason mysql is running
pathetically slow. Queries that should take 2ms occasionally take up to
20 seconds. It isn't every time, but almost once per page. The problem
usually occurs with queries accessing the large tables (up to 1gb), but
not always. I've tried 2 versions I compiled myself (with flags
suggested in the readme), as well as the version off the mysql website.
All were 4.0.18, and all had the problem.


Without knowing any better, that could be because you are not using
indexing, or queries that you do, don't use indexes. Data can be cached,
or it can randomly be found very quicly, but it also can take very long
time to find it.

Another possibility is that something else is using processor time.
Jul 19 '05 #2
Timo wrote:
I just got a new dual opteron system, with raid 01, 2gb ram, and fedora
core linux running 2.4.22-smp kernel. For some reason mysql is running
pathetically slow. Queries that should take 2ms occasionally take up to
20 seconds. It isn't every time, but almost once per page. The problem
usually occurs with queries accessing the large tables (up to 1gb), but
not always. I've tried 2 versions I compiled myself (with flags
suggested in the readme), as well as the version off the mysql website.
All were 4.0.18, and all had the problem.


Without knowing any better, that could be because you are not using
indexing, or queries that you do, don't use indexes. Data can be cached,
or it can randomly be found very quicly, but it also can take very long
time to find it.

Another possibility is that something else is using processor time.
Jul 19 '05 #3
Timo wrote:
I just got a new dual opteron system, with raid 01, 2gb ram, and fedora
core linux running 2.4.22-smp kernel. For some reason mysql is running
pathetically slow. Queries that should take 2ms occasionally take up to
20 seconds. It isn't every time, but almost once per page. The problem
usually occurs with queries accessing the large tables (up to 1gb), but
not always. I've tried 2 versions I compiled myself (with flags
suggested in the readme), as well as the version off the mysql website.
All were 4.0.18, and all had the problem.


Without knowing any better, that could be because you are not using
indexing, or queries that you do, don't use indexes. Data can be cached,
or it can randomly be found very quicly, but it also can take very long
time to find it.

Another possibility is that something else is using processor time.
Jul 19 '05 #4


Aggro wrote:
Timo wrote:
I just got a new dual opteron system, with raid 01, 2gb ram, and
fedora core linux running 2.4.22-smp kernel. For some reason mysql is
running pathetically slow. Queries that should take 2ms occasionally
take up to 20 seconds. It isn't every time, but almost once per page.
The problem usually occurs with queries accessing the large tables (up
to 1gb), but not always. I've tried 2 versions I compiled myself (with
flags suggested in the readme), as well as the version off the mysql
website. All were 4.0.18, and all had the problem.

Without knowing any better, that could be because you are not using
indexing, or queries that you do, don't use indexes. Data can be cached,
or it can randomly be found very quicly, but it also can take very long
time to find it.

Another possibility is that something else is using processor time.

One query repeated 100 times will take 2 milliseconds probably about 20
times, and 20 seconds about 20 times, the remaining times falling
somewhere in between, usually around the 1-10s range. On my old dual
xeon it never took more than 2ms, even with over a thousand of users
online. This test is with 1 user online. The indexes are setup properly,
so that query only examines about 70 rows of the 70000 rows in that
table. It definately isn't a problem with my queries or table structure.
Top shows NO cpu usage while this query is happening. CHECK says the
tables aren't corrupt or anything like that.

When I moved the database from the old server to the new one, I tarred
the whole directory and untarred it on the new one. It was working
perfectly then, and I haven't been able to find any indication of
corruption. All my CHECKs have passed.

So far my only guesses are that there is some incompatibility between
mysql and fedora (bad library?) or between mysql and my raid controller
driver (I don't know exact specs, but webmin reports: HPT3xx RAID 1/0
Array), or some problem with mysql and opterons. Benchmarks (bonnie++)
show that the harddrives are working at full speed. Fedora only lists a
package for mysql 3.x on the yum list, while I need 4.0.x. I'm not sure
if this is related.
Jul 19 '05 #5


Aggro wrote:
Timo wrote:
I just got a new dual opteron system, with raid 01, 2gb ram, and
fedora core linux running 2.4.22-smp kernel. For some reason mysql is
running pathetically slow. Queries that should take 2ms occasionally
take up to 20 seconds. It isn't every time, but almost once per page.
The problem usually occurs with queries accessing the large tables (up
to 1gb), but not always. I've tried 2 versions I compiled myself (with
flags suggested in the readme), as well as the version off the mysql
website. All were 4.0.18, and all had the problem.

Without knowing any better, that could be because you are not using
indexing, or queries that you do, don't use indexes. Data can be cached,
or it can randomly be found very quicly, but it also can take very long
time to find it.

Another possibility is that something else is using processor time.

One query repeated 100 times will take 2 milliseconds probably about 20
times, and 20 seconds about 20 times, the remaining times falling
somewhere in between, usually around the 1-10s range. On my old dual
xeon it never took more than 2ms, even with over a thousand of users
online. This test is with 1 user online. The indexes are setup properly,
so that query only examines about 70 rows of the 70000 rows in that
table. It definately isn't a problem with my queries or table structure.
Top shows NO cpu usage while this query is happening. CHECK says the
tables aren't corrupt or anything like that.

When I moved the database from the old server to the new one, I tarred
the whole directory and untarred it on the new one. It was working
perfectly then, and I haven't been able to find any indication of
corruption. All my CHECKs have passed.

So far my only guesses are that there is some incompatibility between
mysql and fedora (bad library?) or between mysql and my raid controller
driver (I don't know exact specs, but webmin reports: HPT3xx RAID 1/0
Array), or some problem with mysql and opterons. Benchmarks (bonnie++)
show that the harddrives are working at full speed. Fedora only lists a
package for mysql 3.x on the yum list, while I need 4.0.x. I'm not sure
if this is related.
Jul 19 '05 #6


Aggro wrote:
Timo wrote:
I just got a new dual opteron system, with raid 01, 2gb ram, and
fedora core linux running 2.4.22-smp kernel. For some reason mysql is
running pathetically slow. Queries that should take 2ms occasionally
take up to 20 seconds. It isn't every time, but almost once per page.
The problem usually occurs with queries accessing the large tables (up
to 1gb), but not always. I've tried 2 versions I compiled myself (with
flags suggested in the readme), as well as the version off the mysql
website. All were 4.0.18, and all had the problem.

Without knowing any better, that could be because you are not using
indexing, or queries that you do, don't use indexes. Data can be cached,
or it can randomly be found very quicly, but it also can take very long
time to find it.

Another possibility is that something else is using processor time.

One query repeated 100 times will take 2 milliseconds probably about 20
times, and 20 seconds about 20 times, the remaining times falling
somewhere in between, usually around the 1-10s range. On my old dual
xeon it never took more than 2ms, even with over a thousand of users
online. This test is with 1 user online. The indexes are setup properly,
so that query only examines about 70 rows of the 70000 rows in that
table. It definately isn't a problem with my queries or table structure.
Top shows NO cpu usage while this query is happening. CHECK says the
tables aren't corrupt or anything like that.

When I moved the database from the old server to the new one, I tarred
the whole directory and untarred it on the new one. It was working
perfectly then, and I haven't been able to find any indication of
corruption. All my CHECKs have passed.

So far my only guesses are that there is some incompatibility between
mysql and fedora (bad library?) or between mysql and my raid controller
driver (I don't know exact specs, but webmin reports: HPT3xx RAID 1/0
Array), or some problem with mysql and opterons. Benchmarks (bonnie++)
show that the harddrives are working at full speed. Fedora only lists a
package for mysql 3.x on the yum list, while I need 4.0.x. I'm not sure
if this is related.
Jul 19 '05 #7
Timo wrote:
So far my only guesses are that there is some incompatibility between
mysql and fedora (bad library?) or between mysql and my raid controller
driver (I don't know exact specs, but webmin reports: HPT3xx RAID 1/0
Array), or some problem with mysql and opterons. Benchmarks (bonnie++)
show that the harddrives are working at full speed. Fedora only lists a
package for mysql 3.x on the yum list, while I need 4.0.x. I'm not sure
if this is related.


I have no clue what it could be then. But you could try is it slow even
with only 200 rows or something like that, if it possible to create test
table for this purpose.

If it is slow even with that row amount, then it surely isn't about
indexes or anything similar.
Jul 19 '05 #8
Timo wrote:
So far my only guesses are that there is some incompatibility between
mysql and fedora (bad library?) or between mysql and my raid controller
driver (I don't know exact specs, but webmin reports: HPT3xx RAID 1/0
Array), or some problem with mysql and opterons. Benchmarks (bonnie++)
show that the harddrives are working at full speed. Fedora only lists a
package for mysql 3.x on the yum list, while I need 4.0.x. I'm not sure
if this is related.


I have no clue what it could be then. But you could try is it slow even
with only 200 rows or something like that, if it possible to create test
table for this purpose.

If it is slow even with that row amount, then it surely isn't about
indexes or anything similar.
Jul 19 '05 #9
Timo wrote:
So far my only guesses are that there is some incompatibility between
mysql and fedora (bad library?) or between mysql and my raid controller
driver (I don't know exact specs, but webmin reports: HPT3xx RAID 1/0
Array), or some problem with mysql and opterons. Benchmarks (bonnie++)
show that the harddrives are working at full speed. Fedora only lists a
package for mysql 3.x on the yum list, while I need 4.0.x. I'm not sure
if this is related.


I have no clue what it could be then. But you could try is it slow even
with only 200 rows or something like that, if it possible to create test
table for this purpose.

If it is slow even with that row amount, then it surely isn't about
indexes or anything similar.
Jul 19 '05 #10

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

Similar topics

2
5352
by: Tim Fountain | last post by:
We've recently enabled slow query logging on a server and it's proving interesting seeing which queries are bogging things down. This one is puzzling me a little: SELECT articleid, type, authorid, authorname, text, posted FROM comments WHERE status = 'normal' ORDER BY posted DESC LIMIT 5; The purpose of this query is to list the five most recent (non-deleted) comments. Here is the table structure:
0
486
by: Jesse Sheidlower | last post by:
I'm struggling with speed issues on some queries that I would have expected to be relatively fast. Perhaps even more frustratingly, when I've tried to break these down into their components, they still execute very slowly. I've looked over all the relevant suggestions for optimization and so forth, and there's nothing I can tell that I'm missing. An example of a query is to get all the words (the cg.cw field) in a particular...
11
17578
by: DJJ | last post by:
I am using the MySQL ODBC 3.51 driver to link three relatively small MySQL tables to a Microsoft Access 2003 database. I am finding that the data from the MySQL tables takes a hell of a long time to load making any kind linkage with my Access data virtually useless. I have the MySQL driver setup in as a USER DSN. The MySQL data is sitting out on a server and the Access database is running locally. The network connection is very...
1
1653
by: Thomas Bartkus | last post by:
Is it possible that the elapsed time being measured includes waiting for the client to acknowledge that it has received all the data? In *addition* to the server execution time? Documentation seems to *imply* that the slow query log only looks at server execution time. But, it doesn't acknowledge this directly and there seems to be a distinct connection between slow network pipes and slow queries. For example - even the simplest...
6
2104
by: lawrence k | last post by:
The following function is way too slow. If anyone has any suggestions about how to speed it up, I'd be grateful for them. We have to call this function 36 times on one page, and I think each time it takes half a second, so it adds up to maybe 18 seconds, which is a lot when you're showing software to a client. The reponse we get is "Why is it so slow?" <?php
12
3948
by: grace | last post by:
i am wondering why my database retrieval becomes too slow...we set up a new server (ubuntu, breezy badger) machine where we transferred all our files from the old server.. Our new server uses Asus p5pe-vm motherboard and an Intel Pentium D 3.0Ghz processor, compared to the old one where we uses asrock motherboard and AMD Duron. Both has the same version of mysql installed... To summarized, both machine has the same configuration except...
4
2682
by: bfoo75 | last post by:
Hi there, I'm new to this forum, but I've come here quite a bit to find solutions to problems other people have encountered... I'm currently trying to query a database up to 5000 times as fast as possible to retrieve certain pricing data for a list of companies. I've run into a few queries that seem to be taking much longer then others and ultimately slow down my function call to a point where it is no longer useful. For instance... I have...
12
3105
by: Marc Baker | last post by:
Bear with me here folks, I don't know much MS SQL performance. Wondering if someone can point me in the right direction. I have 1 particular database where queries are slow. To test this theory, I am running a SELECT COUNT(*) on some of the tables that have many rows (2-4 million rows). Example: A table with approx 3.5 million rows, a count takes over 10 mins. to run initially. If I just do a count on the indexed field, SELECT...
2
9846
by: existential.philosophy | last post by:
This is a new problem for me: I have some queries that open very slowly in design view. My benchmark query takes about 20 minutes to open in design view. That same query takes about 20 minutes to open in datasheet view. As an experiment, I deleted all rows in all tables; after that, the query took only seconds to open in both design view and datasheet view. From these facts, I conclude that Access is evaluating the query when I go to...
0
9688
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
9546
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
10491
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
10031
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9079
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
7571
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
6809
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
5467
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...
2
3762
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.