-
Notifications
You must be signed in to change notification settings - Fork 28.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-50811] Support enabling JVM profiler on driver
### What changes were proposed in this pull request? SPARK-46094 added JVM profiling support for the executor, this PR extends it to support the driver. ### Why are the changes needed? It's also valuable to profile the driver when hits some driver-side performance issues, for example, some catalyst rules may not be efficient and occupy too much CPU time. ### Does this PR introduce _any_ user-facing change? Yes, new feature. ### How was this patch tested? I tested the functionality works well on both YARN client and cluster modes. YARN client mode ``` bin/spark-submit run-example \ --master yarn \ --deploy-mode client \ --conf spark.plugins=org.apache.spark.profiler.ProfilerPlugin \ --conf spark.profiler.driver.enabled=true \ --conf spark.profiler.executor.enabled=true \ --conf spark.profiler.executor.fraction=1 \ --conf spark.profiler.dfsDir=hdfs:///spark-profiling \ SparkPi 100000 ``` ``` $ hadoop fs -ls /spark-profiling/application_1736320707252_0035 Found 49 items -rw-rw---- 3 hadoop supergroup 16335722 2025-01-16 11:00 /spark-profiling/application_1736320707252_0035/profile-driver.jfr -rw-rw---- 3 hadoop supergroup 4861636 2025-01-16 11:00 /spark-profiling/application_1736320707252_0035/profile-exec-1.jfr -rw-rw---- 3 hadoop supergroup 3321751 2025-01-16 11:00 /spark-profiling/application_1736320707252_0035/profile-exec-10.jfr -rw-rw---- 3 hadoop supergroup 3084930 2025-01-16 11:00 /spark-profiling/application_1736320707252_0035/profile-exec-11.jfr ... ``` YARN cluster mode ``` bin/spark-submit run-example \ --master yarn \ --deploy-mode cluster \ --conf spark.plugins=org.apache.spark.profiler.ProfilerPlugin \ --conf spark.profiler.driver.enabled=true \ --conf spark.profiler.executor.enabled=true \ --conf spark.profiler.executor.fraction=1 \ --conf spark.profiler.dfsDir=hdfs:///spark-profiling \ SparkPi 100000 ``` ``` $ hadoop fs -ls /spark-profiling/application_1736320707252_0036_1 Found 49 items -rw-rw---- 3 hadoop supergroup 14579297 2025-01-16 11:04 /spark-profiling/application_1736320707252_0036_1/profile-driver.jfr -rw-rw---- 3 hadoop supergroup 4615154 2025-01-16 11:04 /spark-profiling/application_1736320707252_0036_1/profile-exec-1.jfr -rw-rw---- 3 hadoop supergroup 3043193 2025-01-16 11:04 /spark-profiling/application_1736320707252_0036_1/profile-exec-10.jfr -rw-rw---- 3 hadoop supergroup 2969970 2025-01-16 11:04 /spark-profiling/application_1736320707252_0036_1/profile-exec-11.jfr ... ``` ### Was this patch authored or co-authored using generative AI tooling? No. Closes #49483 from pan3793/SPARK-50811. Authored-by: Cheng Pan <chengpan@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
- Loading branch information
1 parent
0ca9633
commit 90801c2
Showing
4 changed files
with
81 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters