MySQL似乎正在崩溃,通常在当天晚些时候,但我不明白为什么! 它说内存不足,但是有大量的免费ram,没有使用交换空间。 我正在使用Azure。
这里是日志:
Oct 3 20:42:20 GenyxLive kernel: [787828.711240] Out of memory: Kill process 53891 (mysqld) score 84 or sacrifice child Oct 3 20:42:20 GenyxLive kernel: [787828.714081] Killed process 53891 (mysqld) total-vm:871780kB, anon-rss:58164kB, file-rss:0kB Oct 3 20:42:20 GenyxLive kernel: [787828.731974] init: mysql main process (53891) killed by KILL signal Oct 3 20:42:20 GenyxLive kernel: [787828.733525] init: mysql main process ended, respawning Oct 3 20:42:20 GenyxLive kernel: [787828.974636] init: mysql main process (24975) terminated with status 1 Oct 3 20:42:20 GenyxLive kernel: [787828.974666] init: mysql main process ended, respawning Oct 3 20:42:21 GenyxLive kernel: [787829.937186] init: mysql post-start process (24976) terminated with status 1 Oct 3 20:42:22 GenyxLive kernel: [787830.103158] init: mysql main process (25002) terminated with status 1 Oct 3 20:42:22 GenyxLive kernel: [787830.103194] init: mysql respawning too fast, stopped
以下是最新消息的图表: 
你可以看到一个CPU的尖峰,然后停止MySQL服务…
任何人都可以帮我弄清楚发生了什么?
Ubuntu 12.04
Azure Small(768mb ram,1ghz cpu)
编辑
有一个cron工作每5分钟运行一次,只是检查新的域名等(使用zpanel)。
它是一个64位的操作系统
Linux GenyxLive 3.2.0-48-virtual #74-Ubuntu SMP Thu Jun 6 20:02:55 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
free -lm结果:
total used free shared buffers cached Mem: 672 491 180 0 42 118 Low: 672 491 180 High: 0 0 0 -/+ buffers/cache: 330 341 Swap: 0 0 0
cat /proc/meminfo结果:
MemTotal: 688348 kB MemFree: 186788 kB Buffers: 43956 kB Cached: 120988 kB SwapCached: 0 kB Active: 335908 kB Inactive: 84924 kB Active(anon): 255976 kB Inactive(anon): 296 kB Active(file): 79932 kB Inactive(file): 84628 kB Unevictable: 0 kB Mlocked: 0 kB SwapTotal: 0 kB SwapFree: 0 kB Dirty: 16 kB Writeback: 0 kB AnonPages: 255924 kB Mapped: 18568 kB Shmem: 376 kB Slab: 51788 kB SReclaimable: 37052 kB SUnreclaim: 14736 kB KernelStack: 1344 kB PageTables: 7632 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 344172 kB Committed_AS: 967220 kB VmallocTotal: 34359738367 kB VmallocUsed: 13192 kB VmallocChunk: 34359723128 kB HardwareCorrupted: 0 kB AnonHugePages: 0 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB DirectMap4k: 51136 kB DirectMap2M: 735232 kB
内核OOM只在资源非常紧张的时候才会启动…所以你必须用尽内存,但是图表没有什么意义。
free -lm显示什么? 另外, cat /proc/meminfo显示什么?
在这个问题的触发方面,做一些维护过程或者其他的cron作业,这个时候可能正在执行查询,mysql需要在内存中维护临时表吗?
顺便说一句…这是一个32位版本的操作系统? 只是想知道你的低内存是用尽了。
编辑1好的。 那么,mysqld将成为单个内存消耗最大的过程,所以很可能是为什么它被选中。 检查你的Apacheconfiguration,看看你的工作线程是如何产生的…每个将有一个内存开销,并有可能是当更多的产卵时,你没有交换空间用完内存。 检查你的MaxClients参数…如果你有超过50(只是一个球场的数字)这可能是一个好地方看。 可能我build议看看Apache性能调优 。