免费注册 查看新帖 |

Chinaunix

广告
  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2513 | 回复: 8
打印 上一主题 下一主题

apache用不了多久就把mysql搞挂了,why? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-05-28 00:31 |只看该作者 |倒序浏览
  1. 130528  0:23:53 [Note] Plugin 'FEDERATED' is disabled.
  2. 130528  0:23:53 InnoDB: The InnoDB memory heap is disabled
  3. 130528  0:23:53 InnoDB: Mutexes and rw_locks use GCC atomic builtins
  4. 130528  0:23:53 InnoDB: Compressed tables use zlib 1.2.3.4
  5. 130528  0:23:53 InnoDB: Initializing buffer pool, size = 128.0M
  6. 130528  0:23:53 InnoDB: Completed initialization of buffer pool
  7. 130528  0:23:53 InnoDB: highest supported file format is Barracuda.
  8. InnoDB: The log sequence number in ibdata files does not match
  9. InnoDB: the log sequence number in the ib_logfiles!
  10. 130528  0:23:53  InnoDB: Database was not shut down normally!
  11. InnoDB: Starting crash recovery.
  12. InnoDB: Reading tablespace information from the .ibd files...
  13. InnoDB: Restoring possible half-written data pages from the doublewrite
  14. InnoDB: buffer...
  15. InnoDB: Last MySQL binlog file position 0 588594, file name /var/log/mysql/mysql-bin.000006
  16. 130528  0:23:54  InnoDB: Waiting for the background threads to start
  17. 130528  0:23:55 InnoDB: 1.1.8 started; log sequence number 17212102
  18. 130528  0:23:55 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
  19. 130528  0:23:55 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
  20. 130528  0:23:55 [Note] Server socket created on IP: '127.0.0.1'.
  21. 130528  0:23:55 [Note] Event Scheduler: Loaded 0 events
  22. 130528  0:23:55 [Note] /usr/sbin/mysqld: ready for connections.
  23. Version: '5.5.28-0ubuntu0.12.04.3'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
  24. 130528  0:24:04 [ERROR] /usr/sbin/mysqld: Table './everitsm/wp_options' is marked as crashed and should be repaired
  25. 130528  0:24:04 [Warning] Checking table:   './everitsm/wp_options'
  26. 130528  0:27:57 [Note] Plugin 'FEDERATED' is disabled.
  27. 130528  0:27:57 InnoDB: The InnoDB memory heap is disabled
  28. 130528  0:27:57 InnoDB: Mutexes and rw_locks use GCC atomic builtins
  29. 130528  0:27:57 InnoDB: Compressed tables use zlib 1.2.3.4
  30. 130528  0:27:57 InnoDB: Initializing buffer pool, size = 128.0M
  31. InnoDB: mmap(137363456 bytes) failed; errno 12
  32. 130528  0:27:57 InnoDB: Completed initialization of buffer pool
  33. 130528  0:27:57 InnoDB: Fatal error: cannot allocate memory for the buffer pool
  34. 130528  0:27:57 [ERROR] Plugin 'InnoDB' init function returned error.
  35. 130528  0:27:57 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
  36. 130528  0:27:57 [ERROR] Unknown/unsupported storage engine: InnoDB
  37. 130528  0:27:57 [ERROR] Aborting

  38. 130528  0:27:57 [Note] /usr/sbin/mysqld: Shutdown complete

  39. 130528  0:27:57 [Note] Plugin 'FEDERATED' is disabled.
  40. 130528  0:27:57 InnoDB: The InnoDB memory heap is disabled
  41. 130528  0:27:57 InnoDB: Mutexes and rw_locks use GCC atomic builtins
  42. 130528  0:27:57 InnoDB: Compressed tables use zlib 1.2.3.4
  43. 130528  0:27:57 InnoDB: Initializing buffer pool, size = 128.0M
  44. InnoDB: mmap(137363456 bytes) failed; errno 12
  45. 130528  0:27:57 InnoDB: Completed initialization of buffer pool
  46. 130528  0:27:57 InnoDB: Fatal error: cannot allocate memory for the buffer pool
  47. 130528  0:27:57 [ERROR] Plugin 'InnoDB' init function returned error.
  48. 130528  0:27:57 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
  49. 130528  0:27:57 [ERROR] Unknown/unsupported storage engine: InnoDB
  50. 130528  0:27:57 [ERROR] Aborting

  51. 130528  0:27:57 [Note] /usr/sbin/mysqld: Shutdown complete
复制代码
用这个命令
ab -n 100 -c 10 http://xxxxxx.com/
用不了几次,mysql就挂了,出现的错误都一样,网站是wordpress的。

求助,请问怎么解决?

论坛徽章:
224
2022北京冬奥会纪念版徽章
日期:2015-08-10 16:30:32操作系统版块每日发帖之星
日期:2016-02-18 06:20:00操作系统版块每日发帖之星
日期:2016-03-01 06:20:00操作系统版块每日发帖之星
日期:2016-03-02 06:20:0015-16赛季CBA联赛之上海
日期:2019-09-20 12:29:3219周年集字徽章-周
日期:2019-10-01 20:47:4815-16赛季CBA联赛之八一
日期:2020-10-23 18:30:5320周年集字徽章-20	
日期:2020-10-28 14:14:2615-16赛季CBA联赛之广夏
日期:2023-02-25 16:26:26CU十四周年纪念徽章
日期:2023-04-13 12:23:1015-16赛季CBA联赛之四川
日期:2023-07-25 16:53:45操作系统版块每日发帖之星
日期:2016-05-10 19:22:58
2 [报告]
发表于 2013-05-28 00:39 |只看该作者
本帖最后由 action08 于 2013-05-28 00:50 编辑

mysql是不是用的默认配置啊,编译安装还是yum安装的呀??

论坛徽章:
224
2022北京冬奥会纪念版徽章
日期:2015-08-10 16:30:32操作系统版块每日发帖之星
日期:2016-02-18 06:20:00操作系统版块每日发帖之星
日期:2016-03-01 06:20:00操作系统版块每日发帖之星
日期:2016-03-02 06:20:0015-16赛季CBA联赛之上海
日期:2019-09-20 12:29:3219周年集字徽章-周
日期:2019-10-01 20:47:4815-16赛季CBA联赛之八一
日期:2020-10-23 18:30:5320周年集字徽章-20	
日期:2020-10-28 14:14:2615-16赛季CBA联赛之广夏
日期:2023-02-25 16:26:26CU十四周年纪念徽章
日期:2023-04-13 12:23:1015-16赛季CBA联赛之四川
日期:2023-07-25 16:53:45操作系统版块每日发帖之星
日期:2016-05-10 19:22:58
3 [报告]
发表于 2013-05-28 00:49 |只看该作者
上面的错了



48行,
130528  0:27:57 InnoDB: Fatal error: cannot allocate memory for the buffer pool

内存不够,贴free -m

论坛徽章:
0
4 [报告]
发表于 2013-05-28 08:43 |只看该作者
mysql 是apt-get安装的,不是编译安装的。

是内存不足,但是怎么限制apache对内存的消耗和mysql自己对内存的消耗?

论坛徽章:
0
5 [报告]
发表于 2013-05-28 09:51 |只看该作者
对于ab:并发数越多,内存使用量越大
对于mysql:支持的线程数越多,内存使用量越大

所以,小内存没法进行性能测试,因为内存首先是瓶颈,无法测到mysql的瓶颈

论坛徽章:
0
6 [报告]
发表于 2013-05-28 10:22 |只看该作者
#
nnoDB: mmap(137363456 bytes) failed; errno 12
130528  0:27:57 InnoDB: Completed initialization of buffer pool
130528  0:27:57 InnoDB: Fatal error: cannot allocate memory for the buffer pool
#
在你启动MySQL的时候,innodb就会根据innodb_buffer_size指定的大小为innodb预分配内存, 但你此时OS的内存已不足指定的128M,所以innodb bp无法初始化,MySQL也就启动不起来了。
[root@DB ~]# perror 12
OS error code  12:  Cannot allocate memory
解决:1)把你apache的内存配置调小,2)用free -m看一下,还有多少内存,然后设置innodb_buffer_pool_size,不过128M用于测试都太小了。
如果用的VM,建议去扩一下内存。

论坛徽章:
8
综合交流区版块每周发帖之星
日期:2015-12-02 15:03:53数据库技术版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-09-14 06:20:00金牛座
日期:2014-10-10 11:23:34CU十二周年纪念徽章
日期:2013-10-24 15:41:34酉鸡
日期:2013-10-19 10:17:1315-16赛季CBA联赛之北京
日期:2017-03-06 15:12:44
7 [报告]
发表于 2013-05-28 14:53 |只看该作者
哈哈

论坛徽章:
224
2022北京冬奥会纪念版徽章
日期:2015-08-10 16:30:32操作系统版块每日发帖之星
日期:2016-02-18 06:20:00操作系统版块每日发帖之星
日期:2016-03-01 06:20:00操作系统版块每日发帖之星
日期:2016-03-02 06:20:0015-16赛季CBA联赛之上海
日期:2019-09-20 12:29:3219周年集字徽章-周
日期:2019-10-01 20:47:4815-16赛季CBA联赛之八一
日期:2020-10-23 18:30:5320周年集字徽章-20	
日期:2020-10-28 14:14:2615-16赛季CBA联赛之广夏
日期:2023-02-25 16:26:26CU十四周年纪念徽章
日期:2023-04-13 12:23:1015-16赛季CBA联赛之四川
日期:2023-07-25 16:53:45操作系统版块每日发帖之星
日期:2016-05-10 19:22:58
8 [报告]
发表于 2013-05-28 23:32 |只看该作者
楼上版主宝宝已经五岁了呀

论坛徽章:
0
9 [报告]
发表于 2013-05-29 09:14 |只看该作者
用 nginx 替代apache
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP