未设置SWAP分区导致内存耗尽主机Hang死
这是一个真实的案例,在2009年,2010年,主机多次被Hang死,当时的情况是主机可以ping通,但ssh却连接不上,导致cluster无法切换,只能人工去重启那台被Hang死的
这是一个真实的案例,在2009年,2010年,主机多次被Hang死,当时的情况是主机可以ping通,但ssh却连接不上,导致cluster无法切换,只能人工去重启那台被Hang死的机器,才能正常切换。到底是什么原因引起的呢,在看了淘宝这篇文章后,
茅塞顿开,我们的主机是72G内存,48G是MySQL(Innodb_Buffer_Pool)内存缓冲池所用,但在机器正常的情况 下,free -m,发现内存已经超过了48G,这是因为其他程序或者系统模块又需要额外的内存,比如cp一个大文件,或者在主库上mysqldump数据库等等,这时 当物理内存不够用的时候,操作系统就会把MySQL所拥有的一部分地址空间映射到swap上去。而我们当时,没有建立swap分区是考虑到将分配给 MySQL的地址空间映射到swap上,导致性能会有突起波动,但这是一把双刃剑,香港服务器租用,虽然避免了使用swap分区,但结果会导致机器被Hang死。
所以就这个问题,我们后来的解决方案是:
一、增加2G SWAP分区,避免内存耗尽时,香港服务器,机器不会死机,可以给予些缓冲,重启前端程序释放MySQL压力。
二、增加内存监控,当内存使用率达到90%,通过重启MYSQL来释放内存,避免机器死机。
三、开发设计的前端CACHE层,减少了数据库层的压力。
在2011年至2012年10月,机器都运行稳定,虚拟主机,没有出现过宕机。
本文出自 “贺春旸的技术专栏” 博客,请务必保留此出处

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The Linux crash log is in "/var/log/"; the log log of "/var/log/" under Linux includes message, kernel error log demsg, etc.; the sa record is a performance file that records the operation of CPU, memory, etc. ;Use the sa file to view the CPU and memory conditions during the crash.

Reasons why computers often crash: 1. Motherboard problems; 2. Heat dissipation problems; 3. Computer relocation problems; 4. System problems; 5. Computer dust accumulation; 6. Freeze screen crash; 7. Huap screen crash; 8. Blue screen crash; 9 , Restart with warning; 10. Crash without warning; 11. Caused by memory failure; 12. Caused by graphics card failure; 13. Caused by motherboard failure or aging; 14. Caused by hard disk failure; 15. Caused by system failure.

Solution to the computer crash screen stuck: 1. Press the Ctrl+Alt+Delete key combination to open task management and restart the computer; 2. Try to disconnect the computer’s external devices; 3. Enter safe mode to eliminate the possibility of software conflicts. performance; 4. Restore the system to the most recent stable state; 5. Reinstall the operating system.

How to solve the problem of Win10 system not being able to open WPS when running WPS without responding? Wps is a software that we often use in daily office work, and its importance cannot be underestimated. However, after upgrading WPS to the 2016 version, many users find that there is an unresponsive problem when running WPS under Windows 10 system. What is going on? The editor below will show you the solution to the problem of unresponsiveness when running WPS on Windows 10 system. Cause analysis: Generally, if a user runs and installs the WPS2016 early version after upgrading the Win10 system, and runs Excel at the same time and encounters a "no response" problem, then it may be that the graphics card driver and O after the Win10 update

Many users will use the WPS software on the Win10 system, but many of them suddenly crash after using it. To solve this problem, today I will bring you the solution to the WPS crash in Win10. Come and learn together. What to do if WPS crashes in Win10: 1. The reason for this may be that the system disk is full, usually the C drive. It is recommended not to install software games on the C drive and affect the operation. 2. It is generally best to have more than one-third of the space on the local system disk remaining, otherwise it will easily cause a stuck situation. 3. If there is too much garbage in the computer, you can use 360 Security Guard to clean up the garbage and ensure the running speed of the computer. Download address >> 4. There are too many processes on the computer, resulting in no running memory space.

1. Force restart: Press and hold the volume down button and the power button on the left side of the phone, and press and hold until the Apple logo appears and release, and wait for the phone to automatically restart. 2. Enter recovery mode: Press and hold the volume up button and the power button on the left side of the phone, and press and hold the power button at the same time until the white Apple logo appears, then release the power button, and continue to hold the volume up button until the "Connect to iTunes" prompt appears. Release it at this time, and you can use iTunes to restore it. 3. Enter DFU mode: Press and hold the volume down button and the power button on the left side of the phone, press and hold for about 10 seconds, then release the power button to continue.

Linux swap space is a special hard disk space used for memory expansion in the Linux operating system. Its role is to provide additional virtual memory to ensure the normal operation of the system. Proper configuration and management of swap space can help maintain the stability and performance of the system regularly. It is the responsibility of the system administrator to monitor the usage of Swap space and adjust the size of the swap space according to the actual situation.

When using the win10 system, many computer users have discovered a problem, that is, the win10 system will freeze as soon as it enters the standby state. What is the cause of this problem? Come and take a look at the detailed solution tutorial ~ win10 freezes in standby How to solve: 1. There are many reasons for the crash. One is the problem of the graphics card driver. Check the update of the graphics card driver to see if there are any bugs. It is recommended to install a stable version of the graphics card driver. 2. Computer hardware failure. This requires users to check whether there are problems with the chassis hard disk, memory module and CPU motherboard. 3. After the computer crashes and restarts, perform the following operations, press + on the keyboard to open the run window, and then enter. 4. Then in the window, check the box below, and then click again. 5. Use + to open
