5.5. Speeding up discard operations


VDO sets a maximum allowed size of DISCARD (TRIM) blocks for all LVM-VDO devices on the system. The default value is 1, which corresponds to 8 sectors or 4KB maximum. Increasing the DISCARD size can significantly improve the speed of the discard operations. However, there is a tradeoff between improving discard performance and maintaining the speed of other write operations.

The optimal size of the DISCARD sector depends on the storage stack. Both very large and very small DISCARD blocks can potentially degrade the performance. To determine the correct size of the sector, you might need to experiment with different values. Conduct experiments with different values to discover one that delivers satisfactory results.

For example, for an LVM-VDO volume that stores a local file system, it is optimal to use the default value. For an LVM-VDO volume that serves as a SCSI target, a moderately large DISCARD size, works best, for example 256 blocks which corresponds to a 1 MB discard. It is recommended that the maximum DISCARD size does not exceed 2560 blocks, which translates to 5 MB discard. When choosing the size, make sure it is a multiple of 8, because VDO might not handle discards effectively if they do not align with an 8 sector boundary.

Procedure

  1. Deactivate the LVM-VDO volume:

    # lvchange -an <vg_name>/<vdo_volume>
  2. Set the new maximum size for the DISCARD sector:

    # lvchange --vdosettings "vdo_max_discard=<value>"
  3. Activate the LVM-VDO volume:

    # lvchange -ay <vg_name>/<vdo_volume>

Verification

  • Verify that the discard value has been changed successfully:

    # lvs -o vdo_max_discard <vg_name>/<vdo_volume>
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2026 Red Hat
トップに戻る