Linux Jüngling
New Member
Hallo,
ich möchte mein Apache2 und die my.cnf für mein System und Webseiten optimieren.
System: Debian 8, i5-2310 CPU @ 2.90GHz, 8GB RAM
Webseiten auf dem Server: 4. Insgesamt ca. 10.000 unique visitors täglich.
my.cnf:
MySQLTuner:
mpm_prefork.conf:
Kann mir jemand Tipps geben welche Werte ich hinzufügen oder hochschrauben kann?
LG
ich möchte mein Apache2 und die my.cnf für mein System und Webseiten optimieren.
System: Debian 8, i5-2310 CPU @ 2.90GHz, 8GB RAM
Webseiten auf dem Server: 4. Insgesamt ca. 10.000 unique visitors täglich.
my.cnf:
Code:
[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
lc-messages-dir = /usr/share/mysql
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
#
# * Fine Tuning
#
key_buffer_size = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover-options = BACKUP
#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.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# 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
#
# * 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!
#
# * 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
MySQLTuner:
Code:
>> MySQLTuner 1.7.0 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
[--] Skipped version check for MySQLTuner script
[OK] Logged in using credentials from debian maintenance account.
[OK] Currently running supported MySQL version 5.7.16
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA
[--] Data in MEMORY tables: 808K (Tables: 2)
[--] Data in MyISAM tables: 2G (Tables: 262)
[--] Data in InnoDB tables: 2M (Tables: 79)
[OK] Total fragmented tables: 0
-------- Security Recommendations ------------------------------------------------------------------
[OK] There are no anonymous accounts for any database users
[OK] All database users have passwords assigned
[--] There are 612 basic passwords in the list.
-------- CVE Security Recommendations --------------------------------------------------------------
[OK] NO SECURITY CVE FOUND FOR YOUR VERSION
-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 3d 7h 6m 12s (17M q [60.007 qps], 1M conn, TX: 931G, RX: 4G)
[--] Reads / Writes: 92% / 8%
[--] Binary logging is disabled
[--] Physical Memory : 7.7G
[--] Max MySQL memory : 723.2M
[--] Other process memory: 870.2M
[--] Total buffers: 192.0M global + 1.1M per thread (500 max threads)
[--] P_S Max memory usage: 0B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 205.8M (2.60% of installed RAM)
[OK] Maximum possible memory usage: 723.2M (9.13% of installed RAM)
[OK] Overall possible memory usage with other process is compatible with memory available
[OK] Slow queries: 0% (0/17M)
[OK] Highest usage of available connections: 2% (13/500)
[OK] Aborted connections: 0.00% (0/1539516)
[!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance
[OK] Query cache is disabled by default due to mutex contention on multiprocessor machines.
[OK] Sorts requiring temporary tables: 0% (2K temp sorts / 1M sorts)
[!!] Joins performed without indexes: 149548
[OK] Temporary tables created on disk: 3% (10K on disk / 333K total)
[OK] Thread cache hit rate: 99% (358 created / 1M connections)
[!!] Table cache hit rate: 6% (2K open / 29K opened)
[OK] Open file limit used: 24% (1K/5K)
[OK] Table locks acquired immediately: 99% (20M immediate / 20M locks)
-------- Performance schema ------------------------------------------------------------------------
[--] Performance schema is disabled.
-------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is disabled.
-------- MyISAM Metrics ----------------------------------------------------------------------------
[OK] Key buffer used: 100.0% (16M used / 16M cache)
[OK] Key buffer size / total MyISAM indexes: 16.0M/607.8M
[OK] Read Key buffer hit rate: 99.4% (742M cached / 4M reads)
[!!] Write Key buffer hit rate: 40.2% (1M cached / 605K writes)
-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[OK] InnoDB buffer pool / data size: 128.0M/2.2M
[!!] Ratio InnoDB log file size / InnoDB Buffer pool size (37.5 %): 48.0M/128.0M should be equal 25%
[OK] InnoDB buffer pool instances: 1
[--] Number of InnoDB Buffer Pool Chunk : 1 for 1 Buffer Pool Instance(s)
[OK] Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances
[OK] InnoDB Read buffer efficiency: 99.99% (5775503 hits/ 5776132 total)
[!!] InnoDB Write Log efficiency: 117.11% (30971 hits/ 26447 total)
[OK] InnoDB log waits: 0.00% (0 waits / 57418 writes)
-------- AriaDB Metrics ----------------------------------------------------------------------------
[--] AriaDB is disabled.
-------- TokuDB Metrics ----------------------------------------------------------------------------
[--] TokuDB is disabled.
-------- XtraDB Metrics ----------------------------------------------------------------------------
[--] XtraDB is disabled.
-------- RocksDB Metrics ---------------------------------------------------------------------------
[--] RocksDB is disabled.
-------- Spider Metrics ----------------------------------------------------------------------------
[--] Spider is disabled.
-------- Connect Metrics ---------------------------------------------------------------------------
[--] Connect 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:
Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
Adjust your join queries to always utilize indexes
Increase table_open_cache gradually to avoid file descriptor limits
Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C
Beware that open_files_limit (5000) variable
should be greater than table_open_cache (2000)
Variables to adjust:
join_buffer_size (> 256.0K, or always use indexes with joins)
table_open_cache (> 2000)
innodb_log_file_size should be equals to 1/4 of buffer pool size (=32M) if possible.
mpm_prefork.conf:
Code:
<IfModule mpm_prefork_module>
StartServers 25
MinSpareServers 25
MaxSpareServers 50
MaxRequestWorkers 250
MaxConnectionsPerChild 1000
</IfModule>
Kann mir jemand Tipps geben welche Werte ich hinzufügen oder hochschrauben kann?
LG