0

最初に6 つのサイトがすべて同じ専用サーバー上にあり、そのうちの 2 つのサイトではトラフィックが非常に安定しています。2 つのサイトでは一貫して少なくとも 90 人から 120 人、残りのサイトでは 15 人から 25 人です。

サイトは現在、有料のトラフィック共有会社が呼び出され、他の 4 つのサイトにすべて同じサーバーでホストされているメインのサイトと同じだけのトラフィックを与えるまで、適切に実行されます。適切なリクエストを行う前にサイトが即座にタイムアウトします。 2 ~ 3 回の更新後にロードすることを決定した場合は、プルアップするまでに数秒と 30 秒かかります。ただし、内側をクリックし始めると、サイトの読み込みが速くなりますが、すぐに元に戻ります.

mysqltuner を使用して my.cnf ファイルを変更しましたが、設定が期待どおりに機能しません。それらを適切な曲に微調整するだけでなく。サーバーは 20 TB で、それ自体をサポートするためにより多くの帯域幅があります。

サイトはすべてワードプレスであり、WP-Super Cache がインストールされているため、高速である必要はありません。以下は私の構成設定です。少しバランスが崩れていると思います。クリーンアップのテーブル エラーは WP サイトのテーブルではなく、パフォーマンスとは関係がないことに注意してください。


mysqltuner の結果

-------- Performance Metrics -------------------------------------------------
[--] Up for: 10h 23m 10s (11M q [295.373 qps], 666K conn, TX: 77G, RX: 1G)
[--] Reads / Writes: 50% / 50%
[--] Binary logging is disabled
[--] Total buffers: 4.8G global + 4.6M per thread (1000 max threads)
[OK] Maximum reached memory usage: 5.3G (67.58% of installed RAM)
[!!] Maximum possible memory usage: 9.3G (119.39% of installed RAM)
[OK] Slow queries: 0% (678/11M)
[OK] Highest usage of available connections: 10% (104/1000)
[OK] Aborted connections: 0.08%  (528/666673)
[OK] Query cache efficiency: 69.3% (2M cached / 3M selects)
[!!] Query cache prunes per day: 130766
[OK] Sorts requiring temporary tables: 0% (109 temp sorts / 179K sorts)
[!!] Temporary tables created on disk: 58% (111K on disk / 191K total)
[OK] Thread cache hit rate: 99% (120 created / 666K connections)
[OK] Table cache hit rate: 40% (2K open / 5K opened)
[OK] Open file limit used: 19% (1K/10K)
[OK] Table locks acquired immediately: 99% (1M immediate / 1M locks)

-------- MyISAM Metrics ------------------------------------------------------
[!!] Key buffer used: 29.0% (19M used / 68M cache)
[OK] Key buffer size / total MyISAM indexes: 65.0M/64.1M
[OK] Read Key buffer hit rate: 100.0% (30M cached / 13K reads)
[!!] Write Key buffer hit rate: 13.0% (239K cached / 208K writes)

-------- InnoDB Metrics ------------------------------------------------------
[--] InnoDB is enabled.
[!!] InnoDB buffer pool / data size: 4.0G/8.7G
[!!] InnoDB buffer pool instances: 1
[!!] InnoDB Used buffer: 23.71% (62152 used/ 262144 total)
[OK] InnoDB Read buffer efficiency: 99.99% (390201875 hits/ 390245584 total)
[!!] InnoDB Write Log efficiency: 85.21% (1596393 hits/ 1873419 total)
[OK] InnoDB log waits: 0.00% (0 waits / 277026 writes)

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

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

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

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

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

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    Set up a Secure Password for user@host ( SET PASSWORD FOR 'user'@'SpecificDNSorIp' =                                                                                 PASSWORD('secure_password'); )
    MySQL started within last 24 hours - recommendations may be inaccurate
    Reduce your overall MySQL memory footprint for system stability
    Increasing the query_cache size over 128M may reduce performance
    Temporary table size is already large - reduce result set size
    Reduce your SELECT DISTINCT queries without LIMIT clauses
Variables to adjust:
  *** MySQL's maximum memory usage is dangerously high ***
  *** Add RAM before increasing MySQL buffer variables ***
    query_cache_size (> 128M) [see warning above]
    innodb_buffer_pool_size (>= 8G) if possible.
    innodb_buffer_pool_instances(=4)

これが my.cnf ファイルです

[mysqld]
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under different user or group,
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
tmpdir=/dev/shm
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

open_files_limit=10000
query_cache_size=128M
query_cache_type=1
max_connections=1000
max_user_connections=25
wait_timeout=300
tmp_table_size=512M
max_heap_table_size=512M
thread_cache_size=64
key_buffer_size=65M
max_allowed_packet=268435456
table_cache=2048
table_definition_cache=2048

#delayed_insert_timeout=20 # Turn on if max_connections being reached due to delayed inserts
#delayed_queue_size=300 # Turn on if max_connections being reached due to delayed inserts

myisam_sort_buffer_size=32M # can be increased per sessions if needed for alter tables (indexes, repair)

query_cache_limit=2M # leave at default unless there is a good reason
join_buffer=2M # leave at default unless there is a good reason
sort_buffer_size=2M # leave at default unless there is a good reason
#read_rnd_buffer_size=256K # leave at default unless there is a good reason
#read_buffer_size=2M # leave at default unless there is a good reason

collation_server=utf8_unicode_ci
character_set_server=utf8

general_log=0
slow_query_log=1
log-output=TABLE # select * from mysql.general_log order by event_time desc limit 10;
long_query_time=5 # select * from mysql.slow_log order by start_time desc limit 10;

low_priority_updates=1
innodb_file_per_table=1

innodb_buffer_pool_size=4G # check mysql -e "SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool%';" - free vs total
innodb_additional_mem_pool_size=62M
innodb_log_buffer_size=62M
innodb_thread_concurrency=8 # Number of physical + virtual CPU's, preset when server is provisioned to have correct # of cores

default-storage-engine=MyISAM
[mysqld_safe]

ここで、トラフィック共有サイトは、サーバーに送信するトラフィックの統計を取得するためにサーバーに過剰にpingを送信すると、ユーザーを傷つける可能性があります. どんな助け、考え、またはアイデアも大歓迎です。

どうもありがとう!

4

1 に答える 1

1

「断片化されたテーブル」 -- 偽物。最適化を実行しないでください。

「危険なほど高いメモリ使用量」 -- いいえ、そうではありません。しかし、それを黙らせるにはmax_connections、200 に減らします。

query_cache_size128M とやや高い。上げないでください。

多くのディスクベースの tmp テーブル -- long_query_time1 (秒) に下げて、SlowLog をオンにします。1 日か 2 日後に戻ってきて、いたずらなクエリが何であるかを見てみましょう。これにより、「遅いクエリ」も 0% を超えることに注意してください。オンにして、TABLE に送信されているようです。したがって、select * from mysql.slow_log order by query_time desc limit 5興味深いクエリを取得するために使用します。と一緒に議論しましょうSHOW CREATE TABLE

MyISAM と InnoDB のメトリクスはそれほど悪くありません。アクションは必要ありません。

tmp_table_size=512Mmax_heap_table_size=512M危険なほど高いです。RAM の 1% 未満に抑えてください。

table_cache=2048-- 起動してから最初の 10 時間でもスラッシングがあります。に増加し4Kます。

MyISAM と InnoDB の両方を使用しているようです。

于 2016-04-09T19:59:07.190 に答える