好人 ;)
我在我的一个 WordPress 网站上设置了一个新主题后,我的服务器出现了问题。
起初,mySQL 偶尔会崩溃,然后崩溃的频率越来越高,现在你点击任何页面,整个 VPS 服务器都会崩溃。甚至无法使用 SSH 登录。似乎 mySQL 没有足够的内存来处理新的 wordpress 主题(是的,对我来说这看起来很奇怪)。
所以我添加了一个额外的 SWAP 文件。现在它是 1024。没什么 我升级了我的 VPS 计划,它的 RAM 为 2048mb(而不是 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
来自 syslog 的稍早内容:
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 调谐器。