Case in production environment No space left on device (inode full use case)

Source: Internet
Author: User

First case:

Problem:

If you want to write data to disk, you are prompted with the following error:

Check disk space through df-h, found not full, may I ask what is the reason?

answer :

It may be that the inode number is exhausted.

Df-i See if the inode count is exhausted.

Enterprise work in the mail temporary queue/var/spool/clientmquene It is easy to get a large number of small files that cause no space left on device error.

The Clientmquene directory is available only if the SendMail service is installed. centos5.x default will be installed sendmial,centos6.5 default no sendmail.

Knowledge Points:

The CENTOS5 series system installs the Sendmail service by default, so the path to the temporary storage location of the message/var/spool/clientmqueue/.

CentOS6 does not install the SendMail service by default, but instead installs the Postfix service, so the path to the mail storage location is/var/postfix/maildrop/.

The above two directories are easily filled with garbage files, resulting in insufficient inode count, resulting in the inability to put files.

When the scheduled task execution end does not add >/dev/null 2>&1, the scheduled task will have a large number of small files in the above directory

second case:

A 100M (the total size of the block, the number of blocks and the size of a single block) partition, write 0.5K files or write 1 m files, respectively, how many can write? Why?

Answer:
    1. The default partition is usually sufficient for large files to be inode. The number of blocks will be consumed faster, block 4K, 1M files will not have disk waste, so the number of files is about 100/1=100.
    2. 0.5k,inode for small files can be consumed much faster. The number of blocks in the default partition is greater than the number of inode. Each small file will occupy an inode and a block. So the number of final files is that the inode consumes, and the total amount of files is the number of inode.
Knowledge Points:
      1. The inode is the file attribute information (also contains pointers to file entities), the default size is 128 bytes (C5), 256 bytes (C6).
      2. Block is the actual content of the file, the default size of 1K (boot) or 4K (non-system partition).
      3. A file must occupy at least one inode and one block.
      4. The default partition is usually sufficient for the number of inode. And the number of blocks will be consumed faster.

Case in production environment No space left on device (inode full use case)

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.