Hello,
I'm trying to get the best performance in my vps!
My vps has:
RAM guaranteed: 512MB
RAM burstable: 1024MB
I run the ./mysqltuner.pl
and I run the ./tuning-primer.sh
vi /etc/my.cnf
Can any help?!
Thank you!
I'm trying to get the best performance in my vps!
My vps has:
RAM guaranteed: 512MB
RAM burstable: 1024MB
I run the ./mysqltuner.pl
Code:
>> MySQLTuner 1.2.0 - Major Hayden <[email protected]>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.5.30-cll
[OK] Operating on 32-bit architecture with less than 2GB RAM
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 330M (Tables: 483)
[--] Data in InnoDB tables: 1008K (Tables: 54)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[OK] Total fragmented tables: 0
-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned
-------- Performance Metrics -------------------------------------------------
[--] Up for: 1d 22h 59m 29s (3M q [18.048 qps], 48K conn, TX: 21B, RX: 394M)
[--] Reads / Writes: 88% / 12%
[--] Total buffers: 248.0M global + 4.6M per thread (60 max threads)
[OK] Maximum possible memory usage: 521.8M (50% of installed RAM)
[OK] Slow queries: 0% (6K/3M)
[OK] Highest usage of available connections: 18% (11/60)
[OK] Key buffer size / total MyISAM indexes: 64.0M/47.5M
[OK] Key buffer hit rate: 98.1% (6M cached / 124K reads)
[OK] Query cache efficiency: 71.5% (1M cached / 2M selects)
[!!] Query cache prunes per day: 23492
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 60K sorts)
[!!] Joins performed without indexes: 1677
[OK] Temporary tables created on disk: 7% (7K on disk / 97K total)
[OK] Thread cache hit rate: 98% (587 created / 48K connections)
[!!] Table cache hit rate: 1% (71 open / 5K opened)
[OK] Open file limit used: 0% (1/40K)
[OK] Table locks acquired immediately: 99% (900K immediate / 900K locks)
[OK] InnoDB data size / buffer pool: 1008.0K/128.0M
-------- Recommendations -----------------------------------------------------
General recommendations:
Adjust your join queries to always utilize indexes
Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
query_cache_size (> 24M)
join_buffer_size (> 2.0M, or always use indexes with joins)
table_cache (> 20000)
Code:
-- MYSQL PERFORMANCE TUNING PRIMER --
- By: Matthew Montgomery -
MySQL Version 5.5.30-cll i686
Uptime = 1 days 23 hrs 0 min 28 sec
Avg. qps = 18
Total Questions = 3053423
Threads Connected = 3
Warning: Server has not been running for at least 48hrs.
It may not be safe to use these recommendations
To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html
Visit http://www.mysql.com/products/enterprise/advisors.html
for info about MySQL's Enterprise Monitoring and Advisory Service
SLOW QUERIES
The slow query log is enabled.
Current long_query_time = 4.000000 sec.
You have 6665 out of 3053444 that take longer than 4.000000 sec. to complete
Your long_query_time seems to be fine
BINARY UPDATE LOG
The binary update log is NOT enabled.
You will not be able to do point in time recovery
See http://dev.mysql.com/doc/refman/5.5/en/point-in-time-recovery.html
WORKER THREADS
Current thread_cache_size = 4
Current threads_cached = 3
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine
MAX CONNECTIONS
Current max_connections = 60
Current threads_connected = 3
Historic max_used_connections = 11
The number of used connections is 18% of the configured maximum.
Your max_connections variable seems to be fine.
INNODB STATUS
Current InnoDB index space = 1 M
Current InnoDB data space = 1008 K
Current InnoDB buffer pool free = 79 %
Current innodb_buffer_pool_size = 128 M
Depending on how much space your innodb indexes take up it may be safe
to increase this value to up to 2 / 3 of total system memory
MEMORY USAGE
Max Memory Ever Allocated : 282 M
Configured Max Per-thread Buffers : 273 M
Configured Max Global Buffers : 232 M
Configured Max Memory Limit : 505 M
Physical Memory : 1.00 G
Max memory limit seem to be within acceptable norms
KEY BUFFER
Current MyISAM index space = 47 M
Current key_buffer_size = 64 M
Key cache miss rate is 1 : 51
Key buffer free ratio = 88 %
Your key_buffer_size seems to be fine
QUERY CACHE
Query cache is enabled
Current query_cache_size = 24 M
Current query_cache_used = 597 K
Current query_cache_limit = 8 M
Current Query cache Memory fill ratio = 2.43 %
Current query_cache_min_res_unit = 4 K
Your query_cache_size seems to be too high.
Perhaps you can use these resources elsewhere
MySQL won't cache query results that are larger than query_cache_limit in size
SORT OPERATIONS
Current sort_buffer_size = 2 M
Current read_rnd_buffer_size = 256 K
Sort buffer seems to be fine
JOINS
Current join_buffer_size = 2.00 M
You have had 1677 queries where a join could not use an index properly
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.
If you are unable to optimize your queries you may want to increase your
join_buffer_size to accommodate larger joins in one pass.
Note! This script will still suggest raising the join_buffer_size when
ANY joins not using indexes are found.
OPEN FILES LIMIT
Current open_files_limit = 40070 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine
TABLE CACHE
Current table_open_cache = 20000 tables
Current table_definition_cache = 1024 tables
You have a total of 578 tables
You have 579 open tables.
The table_cache value seems to be fine
TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 16 M
Of 90595 temp tables, 7% were created on disk
Created disk tmp tables ratio seems fine
TABLE SCANS
Current read_buffer_size = 128 K
Current table scan ratio = 6 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 1 : 4437
You may benefit from selective use of InnoDB.
If you have long running SELECT's against MyISAM tables and perform
frequent updates consider setting 'low_priority_updates=1'
If you have a high concurrency of inserts on Dynamic row-length tables
consider setting 'concurrent_insert=ALWAYS'.
vi /etc/my.cnf
Code:
[mysqld]
innodb_file_per_table=1
open_files_limit=3376
max_connections = 60
query_cache_size=24M
query_cache_limit=8M
join_buffer_size=2M
tmp_table_size=16M
max_heap_table_size=16M
thread_cache_size=4
table_open_cache=1024
table_definition_cache=1024
log_slow_queries=/var/log/mysql/mysql-slow.log
long_query_time=4
log-queries-not-using-indexes=1
table_cache=20000
key_buffer_size=64M
Can any help?!
Thank you!