Mysqltuner

General Discussion of atomic repo and development projects.

Ask for help here with anything else not covered by other forums.
DarkF@der
Forum Regular
Forum Regular
Posts: 313
Joined: Thu May 07, 2009 12:46 pm

Mysqltuner

Unread post by DarkF@der »

Hello,

Maybe can someone help me this
I have a dedicated machine 2 x quad cores prossesors and 16 gig ram

If i run mysqltuner i got this output:

Code: Select all

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.1.58
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 708M (Tables: 8469)
[--] Data in InnoDB tables: 240M (Tables: 5749)
[--] Data in MEMORY tables: 124K (Tables: 211)
[!!] Total fragmented tables: 6067

-------- Security Recommendations  -------------------------------------------
[OK] All database users have passwords assigned

-------- Performance Metrics -------------------------------------------------
[--] Up for: 8h 27m 36s (1M q [63.608 qps], 44K conn, TX: 2B, RX: 375M)
[--] Reads / Writes: 87% / 13%
[--] Total buffers: 34.0M global + 2.7M per thread (151 max threads)
[OK] Maximum possible memory usage: 449.2M (2% of installed RAM)
[OK] Slow queries: 0% (0/1M)
[OK] Highest usage of available connections: 9% (14/151)
[OK] Key buffer size / total MyISAM indexes: 8.0M/271.1M
[OK] Key buffer hit rate: 99.8% (535M cached / 855K reads)
[!!] Query cache is disabled
[OK] Sorts requiring temporary tables: 0% (391 temp sorts / 197K sorts)
[!!] Joins performed without indexes: 11585
[OK] Temporary tables created on disk: 19% (27K on disk / 142K total)
[!!] Thread cache is disabled
[!!] Table cache hit rate: 0% (64 open / 261K opened)
[OK] Open file limit used: 7% (75/1K)
[OK] Table locks acquired immediately: 99% (2M immediate / 2M locks)
[!!] InnoDB data size / buffer pool: 240.0M/8.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    Enable the slow query log to troubleshoot bad queries
    Adjust your join queries to always utilize indexes
    Set thread_cache_size to 4 as a starting value
    Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
    query_cache_size (>= 8M)
    join_buffer_size (> 128.0K, or always use indexes with joins)
    thread_cache_size (start at 4)
    table_cache (> 64)
    innodb_buffer_pool_size (>= 240M)

and /etc/my.cnf :

Code: Select all

[mysqld]
local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# 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


query_cache_size = 512M
query_cache_type = 1
query_cache_limit = 1M
query_cache_min_res_unit=2K
max_heap_table_size=128M
thread_cache_size=100
thread_concurrency=16
join_buffer_size=500K
sort_buffer_size=500K
table_cache=5000
tmp_table_size=32M
innodb_buffer_pool_size=12G

log-slow-queries = /var/log/mysql/mysql-slow.log

I tryed to play with it but don't get it working or get the right settings.

Somebody advice?
Or a good example?

Thanx in advanced
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: Mysqltuner

Unread post by faris »

Well, the key thing is to optimize the tables as it suggests, and to enable query cacheing.

Are the things you list in my.cnf newly added, or how they were at the time you ran mysqltuner to produce the report?

innodb_buffer_pool_size=12G seems really really wrong to me. Maybe start with 240M like mysqltuner suggests.
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
DarkF@der
Forum Regular
Forum Regular
Posts: 313
Joined: Thu May 07, 2009 12:46 pm

Re: Mysqltuner

Unread post by DarkF@der »

these rules i have set and allready run a couple of days only i rebooted the server today ( 8 hours ago )

how to enable cache qeury?
paulie
Forum User
Forum User
Posts: 76
Joined: Tue Apr 20, 2010 2:49 am

Re: Mysqltuner

Unread post by paulie »

Hi,

Your config changes are not being picked up as they are in the [mysqld_safe] section of the configuration file. You need to move them all up into the [mysqld] section.

Currently you're running on MySQL defaults (8MB Innodb buffer pool and no query cache are a dead giveaway).

As to your values vs the tuner recommendations vs whats right, whats the server for?

Paul
DarkF@der
Forum Regular
Forum Regular
Posts: 313
Joined: Thu May 07, 2009 12:46 pm

Re: Mysqltuner

Unread post by DarkF@der »

The server is for hosting
paulie
Forum User
Forum User
Posts: 76
Joined: Tue Apr 20, 2010 2:49 am

Re: Mysqltuner

Unread post by paulie »

Its a single server setup then? Plesk, Apache, MySQL, Bind, Mail all running from it? Or are some components separated out?

Since you want such a high InnoDB buffer pool are you using it for hosting a specific application?
DarkF@der
Forum Regular
Forum Regular
Posts: 313
Joined: Thu May 07, 2009 12:46 pm

Re: Mysqltuner

Unread post by DarkF@der »

yes it's a Its a single server setup Plesk, Apache, MySQL, Bind, Mail all running from it and installatron
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: Mysqltuner

Unread post by faris »

paulie wrote: Your config changes are not being picked up as they are in the [mysqld_safe] section of the configuration file. You need to move them all up into the [mysqld] section.
Hah! I didn't spot that!

But DarkF@der - that 12G has to get changed to something more sensible, I think.
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
Post Reply