AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-364850

Scott Lott's questions

Martin Hope
Scott Lott
Asked: 2016-07-12 15:02:29 +0800 CST

InnoDB(不是真的)内存不足?

  • 0

MySQL 不断在我的服务器上崩溃。我正在使用 VestaCP 运行几十个站点,并且几个月来没有遇到 MySQL 问题。

我在具有 12GB 内存的 Linode VPS 上运行,通常其中 9GB 是免费的。

MySQL 错误日志如下所示:

160711 22:32:36 [Note] Plugin 'FEDERATED' is disabled.
160711 22:32:36 InnoDB: The InnoDB memory heap is disabled
160711 22:32:36 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160711 22:32:36 InnoDB: Compressed tables use zlib 1.2.8
160711 22:32:36 InnoDB: Using Linux native AIO
160711 22:32:39 InnoDB: Initializing buffer pool, size = 1.0G
InnoDB: mmap(1098907648 bytes) failed; errno 12
160711 22:32:39 InnoDB: Completed initialization of buffer pool
160711 22:32:39 InnoDB: Fatal error: cannot allocate memory for the buffer pool
160711 22:32:39 [ERROR] Plugin 'InnoDB' init function returned error.
160711 22:32:39 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160711 22:32:39 [ERROR] Unknown/unsupported storage engine: InnoDB
160711 22:32:39 [ERROR] Aborting

160711 22:32:39 [Note] /usr/sbin/mysqld: Shutdown complete

160711 22:33:43 [Note] Plugin 'FEDERATED' is disabled.
160711 22:33:43 InnoDB: The InnoDB memory heap is disabled
160711 22:33:43 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160711 22:33:43 InnoDB: Compressed tables use zlib 1.2.8
160711 22:33:43 InnoDB: Using Linux native AIO
160711 22:33:43 InnoDB: Initializing buffer pool, size = 1.0G
160711 22:33:43 InnoDB: Completed initialization of buffer pool
160711 22:33:43 InnoDB: highest supported file format is Barracuda.

这组特定的错误似乎是在发出service mysql restart命令后发生的。

我花了很多时间查看这个特定的错误:Fatal error: cannot allocate memory for the buffer pool. 我发现的一切都表明缺少 ram 是问题所在,大多数人都使用极低内存系统(通常为 512MB 左右)。显然,在 12GB 的内存和 9GB 的空闲内存下,内存不足应该不会有问题,所以我不确定在这种情况下该怎么做。

运行free -h产生以下结果:

free -h 的命令行结果 此外,日志文件中有大量条目,如下所示:

160711 22:31:58 [Warning] Aborted connection 5131 to db: 'xxxx' user: 'xxxx' host: 'localhost' (Got timeout reading communication packets)
160711 22:31:58 [Warning] Aborted connection 5127 to db: 'xxxx' user: 'xxxx' host: 'localhost' (Got timeout reading communication packets)
160711 22:32:00 [Warning] Aborted connection 5136 to db: 'xxxx' user: 'xxxx' host: 'localhost' (Got timeout reading communication packets)
160711 22:32:01 [Warning] Aborted connection 5134 to db: 'xxxx' user: 'xxxx' host: 'localhost' (Got timeout reading communication packets)
160711 22:32:01 [Warning] Aborted connection 5133 to db: 'xxxx' user: 'xxxx' host: 'localhost' (Got timeout reading communication packets)
160711 22:32:01 [Warning] Aborted connection 5112 to db: 'xxxx' user: 'xxxx' host: 'localhost' (Got timeout reading communication packets)
160711 22:32:01 [Warning] Aborted connection 5135 to db: 'xxxx' user: 'xxxx' host: 'localhost' (Got timeout reading communication packets)
160711 22:32:04 [Warning] Aborted connection 5137 to db: 'xxxx' user: 'xxxx' host: 'localhost' (Got timeout reading communication packets)
160711 22:32:05 [Warning] Aborted connection 5140 to db: 'xxxx' user: 'xxxx' host: 'localhost' (Got timeout reading communication packets)

最后,我确实尝试将 InnoDB 缓冲池的大小从 512MB 增加到 1GB,但这似乎没有帮助。我是否只是增加缓冲池大小直到它停止崩溃?

编辑:感谢到目前为止的回复!这是我当前的 my.cnf:

[client]
port=3306
socket=/var/run/mysqld/mysqld.sock

[mysqld_safe]
socket=/var/run/mysqld/mysqld.sock

[mysqld]
user=mysql
pid-file=/var/run/mysqld/mysqld.pid
socket=/var/run/mysqld/mysqld.sock
port=3306
basedir=/usr
datadir=/var/lib/mysql
log-warning=2
tmpdir=/tmp
lc-messages-dir=/usr/share/mysql
log_error=/var/log/mysql/error.log
#skip-networking

symbolic-links=0

skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 256M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

#innodb_use_native_aio = 0
innodb_file_per_table

max_connections=1500
max_user_connections=200
wait_timeout=10
interactive_timeout=50
long_query_time=5

innodb_log_buffer_size          = 32M
innodb_buffer_pool_size         = 1024M
innodb_log_file_size            = 768M

!includedir /etc/mysql/conf.d/
mysql memory innodb
  • 2 个回答
  • 4482 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve