啟用特定 WordPress 主題後,mySQL 不斷崩潰

啟用特定 WordPress 主題後,mySQL 不斷崩潰

好人 ;)

在我的一個 WordPress 網站上設定新主題後,我的伺服器出現問題。

起初mySQL開始偶爾崩潰,然後變得越來越頻繁,現在你點擊任何頁面,整個VPS伺服器就會崩潰。甚至無法使用 SSH 登入。看起來 mySQL 沒有足夠的記憶體來處理新的 WordPress 主題(是的,即使對我來說它看起來也很奇怪)。

所以我添加了一個額外的 SWAP 檔案。現在是 1024。 沒什麼 我升級了我的 VPS 計劃為 2048mb RAM(而不是 512),並將 CPU 加倍。沒有什麼。我聽說它可能是內核......但在這裡我需要你的建議。

這可能是什麼? mySQL 本身運作良好。它只是不能與這個新主題一起工作......我當然可以改變這個主題,但我懷疑一個主題可以有這麼大的力量......它一定是別的東西。

我在這裡發布錯誤日誌檔案以及伺服器設定和日誌檔案。

伺服器是:

Linux 3.2.0-4-686-pae on i686
Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz, 2 cores

當主題被停用並且處於開發階段時還沒有流量時,平均我得到:

CPU load averages   0.04 (1 min) 0.10 (5 mins) 0.17 (15 mins)
CPU usage   3% user, 0% kernel, 0% IO, 97% idle
Real memory 107.39 MB used, 1.98 GB total
Virtual memory  772 kB used, 1023.99 MB total
Local disk space    7.20 GB used, 59.06 GB total

當主題為 - APOCALIPSE ... :::

151010 10:53:22 mysqld_safe Number of processes running now: 0
151010 10:53:23 mysqld_safe mysqld restarted
2015-10-10 10:53:38 0 [Note] /usr/sbin/mysqld (mysqld 5.6.27) starting as process 6558 ...
2015-10-10 10:53:38 6558 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)

2015-10-10 10:53:38 6558 [Warning] Buffered warning: Changed limits: table_open_cache: 431 (requested 2000)

2015-10-10 10:53:38 6558 [Note] Plugin 'FEDERATED' is disabled.
2015-10-10 10:53:38 6558 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-10-10 10:53:38 6558 [Note] InnoDB: The InnoDB memory heap is disabled
2015-10-10 10:53:38 6558 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-10-10 10:53:38 6558 [Note] InnoDB: Memory barrier is not used
2015-10-10 10:53:38 6558 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-10-10 10:53:38 6558 [Note] InnoDB: Using Linux native AIO
2015-10-10 10:53:38 6558 [Note] InnoDB: Not using CPU crc32 instructions
2015-10-10 10:53:38 6558 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-10-10 10:53:38 6558 [Note] InnoDB: Completed initialization of buffer pool
2015-10-10 10:53:38 6558 [Note] InnoDB: Highest supported file format is Barracuda.
2015-10-10 10:53:38 6558 [Note] InnoDB: The log sequence numbers 1626007 and 1626007 in ibdata files do not match the log sequence number 58885888 in the ib_logfiles!
2015-10-10 10:53:38 6558 [Note] InnoDB: Database was not shutdown normally!
2015-10-10 10:53:38 6558 [Note] InnoDB: Starting crash recovery.
2015-10-10 10:53:38 6558 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-10-10 10:53:38 6558 [Note] InnoDB: Restoring possible half-written data pages
2015-10-10 10:53:38 6558 [Note] InnoDB: from the doublewrite buffer...
2015-10-10 10:53:38 6558 [Note] InnoDB: 128 rollback segment(s) are active.
2015-10-10 10:53:38 6558 [Note] InnoDB: Waiting for purge to start
2015-10-10 10:53:38 6558 [Note] InnoDB: 5.6.27 started; log sequence number 58885888
2015-10-10 10:53:38 6558 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2015-10-10 10:53:38 6558 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2015-10-10 10:53:38 6558 [Note] Server socket created on IP: '127.0.0.1'.
2015-10-10 10:53:38 6558 [Note] Event Scheduler: Loaded 0 events
2015-10-10 10:53:38 6558 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.27'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
Killed

來自系統日誌,稍早:

Oct 10 10:53:19 151-248-121-240 kernel: [ 2204.772654] Out of memory: Kill process 6400 (mysqld) score 42 or sacrifice child
Oct 10 10:53:19 151-248-121-240 kernel: [ 2204.772677] Killed process 6400 (mysqld) total-vm:429384kB, anon-rss:78316kB, file-rss:0kB

非常感謝。

答案1

您的特定主題會對資料庫有更多查詢,並且可能沒有最佳化查詢。您應該在 MySQL 上啟用慢速查詢並查看這些查詢。

你也應該使用 MYSQL 調諧器,例如MySQL 調優器

相關內容