How the MySQL handles disk full

Source: Internet
Author: User

This article mainly describes the way in which MySQL responds to a disk full error (such as "No remaining space on the device"), and how to respond to a quota error (such as write failure or "Reach User screen limit").

The content described in this article is related to writing to the MyISAM table. It is also useful for writing binary log files and binary index files, but the application of "row" and "record" should be considered "event".

When a full disk condition occurs, MySQL will:

Check every minute to see if there is enough space to write to the current line. If there is enough space, it will continue as if nothing had happened.

Write 1 entries to the log file every 10 minutes to alert the disk to full status.

To mitigate the problem, the following measures may be taken:

To continue, you need only enough disk space to insert all the records.

To discard a thread, you must use the Mysqladmin kill. The thread will be discarded the next time the disk is checked (1 minutes).

Other threads may be waiting for the table that is causing the full state of the disk. If there are several "locked" threads, kill a thread that is waiting under full disk conditions to allow other threads to continue.

The exception to the preceding behavior is when you use the repair table or optimize table, or when the index is created in a batch operation after the load DATA INFILE or ALTER TABLE statement. All of these statements create large temporary files that, if preserved, can cause major problems in other parts of the system. If the disk is full while the MySQL is performing this type of operation, it will delete the large temporary file and mark the table as crashing. However, for ALTER TABLE exceptions, the old table remains unchanged.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.