21.5. Small File Performance Enhancements
Metadata-intensive workloadis the term used to identify such workloads. A few performance enhancements can be made to optimize the network and storage performance and minimize the effect of slow throughput and response time for small files in a Red Hat Gluster Storage trusted storage pool.
You can set the
server.event-thread values for the client and server components. Setting the value to 4, for example, would enable handling four network connections simultaneously.
# gluster volume set VOLNAME client.event-threads <value>
Example 21.1. Tuning the event threads for a client accessing a volume
# gluster volume set test-vol client.event-threads 4
# gluster volume set VOLNAME server.event-threads <value>
Example 21.2. Tuning the event threads for a server accessing a volume
# gluster volume set test-vol server.event-threads 4
# gluster volume info VOLNAME
It is possible to see performance gains with the Red Hat Gluster Storage stack by tuning the number of threads processing events from network connections. The following are the recommended best practices to tune the event thread values.
- As each thread processes a connection at a time, having more threads than connections to either the brick processes (
glusterfsd) or the client processes (
gfapi) is not recommended. Due to this reason, monitor the connection counts (using the
netstatcommand) on the clients and on the bricks to arrive at an appropriate number for the event thread count.
- Configuring a higher event threads value than the available processing units could again cause context switches on these threads. As a result reducing the number deduced from the previous step to a number that is less that the available processing units is recommended.
- If a Red Hat Gluster Storage volume has a high number of brick processes running on a single node, then reducing the event threads number deduced in the previous step would help the competing processes to gain enough concurrency and avoid context switches across the threads.
- If a specific thread consumes more number of CPU cycles than needed, increasing the event thread count would enhance the performance of the Red Hat Gluster Storage Server.
- In addition to the deducing the appropriate event-thread count, increasing the
server.outstanding-rpc-limiton the storage nodes can also help to queue the requests for the brick processes and not let the requests idle on the network queue.
- Another parameter that could improve the performance when tuning the event-threads value is to set the
performance.io-thread-count(and its related thread-counts) to higher values, as these threads perform the actual IO operations on the underlying file system.
21.5.1. Enabling Lookup Optimization
cluster.lookup-optimizeconfiguration option enables DHT lookup optimization. To enable this option run the following command:
# gluster volume set VOLNAME cluster.lookup-optimize <on/off>\