Rate This Document
Findability
Accuracy
Completeness
Readability

Basic Component Parameters

Scheduler Subsystem

Table 1 Scheduler subsystem – system parameters

Parameter Name

Parameter Description

Value Range

Performance-Sensitive Scenario

Tuning Suggestion

Parameter Viewing and Setting

kernel.numa_balancing

Automatic NUMA balancing

{0, 1}

-

If CPU core binding is not required, set this parameter to 1.

Viewing: sysctl param

Setting: sysctl param=value

NOTE:

In the preceding commands, param indicates the parameter name and value indicates the parameter value.

kernel.sched_child_runs_first

CPU scheduling priority of a subprocess

{0, 1}

TensorFlow Serving

-

kernel.sched_cluster

Cluster scheduling affinity

{0, 1}

MySQL, Redis, TensorFlow Serving

Set this parameter to 1 to enable cluster scheduling affinity.

kernel.sched_migration_cost_ns

Minimum cost for process migration

[100000, 5000000]

TensorFlow Serving

-

kernel.sched_nr_migrate

Number of tasks migrated by the scheduler during load balancing

[1, 128]

TensorFlow Serving

-

kernel.sched_wakeup_granularity_ns

Scheduling delay threshold for woken tasks

[100000, 15000000]

TensorFlow Serving

-

I/O Subsystem

Table 2 I/O subsystem – system parameters

Parameter Name

Parameter Description

Value Range

Performance-Sensitive Scenario

Tuning Suggestion

Parameter Viewing and Setting

max_sectors_kb

Data size of a single I/O operation on a block device

[68, 128]

MySQL

For sequential read/write-intensive services, set this parameter to a larger value to increase the throughput. For random I/O latency-sensitive services, set this parameter to a smaller value to reduce the response time.

Viewing or modifying the file content:

/sys/block/block_device/queue/max_sectors_kb

NOTE:

In the preceding command, block_device indicates the block device name.

scheduler

Block device I/O scheduling policy

{mq-deadline, kyber,bfq, none}

MySQL, openGauss

Set this parameter based on the application type.

Viewing or modifying the file content:

/sys/block/block_device/queue/scheduler

Memory Management Subsystem

Table 3 Memory management subsystem – system parameters

Parameter Name

Parameter Description

Value Range

Performance-Sensitive Scenario

Tuning Suggestion

Parameter Viewing and Setting

transparent_hugepage_mode

Transparent huge page status

{madvise, never, always}

Redis, Hive, Spark, Kafka, TensorFlow Serving

Set this parameter to always.

Viewing or modifying the file content:

/sys/kernel/mm/transparent_hugepage/enabled

vm.dirty_background_ratio

Maximum percentage of memory that can become dirty before background flushing of dirty pages to drives starts, relative to the total memory size

[0, 100]

RocksDB

In latency-sensitive application scenarios, increase the parameter value to reduce the drive flushing frequency and latency fluctuation.

Viewing: sysctl param

Setting: sysctl param=value

vm.max_map_count

Maximum number of memory mapping (mmap) regions that can be created by a single process

[65530, 10000000]

RocksDB

Increase the number of mmap regions as required.

vm.vfs_cache_pressure

Tendency of reclaiming the memory which is used for caching of directory and inode objects (VFS caches)

[0, 500]

RocksDB

To prevent the caches from occupying too much memory, increase the parameter value when the memory space becomes insufficient.

Network Subsystem

Table 4 Network subsystem – system parameters

Parameter Name

Parameter Description

Value Range

Performance-Sensitive Scenario

Tuning Suggestion

Parameter Viewing and Setting

net.core.rps_sock_flow_entries

Size of the Receive Packet Steering (RPS) hash table

[0, 131072]

-

Set this parameter to a relatively large value.

Viewing: sysctl param

Setting: sysctl param=value

Java Platform

Table 5 Java Platform parameters

Parameter Name

Parameter Description

Value Range

Parameter Viewing and Setting

AlwaysPreTouch

Indicates whether the JVM accesses and submits the heap memory to the physical memory during JVM initialization

{on, off}

  • on: -XX:+param
  • off: -XX:-param

G1HeapRegionSize

Minimum region size of the G1 heap

{1m, 2m, 4m, 8m, 16m, 32m}

-XX:param=value

G1MaxNewSizePercent

Maximum percentage of the G1 young generation in the heap

[20, 40]

-XX:param=value

Set the parameter together with -XX:+UnlockExperimentalVMOptions.

G1NewSizePercent

Initial percentage of the G1 young generation in the heap

[20, 40]

G1UseAdaptiveIHOP

Indicates whether to enable adaptive Initiating Heap Occupancy Percent (IHOP)

{on, off}

  • on: -XX:+param
  • off: -XX:-param

Set the parameter together with -XX:+UnlockExperimentalVMOptions.

MaxGCPauseMillis

Target for the maximum GC pause time

[200, 500]

-XX:param=value

MaxJavaStackTraceDepth

Maximum depth of an abnormal stack trace

[512, 1024]

ParallelGCThreads

Number of STW worker threads

[16, 128]

UseNUMA

Indicates whether to enable NUMA optimization

{on, off}

  • on: -XX:+param
  • off: -XX:-param

Set the parameters based on the configuration mechanism of the specific application. For example:

  • Hive: Set the parameters using the startup parameters. For example, --hiveconf hive.tez.java.opts="-XX:+param -XX:param=value".
  • Flink: Set the parameters in the configuration file. For example, the env.java.opts configuration item is -XX:+param -XX:param=value.