My site crashed because MySQL stopped running. According to the syslog, the following happened:
...
bitcoind invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=-17, oom_score_adj=-1000
bitcoind cpuset=/ mems_allowed=0
...
...
2299 total pagecache pages
1911 pages in swap cache
Swap cache stats: add 855411, delete 853500, find 7256250/7310330
Free swap = 0kB
Total swap = 1048572kB
524270 pages RAM
11529 pages reserved
61072 pages shared
497066 pages non-shared
...
...
Out of memory: Kill process 5919 (mysqld) score 25 or sacrifice child
Killed process 5919 (mysqld) total-vm:2126812kB, anon-rss:29312kB, file-rss:0kB
init: mysql main process (5919) killed by KILL signal
init: mysql main process ended, respawning
apache2 invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
apache2 cpuset=/ mems_allowed=0
...
I'm guessing that "bitcoind invoked oom-killer" caused the server to run out of memory which caused the server to kill mysqld. Am I correct?
I have 2 GB of memory. This is what shows on "top":
Mem: 2050964k total, 1976288k used, 74676k free, 18068k buffers
Swap: 1048572k total, 948164k used, 100408k free, 742556k cached
According to "top", bitcoind usually uses approximately 30% of memory (which I think is WAY TOO much). My server is mainly for my site that runs bitcoind. There is little traffic, so Apache cannot be using much memory. I would've assume that 2 GB is overkill.
What is causing "bitcoind invoked oom-killer"? How can I prevent this from happening?