PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > mysql.general > slow-query log analysis
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
slow-query log analysis

Réponse
 
LinkBack Outils de la discussion
Vieux 12/03/2008, 14h45   #1
Soenke Ruempler - NorthClick
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut slow-query log analysis

hi,

I've just ran into some problems analyzing the slow-query-log.

1. I have many entries like:

# Time: 080312 13:07:33
# User@Host: cms[cms] @ localhost []
# Query_time: 17 Lock_time: 0 Rows_sent: 0 Rows_examined: 0
COMMIT;
# User@Host: cms[cms] @ localhost []
# Query_time: 17 Lock_time: 0 Rows_sent: 0 Rows_examined: 0
COMMIT;
# User@Host: cms[cms] @ localhost []
# Query_time: 21 Lock_time: 0 Rows_sent: 0 Rows_examined: 0
COMMIT;
# User@Host: cms[cms] @ localhost []
# Query_time: 17 Lock_time: 0 Rows_sent: 0 Rows_examined: 0
COMMIT;
# User@Host: cms[cms] @ localhost []
# Query_time: 12 Lock_time: 0 Rows_sent: 0 Rows_examined: 0
COMMIT;
# User@Host: cms[cms] @ localhost []
# Query_time: 13 Lock_time: 0 Rows_sent: 0 Rows_examined: 0
COMMIT;

Is there any possibility to get some verbose information about those
"COMMIT"s?

2. We encountered some deadlocks with innodb transactions. After tuning
some options:

innodb_file_per_table
innodb_buffer_pool_size=2G
innodb_flush_method=O_DIRECT
innodb_flush_log_at_trx_commit=2
transaction-isolation=READ-COMMITTED
innodb_log_buffer_size = 4M

they went away, but we're still seeing slow queries that are very simple
but on tables that are often written. for example:

# Time: 080312 13:15:17
# User@Host: cms[cms] @ localhost []
# Query_time: 18 Lock_time: 0 Rows_sent: 0 Rows_examined: 0
SET timestamp=1205324117;
INSERT INTO login_try (website_id, login_tries) VALUES (96406, 1) ON
DUPLICATE KEY UPDATE login_tries = login_tries + 1;

here the table schema:

mysql> show create table login_try\G
*************************** 1. row ***************************
Table: login_try
Create Table: CREATE TABLE `login_try` (
`website_id` int(11) unsigned NOT NULL,
`login_tries` int(10) NOT NULL,
`modified` timestamp NOT NULL default CURRENT_TIMESTAMP on update
CURRENT_TIMESTAMP,
PRIMARY KEY (`website_id`),
KEY `modified` (`modified`),
CONSTRAINT `fk_logintry_1` FOREIGN KEY (`website_id`) REFERENCES
`website_config` (`basisID`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)

I assume that those slow queries occur because there's too much IO load
on the machines caused by other processes. Any hints?

Thanks,

-soenke
  Réponse avec citation
Vieux 17/03/2008, 17h59   #2
Soenke Ruempler - NorthClick
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: slow-query log analysis

hi again,

for those that are interested: the problem was indeed the filesystem
with slow lookups of BIG directories (this had nothing to do with mysql
but caused much iowait and therefore the mysql process had been heavily
impacted).


Soenke Ruempler - NorthClick wrote:
> I assume that those slow queries occur because there's too much IO load
> on the machines caused by other processes. Any hints?
> [...]


-soenke
  Réponse avec citation
Vieux 17/03/2008, 18h31   #3
Baron Schwartz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: slow-query log analysis

Hi,

On Mon, Mar 17, 2008 at 12:59 PM, Soenke Ruempler - NorthClick
<sr@northclick.de> wrote:
> hi again,
>
> for those that are interested: the problem was indeed the filesystem
> with slow lookups of BIG directories (this had nothing to do with mysql
> but caused much iowait and therefore the mysql process had been heavily
> impacted).


I'd be interested to know what filesystem you're using and how big the
directories are. When you say big, do you mean number of entries in
the directory, or space used?

Thanks
Baron
  Réponse avec citation
Vieux 17/03/2008, 19h37   #4
Soenke Ruempler - NorthClick
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: slow-query log analysis

Hi Baron,

Baron Schwartz wrote:

> I'd be interested to know what filesystem you're using and how big the
> directories are. When you say big, do you mean number of entries in
> the directory, or space used?


There were about 70k files in /tmp (caused by a mistake). the web
application on this server had many lookups to tmp and those were slowed
down.

Filesystem is ext3 with dir_index turned-on, noatime on an hardware raid1.

-soenke
  Réponse avec citation
Vieux 17/03/2008, 20h00   #5
Arthur Fuller
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: slow-query log analysis

Wow! 70k files in /tmp. Hell of a mistake I hope it doesn't happen often.
Arthur

On 3/17/08, Soenke Ruempler - NorthClick <sr@northclick.de> wrote:
>
> Hi Baron,
>
>
> There were about 70k files in /tmp (caused by a mistake). the web
> application on this server had many lookups to tmp and those were slowed
> down.
>
> -soenke
>


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 17h33.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10408 seconds with 13 queries