Application Using Threads (ApplicationUsingThreads): The driver coordinates concurrent database operations (operations from different threads) by acquiring locks. Although locking prevents errors in the driver, it also decreases performance. If your application does not make ODBC calls from different threads, the driver has no reason to coordinate operations. In this case, the ApplicationUsingThreads attribute should be disabled (set to 0).
Note: If you are using a multi-threaded application, you must enable the Application Using Threads option.
Encryption Method (EncryptionMethod): Data encryption may adversely affect performance because of the additional overhead (mainly CPU usage) that is required to encrypt and decrypt data.
Fetch Size (FetchSize): Fetch Size can be used to adjust the trade-off between throughput and response time. In general, setting larger values for Fetch Size will improve throughput, but can slow the response time. For example, if an application attempts to fetch 100,000 rows from the data source and Fetch Size is set to 500, the driver must make 200 round trips across the network to get the 100,000 rows. If, however, Fetch Size is set to 2000, the driver only needs to make 50 trips to retrieve 100,000 rows. Network round trips are expensive, so generally, minimizing the network round trips increases throughput. For many applications, throughput is the primary performance measure, but for interactive applications, such as Web applications, response time (how fast the first set of data is returned) is more important than throughput. By specifying smaller values, you can improve response time, as there is less of a delay waiting for the server to transmit data.
Note: Fetch Size provides a suggestion to the driver as to the number of rows that should be returned to the application. The driver may fetch fewer rows to conserve memory when processing exceptionally wide rows.
JVM Arguments (JVMArgs): Used in conjunction with the Result Memory Size connection option, you can address memory and performance concerns by adjusting the max Java heap size using the JVM Arguments connection option. By increasing the max Java heap size, you increase the amount of data the driver accumulates in memory. This can reduce the likelihood of out-of-memory errors and improve performance by ensuring that result sets fit easily within the JVM's free heap space. In addition, when a limit is imposed by setting Result Memory Size to -1 or x, increasing the max Java heap size can improve performance by reducing the need to write to disk, or removing it altogether.
Read Preference (ReadPreference): This connection option allows you to specify your preference for which replica set members are read when executing queries. Executing queries against primary members (read-write server nodes) returns the most recent version of the data, but increases the workload of the primary members and may negatively affect performance. If your application does not require the most recent version of data, consider setting this connection option to read from secondary members (read-only server nodes) to improve performance.
Result Memory Size (ResultMemorySize): Since Result Memory Size specifies the maximum size of an intermediate result set that the driver holds in memory, it can affect performance in two ways. First, if the value of the result set is larger than the value specified for Result Memory Size, the driver writes a portion of the result set to disk. Since writing to disk is an expensive operation, performance losses will be incurred. Second, when you remove any limit on the size of an intermediate result set by setting Result Memory Size to 0, you can realize performance gains for result sets that easily fit within the JVM's free heap space. However, the same setting can diminish performance for result sets that barely fit within the JVM's free heap space.