查看 log 初步判断为服务自动终止,原因是内存溢出,我以前的主机是 1GB 的 ram ,以为是内存太小,升级到了 2GB ,结果还是这个问题,其实我觉得和内存大小没有太大关系,因为我用过万网的虚拟主机, 512MB 的都能跑的好好的,自从迁移到 ECS 上后就问题不断。请各位大神帮忙看下这个 log ,为何内存总是溢出,感谢!
maridb log 如下:
161003 3:45:07 [Warning] IP address '121.28.142.136' could not be resolved: Name or service not known
161003 3:45:07 [Warning] IP address '121.28.142.138' could not be resolved: Name or service not known
161003 3:45:08 [Warning] IP address '121.28.142.133' could not be resolved: Name or service not known
161003 7:05:41 [Warning] IP address '69.165.72.94' could not be resolved: Name or service not known
161003 11:37:43 [Warning] IP address '123.249.3.155' could not be resolved: Name or service not known
161003 12:28:12 [Warning] IP address '121.199.70.200' could not be resolved: Name or service not known
161004 0:10:16 [Warning] IP address '139.224.53.6' could not be resolved: Name or service not known
161004 0:19:28 [Warning] IP address '124.173.113.45' could not be resolved: Name or service not known
161004 00:38:31 mysqld_safe Number of processes running now: 0
161004 00:38:31 mysqld_safe mysqld restarted
161004 0:38:31 [Note] /usr/libexec/mysqld (mysqld 5.5.50-MariaDB) starting as process 27071 ...
161004 0:38:31 [Warning] Changed limits: max_open_files: 1024 max_connections: 214 table_cache: 400
161004 0:38:31 InnoDB: The InnoDB memory heap is disabled
161004 0:38:31 InnoDB: Mutexes and rw_locks use GCC atomic builtins
161004 0:38:31 InnoDB: Compressed tables use zlib 1.2.7
161004 0:38:31 InnoDB: Using Linux native AIO
161004 0:38:31 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137756672 bytes) failed; errno 12
161004 0:38:31 InnoDB: Completed initialization of buffer pool
161004 0:38:31 InnoDB: Fatal error: cannot allocate memory for the buffer pool
161004 0:38:31 [ERROR] Plugin 'InnoDB' init function returned error.
161004 0:38:31 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
161004 0:38:31 [ERROR] mysqld: Out of memory (Needed 128917504 bytes)
161004 0:38:31 [ERROR] mysqld: Out of memory (Needed 96681984 bytes)
161004 0:38:31 [ERROR] mysqld: Out of memory (Needed 72499200 bytes)
161004 0:38:33 [Note] Plugin 'FEEDBACK' is disabled.
161004 0:38:33 [ERROR] Unknown/unsupported storage engine: InnoDB
161004 0:38:33 [ERROR] Aborting
161004 0:38:33 [Note] /usr/libexec/mysqld: Shutdown complete
161004 00:38:33 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
https://www.v2ex.com/t/310459
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.