gpt4 book ai didi

php - 频繁自动重启mysql服务器,然后永久关闭

转载 作者:行者123 更新时间:2023-11-29 03:02:23 26 4
gpt4 key购买 nike

<分区>

MySQL 服务器频繁重启。不到 24 小时 75 次。终于在没有重启的情况下结束了!

请在此处查看详细日志:mysqld.log

140113 10:18:22 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

140113 10:18:31 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140113 10:18:31 InnoDB: Initializing buffer pool, size = 8.0M
140113 10:18:31 InnoDB: Completed initialization of buffer pool
140113 10:18:31 InnoDB: Started; log sequence number 16 1064411530
140113 10:18:32 [Note] Event Scheduler: Loaded 0 events
140113 10:18:32 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.61' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

140113 18:45:09 mysqld_safe Number of processes running now: 0
140113 18:45:10 mysqld_safe mysqld restarted
140113 18:45:10 InnoDB: Initializing buffer pool, size = 8.0M
140113 18:45:10 InnoDB: Completed initialization of buffer pool
140113 18:45:10 InnoDB: Started; log sequence number 16 1064411530
140113 18:45:11 [Note] Event Scheduler: Loaded 0 events
140113 18:45:11 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.61' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

……

140114  9:50:12  InnoDB: Initializing buffer pool, size = 8.0M
140114 9:50:12 InnoDB: Completed initialization of buffer pool
140114 9:50:12 InnoDB: Started; log sequence number 16 1064411530
140114 9:50:13 [Note] Event Scheduler: Loaded 0 events
140114 9:50:13 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.61' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

140114 09:55:07 mysqld_safe Number of processes running now: 0
140114 09:55:07 mysqld_safe mysqld restarted
140114 9:55:08 InnoDB: Initializing buffer pool, size = 8.0M
140114 9:55:08 InnoDB: Completed initialization of buffer pool
140114 09:55:08 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

与此同时,由于内存不足,它杀死了 62 个进程。请查看详细日志:messages

Jan 14 09:41:53 centos63 kernel: Out of memory: Kill process 16795 (mysqld) score 20 or sacrifice child
Jan 14 09:41:53 centos63 kernel: Killed process 16795, UID 27, (mysqld) total-vm:574508kB, anon-rss:20488kB, file-rss:164kB

我每 5 分钟运行一次 cronjob,这影响了一些表,其中三个表中有大约 200000、50000、25000 条数据。选择超过 1,257 个成员,然后超过 9,844 个 member_boards,然后使用以下伪代码插入/更新超过 168,624 个 member_cards:

<?php
$qry = _("SELECT _members");
while($member = mysql_fetch_assoc($res))
{//1,257
$qry = _("SELECT _member_boards");
while($db_board = mysql_fetch_assoc($board_res))
{//9,844
$s_lists = curl_download("https://api.com/boards/lists");
foreach ($lists as $list) {//9,844
if(!strcmp('SOMETHING', $list->name)){//Matching with API and DB
$curl = "https://api.com/lists/cards";
foreach ($cards as $card) {//168,624
$qry = _("SELECT _member_cards");
if($card_row = mysql_fetch_assoc($card_res)){
$qry = _("UPDATE _member_cards");
}
else{
echo $qry = _("INSERT _member_cards");
}
}
}
}

}
$qry = _("UPDATE _member_cards");
}
?>

那么可能是什么原因,我该如何解决这个问题?

到目前为止 RAM 为 512 MB。

中央操作系统

将 RAM 扩展到 1 GB 是否可以解决问题?

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com