In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "what are the gluster performance tuning options". In the daily operation, I believe many people have doubts about the gluster performance tuning options. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "what are the gluster performance tuning options?" Next, please follow the editor to study!
1 write-behind (default on)
Gluster volume set tank write-behind on
Write Behind Translator (later written)
In general, writing is slower than reading. By using "aggregated background write" technology, write-behind translator has significantly improved the performance of writes. More specifically, a large number of small writes are concentrated to form a small, larger number of writes and perform background write processing (non-blocking). The post-write mode aggregates the write operations on the client side, reducing the number of network packets that must be delivered. On the server side, it helps the server optimize the disk seek time for writes.
Aggregate-size
This option determines the size of the block before the aggregate write operation. You can adjust this value according to your connection speed, RAM size, and workload. By default, this value is 128KB, which is good for most applications. Unlimited increase and decrease of this value may lead to performance degradation. You can gradually adjust and analyze, and slowly find an optimal result.
Flush-behind
This option can be set directly in the form of the command gluster volume set tank flush-behind, but in fact, this parameter is an option for write-behind, and if write-behind is off, just setting flush-behind should not make sense.
This option is also designed to improve the performance of dealing with a large number of small files. In this option, close () / flush () can be stacked in the background, allowing the client to process the next request. The default value is on.
Note:
Typically, protocol translator has an upper limit of 4MB for a request or forwarded packet. Therefore, if you use the above write-behind on the client side (as most will do), and the aggregate-size is greater than 4MB, it will not send a large packet.
2 read-ahead (default on)
Gluster volume set tank read-ahead on
Read Ahead Translator (pre-read)
Based on the default value, read-ahead prefetches some blocks sequentially. When your application is busy processing some data, GlusterFS can pre-read the next batch of data waiting to be processed. This makes the read operation smoother and faster. Moreover, it works like a read read-aggregator, that is, it aggregates a large number of fragmented read operations into a small number of larger read operations, thus reducing the load on the network and disk. Page-size describes the size of the block. Page-count describes the total number of read-ahead blocks.
Note:
This translator is more suitable for application in IB-verbs transport environment. The maximum speed of this connection can be achieved in an environment with 100-megabit and gigabit Ethernet interfaces and without read-ahead.
3 io-cache (default on)
Gluster volume set tank io-cache on
IO-Cache Translator
If loaded on the client side, it can help reduce the load on server (if client is reading some files and the file has not been modified during the two read operations). For example, the header file that needs to be accessed when compiling the kernel.
Type performance/io-cache
IO cache relay (performance/io-cache) is a kind of performance tuning relay, which is used to cache data that has been read to improve IO performance.
IO cache relays can cache data that has been read. This is useful for multiple applications accessing the same data multiple times, and if the read operation is much greater than the write operation (for example, IO cache is very suitable for environments that provide web services, a large number of clients will simply read files, and only a few will write files).
When the IO cache relay detects a write, it deletes the corresponding file from the cache.
The IO cache relay periodically verifies the consistency of the corresponding files in the cache according to the modification time of the files. Verify that the timeout is configurable.
4 quick-read (default on)
Gluster volume set tank quick-read on
Http://www.gluster.org/community/documentation/index.php/Translators/performance/quick-read
In terms of description, this option is only useful for fuse, and it does not work if the file size is larger than the default 64k.
Translator performance/quick-read
The repeater is used to improve the performance of reading small files.
It is very expensive to operate on the file system over the network, so quick-read uses the glusterfs internal get interface to execute multiple posix system calls open/read/close at a time, and a get call consists of: one open call + multiple read calls + one close call.
This translator improves performance of read on small files. Over a posix interface, files are read using the apis open, read and close. For a filesystem implemented over a network, the round trip overhead of these calls can be significant. Hence quick-read uses the glusterfs internal get interface to implement posix abstraction of using open/read/close for reading of files there by reducing the number of calls over network from n to 1 where n = no of read calls + 1 (open) + 1 (close).
Example:
Volume quick-read
Type performance/quick-read
Option cache-timeout nsecs (1 second)
Option max-file-size nbytes (64Kb)
Subvolumes client
End-volume
Cache-timeout
Cache invalidation verification time. Default is 1 second.
Timeout for validation of cached file. On timeout stats of the file is compared with that of cached copy. If the file is found to be changed after it is cached, the cache is flushed. The default timeout value is 1 second.
Max-file-size
The maximum value of a file that can be read using the get interface. The default value is 64KB. When the file is greater than this value, the standard open/read/close call is used.
Maximum size of the file that can be fetched using get interface. Files bigger than this are read using the normal open/read/close. Note that this option controls only how quick-read behaves. Irrespective of the value this option, the applications running on glusterfs continue to use the normal open/read/close interface. Default value of this option is 64 kilo bytes.
Glusterfs3.4 decomposes quick-read (3. 3 only translaotr) into open-behind and quick-read. It turns out that no matter what the purpose of manipulating the file, the original design is to get the real fd. After refactoring, according to the purpose of the file operation, if it is to modify the contents of the file, open the file in the background and operate. If it is just a similar operation such as fstat, it will be done using anonymous fd instead of waiting for the real fd. In this way, the performance is optimized according to the purpose of operation. In lookup, set xdata key as needed, and grab the contents of the file at the posix translator layer. The read operation returns the contents of the file when it is executed to the quick-read layer.
5 open-behind (default on)
Gluster volume set tank open-behind on
Perform open in the backend only when a necessary FOP arrives (e.g writev on the FD, unlink of the file). When option is disabled, perform backend open right after unwinding open ().
6 stat-prefetch (default on)
Namely: performance/md-cache
Gluster volume set tank stat-prefetch on
Meta-data caching translator in the volume .
There is a saying on the Internet:
To avoid client-side metadata inconsistencies, disable metadata cache on the client, that is, configure performance.md-cache-timeout 0.
May be correct, to be analyzed in depth, temporarily use the default value.
Force-readdirp parameters:
Convert all readdir requests to readdirplus to collect stat info on each entry.
7 io-threads (default on,16 thread)
Gluster volume set tank io-thread-count 16
IO thread relay (performance/io-threads) is a kind of performance tuning relay, which is used to increase the number of concurrent threads in IO to improve IO performance.
IO thread relay attempts to increase the ability of server background processes to read and write file metadata. Because GlusterFS services are single-threaded, using IO thread converters can greatly improve performance. This converter is best used on the server side and is loaded behind the server protocol converter.
The IO thread operation divides read and write operations into different threads. The total threads that exist at the same time are constant and configurable.
The previous description of io-threads in the GlusterFS Translators v1.3 manual may be different from the current implementation:
AIO adds asynchronous (background) read and write capabilities. By loading this translator, you can take advantage of server's free time to work on new tasks. When server handles read or write operations in DMA mode, CPU, memory, or network is not used. This translator can make better use of resources to deal with and increase the current Imax O performance.
Note:
1. Io-threads translator will have an effect only on top of unify or under Server protocol. If it is between unify and namespace brick, there will be no effect because there is no processing of the file io.
2. Thread-count' is less than or equal to your number of CPU.
At this point, the study on "what are the gluster performance tuning options" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.