博客由digitalocean驱动,有5天了,整体感觉不错,不过数据库挂掉了不下两次了,由于前几日没注意,看到阿里云发来的监测日志,才意识到宕机时间那么久。联系了客服,客服给的建议,竟然是让升级服务,说是512内存的vps支撑不了。
这个确实有些让人难以接受了,我流量少的可怜,不存在大的波动,怎么可能频繁宕机呢?继续用两天试试,如果不行的话,就重装试试,实在不行就用完这个月再换回ec2,毕竟稳定比什么都重要。
附上客服的奇葩解决办法:
The most common reason why MySQL is not running is that it stopped or failed to start as a result of not enough memory.
This can usually be seen by attempting to start the mysql server (“service mysql start” on Ubuntu and some other systems) and then reviewing the mysql error log (usually in /var/log/mysql/error.log or similar file path).
A useful program to review the logs one page at a time is “less” –for example:
less /var/log/mysql/error.log
If you see memory issues such as “mmap can’t allocate” then you can be sure that you are having memory issues.
Potential solutions are:
1) upsize to a larger server. We recommend at least a 1GB droplet for any server utilizing a MySQL database.
2) Enable swap space, which functions in the same way as RAM, except it’s slower since it’s using disk space to simulate RAM. Your system uses this only in the case where you run out of RAM, and it’ll likely result in slower responses from your site, but if you add enough swap (generally twice as much as the amount of RAM you have is a safe bet) it should prevent MySQL from crashing and causing your site to go down. You can find a guide relevant to your Linux distribution here:
有点店大欺客的感觉了,之前哪怕用000webhost都没有这么脆弱。