MySQL Forums
Forum List  »  German

MySQL 4.1.22 auf Raspberry PI 3 optimieren -> Temp Tables EXPERTE GESUCHT
Posted by: Friedrich Ramser
Date: September 15, 2016 10:57AM

Hallo Leute,

Habe meinen MySQL 4.1.22 Server in Betrieb genommen.
Muss dazu sagen, dass bis auf kurzen MySQL noch Neuland für mich
war und teils noch immer ist.
Die Konfiguration habe ich gemäß diesem Forum gemacht:

http://forum.cao-faktura.de/viewtopic.php?f=5&t=4308

Leider läuft CAO Faktura aus lizenurechtlichen Gründen nur auf <= MySQL 4.1.22

Die Hardware ist ein Raspberry PI 3 mit 1GB Ram.
Der Raspberry PI 3 wird headless betrieben.
Nebenbei laufen nur die Dinge des Raspian Betriebssystems.

Warum ein RPI3.
Weil er wenig Energie braucht.
Weil er ohne Lüfter läuft.
Weil er billig ist.
Weil die 100Mbit Verbindung reicht.Die Internetverbindung ist langsamer.
Weil ein zweiter daneben liegt und nur umgesteckt werden braucht.
(Keine Redundanz. Zweiter ist total unabhängig.)
...

Was ist der Nachteil daran?
Die SD Karte.

Und genau darauf kommt es an.
Leider lagert meine MySQL Datenbank zuviele Temp Tables aus.

Also hier der Aufruf:
Wer kann mir helfen, die Temp Tables zu reduzieren bzw. komplett auszuschalten???

Anbei mal alle Daten, die ich habe:

My.cnf:
[client]
#password = your_password
port = 3047
socket = /usr/local/mysql4/var/mysqld.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3047
socket = /usr/local/mysql4/var/mysqld.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 256
sort_buffer_size = 1M
join_buffer_size = 1M
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
tmp_table_size = 512M
max_heap_table_size = 512M
query_cache_type = 1
query_cache_size = 128M
query_cache_limit = 128M
max_connections = 8

# Replication Master Server (default)
# binary logging is required for replication
log-bin
expire-logs-days = 14
sync-binlog = 1

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M


[mysqlhotcopy]
interactive-timeout


MySQL Primer:
Using login values from ~/.my.cnf
- INITIAL LOGIN ATTEMPT FAILED -
Testing for stored webmin passwords:
None Found
Could not auto detect login info!
Found potential sockets: /usr/local/mysql4/var/mysqld.sock
Using: /usr/local/mysql4/var/mysqld.sock
Would you like to provide a different socket?: [y/N] n
Do you have your login handy ? [y/N] : n
Please create a valid login to MySQL
Or, set correct values for 'user=' and 'password=' in ~/.my.cnf

Would you like me to create a ~/.my.cnf file for you? [y/N] : n
>> MySQLTuner 1.6.12 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
[!!] Couldn't find mysqladmin in your $PATH. Is MySQL installed?
CAOAdmin@caodb:/usr/local/sbin $ RunMySQLTest.sh

-- MYSQL PERFORMANCE TUNING PRIMER --
- By: Matthew Montgomery -

MySQL Version 4.1.22mysql4-log armv7l is EOL please upgrade to MySQL 4.1 or later

Uptime = 1 days 22 hrs 43 min 21 sec
Avg. qps = 0
Total Questions = 31021
Threads Connected = 1

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/4.1/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 31035 that take longer than 10 sec. to complete
Your long_query_time seems to be fine

BINARY UPDATE LOG
The binary update log is enabled

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

MAX CONNECTIONS
Current max_connections = 8
Current threads_connected = 1
Historic max_used_connections = 2
The number of used connections is 25% of the configured maximum.
Your max_connections variable seems to be fine.

INNODB STATUS
Cannot parse InnoDB stats prior to 5.0.x
ERROR 1227 (HY000) at line 1: Access denied; you need the SUPER privilege for this operation
Current innodb_buffer_pool_size = 8 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 : 159 M
Configured Max Per-thread Buffers : 23 M
Configured Max Global Buffers : 154 M
Configured Max Memory Limit : 177 M
Physical Memory : 973 M
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 0 bytes
Current key_buffer_size = 16 M
Key cache miss rate is 1 : 173
Key buffer free ratio = 86 %
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is enabled
Current query_cache_size = 128 M
Current query_cache_used = 4 M
Current query_cache_limit = 128 M
Current Query cache Memory fill ratio = 3.28 %
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 = 1 M
Current read_rnd_buffer_size = 508 K
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 1.00 M
You have had 0 queries where a join could not use an index properly
Your joins seem to be using indexes properly

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
You are not '1002' or 'root'
I am unable to determine the table_count!
Current table_cache value = 256 tables
You have 210 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current max_heap_table_size = 511 M
Current tmp_table_size = 512 M
Of 442 temp tables, 42% 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 = 252 K
Current table scan ratio = 248 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 0 : 31187
Your table locking seems to be fine





MySQL Tuner:
>> MySQLTuner 1.6.12 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
[--] Performing tests on 127.0.0.1:3047
[!!] Successfully authenticated with no password - SECURITY RISK!

[--] Skipped version check for MySQLTuner script
[!!] failed to execute: SHOW GLOBAL STATUS
[!!] FAIL Execute SQL / return code: 256
[!!] failed to execute: SHOW SLAVE STATUS\G
[!!] FAIL Execute SQL / return code: 256
[!!] failed to execute: SHOW SLAVE HOSTS
[!!] FAIL Execute SQL / return code: 256
[!!] Your MySQL version 4.1.22mysql4-log is EOL software! Upgrade soon!
[OK] Operating on 32-bit architecture with less than 2GB RAM

-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[!!] InnoDB is enabled but isn't being used
[OK] Total fragmented tables: 0

-------- Security Recommendations ------------------------------------------------------------------
[!!] failed to execute: SELECT CONCAT(user, '@', host) FROM mysql.user WHERE TRIM(USER) = '' OR USER IS NULL
[!!] FAIL Execute SQL / return code: 256
[OK] There are no anonymous accounts for any database users
[!!] No more password checks for MySQL version <=5.1
[!!] MySQL version <=5.1 are deprecated and end of support.

-------- CVE Security Recommendations --------------------------------------------------------------
[--] Skipped due to --cvefile option undefined
Argument "du:" isn't numeric in addition (+) at /usr/local/sbin/mysqltuner.pl
line 2103 (#1)
(W numeric) The indicated string was fed as an argument to an operator
that expected a numeric value instead. If you're fortunate the message
will identify which operator was so unfortunate.


-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 1d 22h 43m 26s (31K q [0.186 qps], 297 conn, TX: 193M, RX: 25M)
[--] Reads / Writes: 87% / 13%
[--] Binary logging is enabled (GTID MODE: OFF)
[--] Physical Memory : 973.1M
[--] Max MySQL memory : 689.4M
[--] Other process memory: 60.7M
[--] Total buffers: 666.0M global + 2.9M per thread (8 max threads)
[--] P_S Max memory usage: 0B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 671.9M (69.04% of installed RAM)
[OK] Maximum possible memory usage: 689.4M (70.85% of installed RAM)
[OK] Overall possible memory usage with other process is compatible with memory available
[OK] Slow queries: 0% (0/31K)
[OK] Highest usage of available connections: 25% (2/8)
[OK] Aborted connections: 0.00% (0/297)
[OK] Query cache efficiency: 29.7% (3K cached / 10K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 669 sorts)
[OK] No joins without indexes
[!!] Temporary tables created on disk: 72% (321 on disk / 442 total)
[!!] Table cache hit rate: 18% (210 open / 1K opened)
[OK] Open file limit used: 40% (415/1K)
[OK] Table locks acquired immediately: 100% (10K immediate / 10K locks)
[OK] Binlog cache memory access: 0% ( 0 Memory / 0 Total)

-------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is disabled.

-------- Performance schema ------------------------------------------------------------------------
[--] Performance schema is disabled.

-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 13.7% (2M used / 16M cache)
[!!] Cannot calculate MyISAM index size - re-run script as root user

-------- AriaDB Metrics ----------------------------------------------------------------------------
[--] AriaDB is disabled.

-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is disabled.

-------- TokuDB Metrics ----------------------------------------------------------------------------
[--] TokuDB is disabled.

-------- Galera Metrics ----------------------------------------------------------------------------
[--] Galera is disabled.

-------- Replication Metrics -----------------------------------------------------------------------
[--] Galera Synchronous replication: NO
[--] No replication slave(s) for this server.
[--] This is a standalone server.

-------- Recommendations ---------------------------------------------------------------------------
General recommendations:
Add skip-innodb to MySQL configuration to disable InnoDB
Enable the slow query log to troubleshoot bad queries
Temporary table size is already large - reduce result set size
Reduce your SELECT DISTINCT queries without LIMIT clauses
Increase table_cache gradually to avoid file descriptor limits
Read this before increasing table_cache over 64: http://bit.ly/1mi7c4C
Beware that open_files_limit (1024) variable
should be greater than table_cache ( 256)
Upgrade to MySQL 5.5+ to use asynchronous write
Variables to adjust:
table_cache (> 256)



Free Abfrage:
total used free shared buffers cached
Mem: 996460 334196 662264 6964 31252 223212
-/+ buffers/cache: 79732 916728
Swap: 0 0 0


Würde mich auf eine Antwort freuen.

Options: ReplyQuote


Subject
Views
Written By
Posted
MySQL 4.1.22 auf Raspberry PI 3 optimieren -> Temp Tables EXPERTE GESUCHT
2406
September 15, 2016 10:57AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.