Tuning JDK
Purpose
Replace the original JDK with BiSheng JDK to fully utilize the performance advantages of BiSheng JDK.
Procedure
Perform the following steps to replace the original JDK with BiSheng JDK:
- Download BiSheng JDK.
- Replace the existing JDK with BiSheng JDK.
- Stop the cluster service to prevent service exceptions caused by JDK switch.
- Extract the BiSheng JDK package and move it to /usr/local/.
1 2
tar -zxvf bisheng-jdk-8u262-linux-aarch64.tar.gz mv bisheng-jdk1.8.0_262 /usr/local/
- Rename the original JDK directory and replace it, and modify the directory permission.
Rename the original JDK directory, for example, rename jdk8u222-b10/ to jdk8u222-b10-openjdk/. Then rename the BiSheng JDK directory to the same directory name as the original JDK directory, for example, jdk8u222-b10/.
1 2 3
mv jdk8u222-b10/ jdk8u222-b10-openjdk/ mv bisheng-jdk1.8.0_262/ jdk8u222-b10/ chmod -R 755 jdk8u222-b10/
- Restart the cluster service to ensure that the JDK changes take effect.
- Modify the Spark configuration to make full use of the optimization features of BiSheng JDK.
- Open the Spark configuration file.
1vi /opt/HiBench-HiBench-7.0/conf/spark.conf - Press i to enter the insert mode. Change the value of spark.executor.extraJavaOptions.
1 2 3
spark.executor.extraJavaOptions -XX:+UnlockExperimentalVMOptions -XX:+EnableIntrinsicExternal -XX:+UseF2jBLASIntrinsics -Xms43g -XX:ParallelGCThreads=8
The value of -Xms (for example, 43g) should be adjusted according to the value of spark.executor.memory in /opt/HiBench-HiBench-7.0/conf/spark.conf. You are advised to set -Xms to the value of spark.executor.memory minus 1.
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the Spark configuration file.
Parent topic: Spark Tuning