【发布时间】:2018-03-24 00:10:43
【问题描述】:
我们使用 Spark2 Thrift 来运行 Hive 查询。
Thrift 是 HDP 2.6 的一部分,我们的 spark 版本是 2.1.0.2.6.0.3-8。
我们同时运行的查询越多,我们在驱动程序中遇到 OOM 的速度就越快。这些查询还包含 JOIN 和 UNION。
从 jstat 看来,似乎没有内存泄漏,但是无论给驱动程序多少内存,似乎永远都不够。同时运行的查询越多,Thrift 驱动程序开始执行完整 GC 直到崩溃的速度越快,因为完整 GC 无法清理旧内存(因为它正在被使用)。
OOM 永远不会发生在执行程序中,只会发生在驱动程序中。
是否有人使用 Thrift over spark 并遇到此问题?如果是这样 - 如何将 Thrift 驱动程序配置为在同时运行多个查询时不会在 OOM 上崩溃?
这些是我们使用的配置:
节俭火花驱动器:
- spark.driver.memory=15g
Thrift 火花执行器:
spark.executor.memory=10g
核数 = 7
来自 /usr/hdp/current/spark2-thriftserver/conf/spark-thrift-sparkconf.conf 的配置参数:
spark.broadcast.blockSize 32m
-
spark.driver.extraLibraryPath /usr/hdp/current/hadoop-client/lib/native:/usr/hdp/current/hadoop-client/lib/native/Linux-amd64-64
spark.driver.maxResultSize 0
spark.dynamicAllocation.enabled true
spark.dynamicAllocation.executorIdleTimeout 45s
spark.dynamicAllocation.initialExecutors 2
spark.dynamicAllocation.maxExecutors 15
spark.dynamicAllocation.minExecutors 0
spark.dynamicAllocation.schedulerBacklogTimeout 1s
spark.eventLog.dir hdfs:///spark2-history/
spark.eventLog.enabled true
-
spark.executor.extraLibraryPath /usr/hdp/current/hadoop-client/lib/native:/usr/hdp/current/hadoop-client/lib/native/Linux-amd64-64
spark.executor.memory 10g
spark.files.maxPartitionBytes 268435456
spark.files.openCostInBytes 33554432
spark.hadoop.cacheConf false
spark.history.fs.logDirectory hdfs:///spark2-history/
spark.history.provider org.apache.spark.deploy.history.FsHistoryProvider
spark.kryoserializer.buffer.max 2000m
spark.master 纱线客户端
spark.memory.offHeap.enabled true
spark.memory.offHeap.size 104857600
spark.scheduler.allocation.file /usr/hdp/current/spark2-thriftserver/conf/spark-thrift-fairscheduler.xml
spark.scheduler.mode 公平
spark.shuffle.service.enabled true
spark.sql.autoBroadcastJoinThreshold 1073741824
spark.sql.shuffle.partitions 100
spark.storage.memoryMapThreshold 8m
【问题讨论】:
-
我猜“Spark over Thrift”这个词更合适。
-
@elad-eldor 你有没有找到解决办法?
标签: out-of-memory thrift apache-spark-2.0