1

I have enabled my slow query log. So I saw the query which was taking some time then I did some indexing it improve and my slow query log is not being showing any more queies. But when I run this command

mysqladmin -u root -p status
Enter password:
Uptime: 9395  Threads: 2  Questions: 474976  Slow queries: 13  Opens: 99  Flush tables: 1  Open tables: 54  Queries per second avg: 50.556

It is showing me slow queries:13. What does the thread n questions means here?

Here is how I set my.cnf file.

    [mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
log-slow-queries = /var/log/mysql/mysql-slow.log
long_query_time = 2
log_warnings = 2
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
user111196
  • 1,257
  • 2
  • 13
  • 14

1 Answers1

0

It is since the last restart of the mysql service. If it is not growing then you are good

Gabor Vincze
  • 554
  • 1
  • 4
  • 11
  • ok thx I was worried I thought is the current one. What does uptime and thread tell here? The queries-per-second is how many queries process in one second also since last start is it? – user111196 Mar 10 '12 at 13:28
  • Good post about it: http://forums.mysql.com/read.php?12,86570,86570 – Gabor Vincze Mar 10 '12 at 14:52
  • thx for link. I would like to share something with you I have a java application where I create one single database connection. Then I have like 20 different threads running which all share the single connection. Will that be a good architecture or open each different connection for each thread? – user111196 Mar 10 '12 at 15:03
  • Is it likea connection pooling ? If yes, we use this for a long time and helps a lot, very performance effective solution – Gabor Vincze Mar 10 '12 at 19:10
  • no is not a connection pooling just one single connection created and being share by multiple thread but I head that is dangerous if we are using transaction is it? – user111196 Mar 11 '12 at 04:57
  • Check this nice article about transaction isolation http://www.ovaistariq.net/597/understanding-innodb-transaction-isolation-levels/ – Gabor Vincze Mar 11 '12 at 09:08
  • based on your experience do you think this single connection will pose as a dangerous mechanism in future? – user111196 Mar 11 '12 at 10:13
  • Post your my.cnf as an update to your post – Gabor Vincze Mar 11 '12 at 12:06
  • I have posted my full my.cnf. Any comments on it? – user111196 Mar 11 '12 at 18:01
  • According to your configuration, I strongly recommend to read that documentation about the transaction isolation – Gabor Vincze Mar 11 '12 at 19:22
  • I have read it but it does indicate about isolation but there is nothing about connection sharing so here is where I am lost and in a dilema which route to choose? – user111196 Mar 11 '12 at 20:05