github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/docs/user_docs/kubeblocks-for-kafka/configuration-recommendations-for-production-environments.md (about) 1 --- 2 title: Resource description 3 description: Kafka resource description 4 keywords: [kafka, java heap, hardware resource] 5 sidebar_position: 2 6 sidebar_label: Resource description 7 --- 8 9 # Resource Description 10 11 ## Java Heap 12 13 Kafka Server's JVM Heap configuration, production environment can refer to the official recommended configuration: 14 15 ```bash 16 -Xmx6g -Xms6g -XX:MetaspaceSize=96m -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:G1HeapRegionSize=16M -XX:MinMetaspaceFreeRatio=50 -XX:MaxMetaspaceFreeRatio=80 -XX:+ExplicitGCInvokesConcurrent 17 ``` 18 19 - Combined mode 20 When creating a Kafka Cluster, specify the `--broker-heap` parameter. 21 - Separated mode 22 When creating a Kafka Cluster, specify the component parameters with the `--broker-heap`; specify controller with the `--controller-heap` parameter. 23 24 :::note 25 26 When modifying the Java Heap configuration, attention should be paid to the resources allocated to the Cluster at the same time. For example, `--memory=1Gi`, but `-Xms` in `--broker-heap` is specified as `6g`, the broker service will not start normally due to insufficient memory. 27 28 ::: 29 30 ## Hardware resources 31 32 It is recommended to use the following hardware resource in a production environment: 33 34 - `-cpu` >= 16 cores 35 - `-memory` >= 64Gi 36 37 Since Kafka uses a large amount of Page Cache to improve read and write speed, memory resources outside the heap memory allocated can improve overall performance. 38 39 - `-storage` configure it according to the specific situations 40 41 The default compression algorithm for Kafka Cluster is `compression.type=producer`, which is specified by the Producer end. Refer to the average message size of the Topic, compression ratio, number of Topic replicas, and data retention time to perform a comprehensive evaluation.