Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mongodb optimized pre-reading

2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Optimize the pre-reading

The BLOCKDEV command of LINUX is used to reduce the pre-read size and reduce the occupation of useless data in memory, thus optimizing IO performance.

RA represents the pre-read size (sector). The recommended value is 16-32. If the document is small, the pre-read value can be smaller before mongodb restart takes effect after modification.

Pre-read default 256 sectors with a size of 128K

Many of the mongodb are random visits, and the readhead should be set smaller. For example, you only read 10k, but you read 128k.

Root@db3-198 report report # blockdev

RO RA SSZ BSZ StartSec Size Device

Rw 128 512 4096 0 800166076416 / dev/sda

Rw 128 512 1024 2048 524288000 / dev/sda1

Rw 128 512 4096 1026048 799639863296 / dev/sda2

Rw 256 512 4096 0 53687091200 / dev/dm-0

Rw 256 512 4096 0 33822867456 / dev/dm-1

Rw 256 512 4096 0 712125710336 / dev/dm-2

Use the following command

Blockdev-setra 128 / dev/sda2

Represents a pre-read size of 128 to 512 bytes / sector = 64K

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report