【问题标题】:mysql crash after ~ 1 day〜1天后mysql崩溃
【发布时间】:2020-08-19 16:10:06
【问题描述】:

我使用一个非常小的 VPS 作为 wordpress 安装的开发服务器。事实:512mb RAM,Ubuntu 16.04,nginx 服务器。

在使用 wordpress 几个小时(直到一天)后,mysql-server 崩溃并且日志显示如下:

2020-05-05T04:00:28.886012Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2020-05-05T04:00:28.886079Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2020-05-05T04:00:29.141722Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-05-05T04:00:29.148643Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.29-0ubuntu0.16.04.1) starting as process 2299 ...
2020-05-05T04:00:29.166550Z 0 [Note] InnoDB: PUNCH HOLE support available
2020-05-05T04:00:29.166579Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-05-05T04:00:29.166584Z 0 [Note] InnoDB: Uses event mutexes
2020-05-05T04:00:29.166591Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2020-05-05T04:00:29.166599Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2020-05-05T04:00:29.166603Z 0 [Note] InnoDB: Using Linux native AIO
2020-05-05T04:00:29.166909Z 0 [Note] InnoDB: Number of pools: 1
2020-05-05T04:00:29.167122Z 0 [Note] InnoDB: Using CPU crc32 instructions
2020-05-05T04:00:29.169383Z 0 [Note] InnoDB: Initializing buffer pool, total size = 32M, instances = 1, chunk size = 32M
2020-05-05T04:00:29.171692Z 0 [Note] InnoDB: Completed initialization of buffer pool
2020-05-05T04:00:29.186015Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-05-05T04:00:29.214017Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2020-05-05T04:00:29.214576Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 9778264
2020-05-05T04:00:29.214587Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 9778273
2020-05-05T04:00:29.214593Z 0 [Note] InnoDB: Database was not shutdown normally!
2020-05-05T04:00:29.214598Z 0 [Note] InnoDB: Starting crash recovery.
2020-05-05T04:00:29.345046Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-05-05T04:00:29.345087Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-05-05T04:00:29.345132Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-05-05T04:00:29.369092Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-05-05T04:00:29.371891Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2020-05-05T04:00:29.371905Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2020-05-05T04:00:29.372154Z 0 [Note] InnoDB: Waiting for purge to start
2020-05-05T04:00:29.422351Z 0 [Note] InnoDB: 5.7.29 started; log sequence number 9778273
2020-05-05T04:00:29.422714Z 0 [Note] Plugin 'FEDERATED' is disabled.
2020-05-05T04:00:29.432421Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2020-05-05T04:00:29.432439Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2020-05-05T04:00:29.435161Z 0 [Warning] CA certificate ca.pem is self signed.
2020-05-05T04:00:29.435205Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2020-05-05T04:00:29.435276Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2020-05-05T04:00:29.435317Z 0 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2020-05-05T04:00:29.435345Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2020-05-05T04:00:29.446158Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-05-05T04:00:29.464315Z 0 [Note] InnoDB: Buffer pool(s) load completed at 200505  6:00:29
2020-05-05T04:00:29.477252Z 0 [Note] Event Scheduler: Loaded 0 events
2020-05-05T04:00:29.490104Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.29-0ubuntu0.16.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)

我已经在这里找到了解释相同问题的帖子,但解决方案确实对我有用。我已经更改了 innodb_buffer_pool_size = 32M。 还有其他想法吗?

【问题讨论】:

  • 包括你是如何最小化 nginx、php 和 mysql 的内存的?每次用多少? dmesg 输出可能会列出 OOM 如何决定在用尽时使用多少?有些东西你不能在这么少的资源上运行东西。好主意;用更多的内存运行。欢迎来到 SO

标签: mysql wordpress ubuntu nginx


【解决方案1】:

来自 Google,这些是您的最低要求,

NGINX 控制器需要以下最低硬件规格: RAM:8 GB RAM。 CPU:8 核 CPU @ 2.40 GHz 或类似。磁盘空间:80 GB 可用磁盘空间。

512MB 的服务器无法完成工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-08
    • 2016-02-16
    • 1970-01-01
    • 2013-07-03
    • 2019-11-12
    • 1970-01-01
    相关资源
    最近更新 更多