Breuchte mal Hilfe bei mysql =)

Alles, was MariaDB und MySQL betrifft, kann hier besprochen werden.

Breuchte mal Hilfe bei mysql =)

Postby Tyjo » 21. October 2009 16:27

Hallo zusammen... wie ihr seht bin ich noch Neu hier aber bisher konnte mir noch niemand in anderen Foren so wirklich helfen...
breuchte am besten ne fertig optimierte config für mysql aber irgendwie wissen in den anderen Foren nichtmals was mein Problem ist=)

Also ich fang mal an... Wir betreiben mehrere Gameserver für Trackmania...
Dort wird ein programm namens Aseco verwendet damit werden alle Rekorde etc in mysql abgespeichert und es spielen durchschnittlich ca 150man auf den servern
"Aseco" verwendet unter anderem php dateien und somit halt viel mit mysql...

Eckdaten: AMD 2.6 ghz , 2gb ddr2 ram

Also hier einmal meine ausgabe aus der tuning-primer.sh

Code: Select all
        -- MYSQL PERFORMANCE TUNING PRIMER --
             - By: Matthew Montgomery -

MySQL Version 5.0.51a-24+lenny2 x86_64

./tuning-primer.sh: line 407: bc: command not found
./tuning-primer.sh: line 408: bc: command not found
./tuning-primer.sh: line 409: bc: command not found
./tuning-primer.sh: line 410: bc: command not found
./tuning-primer.sh: line 411: bc: command not found
./tuning-primer.sh: line 412: bc: command not found
Uptime =  days  hrs  min  sec
Avg. qps = 21
Total Questions = 2915646
Threads Connected = 8

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.0/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 NOT enabled.
Current long_query_time = 10 sec.
You have 0 out of 2915667 that take longer than 10 sec. to complete
Your long_query_time may be too high, I typically set this under 5 sec.

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.0/en/point-in-time-recovery.html

WORKER THREADS
Current thread_cache_size = 8
Current threads_cached = 1
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 100
Current threads_connected = 8
Historic max_used_connections = 9
The number of used connections is 9% of the configured maximum.
You are using less than 10% of your configured max_connections.
Lowering max_connections could help to avoid an over-allocation of memory
See "MEMORY USAGE" section to make sure you are not over-allocating

MEMORY USAGE
./tuning-primer.sh: line 1226: bc: command not found
./tuning-primer.sh: line 1227: bc: command not found
./tuning-primer.sh: line 1251: bc: command not found
./tuning-primer.sh: line 1254: bc: command not found
./tuning-primer.sh: line 1255: bc: command not found
./tuning-primer.sh: line 1257: bc: command not found
./tuning-primer.sh: line 1259: [: -gt: unary operator expected
./tuning-primer.sh: line 369: [: max_memoryHR: integer expression expected
./tuning-primer.sh: line 375: [: max_memoryHR: integer expression expected
./tuning-primer.sh: line 381: [: max_memoryHR: integer expression expected
./tuning-primer.sh: line 388: export: `=max_memoryHR': not a valid identifier
Max Memory Ever Allocated :  bytes
./tuning-primer.sh: line 369: [: per_thread_buffersHR: integer expression expected
./tuning-primer.sh: line 375: [: per_thread_buffersHR: integer expression expected
./tuning-primer.sh: line 381: [: per_thread_buffersHR: integer expression expected
./tuning-primer.sh: line 388: export: `=per_thread_buffersHR': not a valid identifier
Configured Max Per-thread Buffers :  bytes
./tuning-primer.sh: line 369: [: global_buffersHR: integer expression expected
./tuning-primer.sh: line 375: [: global_buffersHR: integer expression expected
./tuning-primer.sh: line 381: [: global_buffersHR: integer expression expected
./tuning-primer.sh: line 388: export: `=global_buffersHR': not a valid identifier
Configured Max Global Buffers :  bytes
./tuning-primer.sh: line 369: [: total_memoryHR: integer expression expected
./tuning-primer.sh: line 375: [: total_memoryHR: integer expression expected
./tuning-primer.sh: line 381: [: total_memoryHR: integer expression expected
./tuning-primer.sh: line 388: export: `=total_memoryHR': not a valid identifier
Configured Max Memory Limit :  bytes
./tuning-primer.sh: line 350: bc: command not found
Physical Memory :  G
Max memory limit seem to be within acceptable norms

KEY BUFFER
./tuning-primer.sh: line 668: bc: command not found
./tuning-primer.sh: line 669: bc: command not found
./tuning-primer.sh: line 350: bc: command not found
Current MyISAM index space =  M
./tuning-primer.sh: line 350: bc: command not found
Current key_buffer_size =  M
Key cache miss rate is 1 : 3700
Key buffer free ratio =  %
./tuning-primer.sh: line 706: [: -le: unary operator expected
./tuning-primer.sh: line 710: [: -le: unary operator expected
Your key_buffer_size seems to be fine

QUERY CACHE
./tuning-primer.sh: line 741: bc: command not found
./tuning-primer.sh: line 742: bc: command not found
Query cache is enabled
./tuning-primer.sh: line 350: bc: command not found
Current query_cache_size =  M
./tuning-primer.sh: line 350: bc: command not found
Current query_cache_used =  M
./tuning-primer.sh: line 350: bc: command not found
Current query_cache_limit =  M
Current Query cache Memory fill ratio =  %
./tuning-primer.sh: line 350: bc: command not found
Current query_cache_min_res_unit =  K
./tuning-primer.sh: line 755: bc: command not found
./tuning-primer.sh: line 756: bc: command not found
./tuning-primer.sh: line 757: [: -gt: unary operator expected
./tuning-primer.sh: line 764: [: -le: unary operator expected
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
./tuning-primer.sh: line 350: bc: command not found
Current sort_buffer_size =  M
./tuning-primer.sh: line 350: bc: command not found
Current read_rnd_buffer_size =  K
Sort buffer seems to be fine

JOINS
./tuning-primer.sh: line 350: bc: command not found
Current join_buffer_size =  K
You have had 34080 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 = 1024 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_cache value = 64 tables
You have a total of 266 tables
You have 64 open tables.
Current table_cache hit rate is 2%, while 100% of your table cache is in use
You should probably increase your table_cache

TEMP TABLES
./tuning-primer.sh: line 350: bc: command not found
Current max_heap_table_size =  M
./tuning-primer.sh: line 350: bc: command not found
Current tmp_table_size =  M
Of 4733 temp tables, 27% were created on disk
Effective in-memory tmp_table_size is limited to max_heap_table_size.
Perhaps you should increase your tmp_table_size and/or max_heap_table_size
to reduce the number of disk-based temporary tables
Note! BLOB and TEXT columns are not allow in memory tables.
If you are using these columns raising these values might not impact your
ratio of on disk temp tables.

TABLE SCANS
./tuning-primer.sh: line 350: bc: command not found
Current read_buffer_size =  K
Current table scan ratio = 22165 : 1
You have a high ratio of sequential access requests to SELECTs
You may benefit from raising read_buffer_size and/or improving your use of indexes.

TABLE LOCKING
Current Lock Wait ratio = 1 : 2010
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=2'.


Verstehen tuh ich da nicht viel raus vorallem sehr oft "command not found"

Und hier mal meine my.cnf

Code: Select all
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket          = /var/run/mysqld/mysqld.sock
nice            = 0

[mysqld]
#
# * Basic Settings
#
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
language        = /usr/share/mysql/english
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address           = 127.0.0.1 192.168.1.1
#
# * Fine Tuning
#
key_buffer              = 16M
max_allowed_packet      = 16M
thread_stack            = 128K
thread_cache_size       = 8
#max_connections        = 100
#table_cache            = 64
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit       = 1M
query_cache_size        = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
#log            = /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement :)
#
# Here you can see queries with especially long duration
#log_slow_queries       = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id              = 1
#log_bin                        = /var/log/mysql/mysql-bin.log
expire_logs_days        = 10
max_binlog_size         = 100M
#binlog_do_db           = include_database_name
#binlog_ignore_db       = include_database_name
#
# * BerkeleyDB
#
# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
skip-bdb
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
# You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
#skip-innodb
innodb_thread_concurrency = 8
innodb_buffer_pool_size = 1G
innodb_additional_mem_pool_size = 20M
innodb_data_home_dir = /var/lib/mysql
innodb_log_arch_dir = /var/lib/mysql
innodb_log_group_home_dir = /var/lib/mysql
innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
innodb_log_file_size = 100M
innodb_log_buffer_size = 8M
innodb_log_files_in_group = 2
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50


#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet      = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer              = 16M

#
# * NDB Cluster
#
# See /usr/share/doc/mysql-server-*/README.Debian for more information.
#
# The following configuration is read by the NDB Data Nodes (ndbd processes)
# not from the NDB Management Nodes (ndb_mgmd processes).
#
# [MYSQL_CLUSTER]
# ndb-connectstring=127.0.0.1


#
# * IMPORTANT: Additional settings that can override those from this file!
#
!includedir /etc/mysql/conf.d/


Is halt die standart cnf.. muss dazu sagen ich arbeite normal nicht mit datenbanken etc....
Mein gebiet sind eher auf gameserver =)

Hoffe unter euch is ein Spezialist der mir paar befehle sagen könnte die ich hinzufügen oder ändern könnte...
Vielleicht hat sogar jemand eine perfekt abgestimmte my.cnf würd mich sehr freuen =)

Gruß
Tyjo
Tyjo
 
Posts: 3
Joined: 21. October 2009 16:20

Re: Breuchte mal Hilfe bei mysql =)

Postby Nobbie » 21. October 2009 16:43

>Verstehen tuh ich da nicht viel raus vorallem sehr oft "command not found"

Und da steht ja auch dabei, welches "command not found" ist, nämlich das Kommando "bc". Das ist ein "binary calculator", also eine Art kleiner Taschenrechner für Kommandozeilentools (wie beispielsweise Dein tuning-primer.sh).

Das tuning-primer.sh analysiert offensichtlich irgendwelche Logdateien und berechnet daraus so Dinge "wie lang der Server läuft" und so weiter. Dazu braucht er ein Taschenrechnerprogramm, und zwar das "bc" Kommando. Das ist offensichtlich auf Deinem Server (irgendein Linux) nicht installiert, weswegen Du es installieren solltest. Wie man das installiert, hängt vom Linux ab (worüber Du uns rein gar nichts erzählt hast). Gib mal "bc linux" in Google ein und Du wirst viele Artikel über "bc" finden.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Breuchte mal Hilfe bei mysql =)

Postby Tyjo » 21. October 2009 17:52

Okay habe ich getan nu spuckt er mir

Code: Select all
        -- MYSQL PERFORMANCE TUNING PRIMER --
             - By: Matthew Montgomery -

MySQL Version 5.0.51a-24+lenny2 x86_64

Uptime = 1 days 15 hrs 10 min 30 sec
Avg. qps = 21
Total Questions = 3081413
Threads Connected = 8

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.0/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 NOT enabled.
Current long_query_time = 10 sec.
You have 0 out of 3081442 that take longer than 10 sec. to complete
Your long_query_time may be too high, I typically set this under 5 sec.

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.0/en/point-in-time-recovery.html

WORKER THREADS
Current thread_cache_size = 8
Current threads_cached = 1
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 100
Current threads_connected = 8
Historic max_used_connections = 9
The number of used connections is 9% of the configured maximum.
You are using less than 10% of your configured max_connections.
Lowering max_connections could help to avoid an over-allocation of memory
See "MEMORY USAGE" section to make sure you are not over-allocating

MEMORY USAGE
Max Memory Ever Allocated : 1.08 G
Configured Max Per-thread Buffers : 262 M
Configured Max Global Buffers : 1.05 G
Configured Max Memory Limit : 1.31 G
Physical Memory : 1.93 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 12 M
Current key_buffer_size = 16 M
Key cache miss rate is 1 : 3475
Key buffer free ratio = 72 %
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is enabled
Current query_cache_size = 16 M
Current query_cache_used = 1 M
Current query_cache_limit = 1 M
Current Query cache Memory fill ratio = 11.31 %
Current query_cache_min_res_unit = 4 K
Query Cache is 22 % fragmented
Run "FLUSH QUERY CACHE" periodically to defragment the query cache memory
If you have many small queries lower 'query_cache_min_res_unit' to reduce fragme                                                                                                                               ntation.
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 = 132.00 K
You have had 36392 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 = 1024 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_cache value = 64 tables
You have a total of 266 tables
You have 64 open tables.
Current table_cache hit rate is 1%, while 100% of your table cache is in use
You should probably increase your table_cache

TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 32 M
Of 5100 temp tables, 27% were created on disk
Effective in-memory tmp_table_size is limited to max_heap_table_size.
Perhaps you should increase your tmp_table_size and/or max_heap_table_size
to reduce the number of disk-based temporary tables
Note! BLOB and TEXT columns are not allow in memory tables.
If you are using these columns raising these values might not impact your
ratio of on disk temp tables.

TABLE SCANS
Current read_buffer_size = 128 K
Current table scan ratio = 22131 : 1
You have a high ratio of sequential access requests to SELECTs
You may benefit from raising read_buffer_size and/or improving your use of index                                                                                                                               es.

TABLE LOCKING
Current Lock Wait ratio = 1 : 2049
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=2'.


sorry kannte bc vorher noch net =)
könnt ihr damit mehr anfange?
Debian is installiert=)

Gruß
Tyjo
Tyjo
 
Posts: 3
Joined: 21. October 2009 16:20

Re: Breuchte mal Hilfe bei mysql =)

Postby Nobbie » 21. October 2009 21:50

Tyjo wrote:könnt ihr damit mehr anfange?


Wofür "mehr anfange"?

Ich sehe irgendwie keine Frage, kein Problem, keine Fehlermeldung. Was ist Dein Problem?
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Breuchte mal Hilfe bei mysql =)

Postby Tyjo » 21. October 2009 22:41

meine frage ist wie ich mysql ein wenig feuer unterm hintern machen könnte
es stehen zwar so aussen wie "You have a high ratio of sequential access requests to SELECTs"

aber ich suche am besten eine fertige gute my.cnf

Da ich wie gesagt ein programm namens aseco benutze was sehr viele lese zugriffe etc macht auf mysql
Tyjo
 
Posts: 3
Joined: 21. October 2009 16:20


Return to MariaDB - MySQL

Who is online

Users browsing this forum: No registered users and 17 guests