What happens to MySQL when the disk space is full?

Source: Internet
Author: User

What happens to MySQL when the disk space is full?

Guide

What happens to MySQL when the disk space is full? What should I do?

What will happen

When the disk space is full, MySQL cannot write any data, including writing data to the table and binlog, binlog-index, and other files.

Of course, because InnoDB can put dirty data in the memory first, it does not immediately show that it cannot be written, unless binlog is enabled, write requests will be blocked.

When MySQL detects that the disk space is full, it will:

  • Per minute: Check whether the space is released to write new data. When the remaining space is found, the data will continue to be written.
  • Every 10 minutes: If no space is found, a record is written into the log to report that the disk space is full (at this time, only a few bytes are enough ).

What should I do?

So what should we do when we find that the disk space is full? we suggest:

  • Increase the frequency of monitoring system detection to prevent recurrence;
  • Delete unnecessary files in time to release space;
  • If a thread is blocked because the disk is full, it can be killed first. It may work again when it is detected again in the next minute;
  • Some threads may be blocked because the disk is full, and other threads may be blocked. You can kill the thread that causes blocking, and other blocked threads will continue to work.

Exceptions

An exception is:

When the repair table or optimize table operation is performed, or the index is updated in batches after the load data infile or alter table operation is executed, these operations will create temporary files, when mysqld finds that the disk space is full during these operations, it will mark the involved TABLE as crashed and delete the temporary file (except for the alter table operation, mySQL will discard ongoing operations, delete temporary files, and release disk space ).

Note: When the mysqld process is accidentally killed during execution of these commands, the generated temporary files will not be automatically deleted and need to be deleted manually to release the disk space.

This article permanently updates the link address:

Related Article

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.