carbondata连接数优化

一,背景

  carbondata的入库采用arbonData Thrift Server方式提供,由于存在异常的入库segments但是显示状态是success,所以每天运行另一个博客中的脚本,出现连接超时,运行不正常,排查是每天连接数太多,每天将segments都遍历一遍。

二 优化策略

a,策略一:
1,通过添加spark的调度池
在Spark中,调度池(Scheduler Pool)用于为不同的作业分配资源池,以控制其执行优先级。设置调度池可以帮助管理不同作业之间的资源争用情况。要使用调度池,您需要配置Fair Scheduler并创建相应的调度池配置文件。
1-1 设置调度池
spark.sql.hive.thriftServer.scheduler.pool=my-pool
1-2配置调度池文件
cp fairscheduler.xml.template fairscheduler.xml

 <pool name="my-pool">
       <schedulingMode>FAIR</schedulingMode>
               <weight>1</weight>
                       <minShare>3</minShare>
                               <maxRunningApps>50</maxRunningApps>
                                       <maxResources>100g,50</maxResources>
                                               <minResources>4g,8</minResources>
                                                       <fairSharePreemptionTimeout>300</fairSharePreemptionTimeout>
                                                               <minSharePreemptionTimeout>120</minSharePreemptionTimeout>
                                                                       <fairSharePreemptionThreshold>0.5</fairSharePreemptionThreshold>
                                                                           </pool>
      
2,启用异步模式,提搞并发能力
 spark.sql.hive.thriftServer.async = true 
3,spark-default中配置

```xml
spark.sql.hive.thriftServer.scheduler.pool=my-pool
spark.sql.hive.thriftServer.thrift.port=10000
spark.sql.hive.thriftServer.idleSessionTimeout=3600
spark.sql.hive.thriftServer.async=true
4,启动命令
     /bin/spark-submit --master yarn   --conf spark.driver.maxResultSize=20g --conf spark.sql.hive.thriftServer.scheduler.pool=my-pool  --conf spark.scheduler.mode=FAIR \
    --conf spark.scheduler.allocation.file=$SPARK_HOME/conf/fairscheduler.xml --conf spark.sql.shuffle.partition=50 --driver-memory 25g --executor-cores 4 --executor-memory 5G --num-executors 10 --class org.apache.carbondata.spark.thriftserver.CarbonThriftServer $SPARK_HOME/carbonlib/apache-carbondata-2.X-bin-sparkx-hadoop2.x.x.jar 
通过指定spark.sql.hive.thriftServer.scheduler.pool设置
5,验证
    通过查看是否 有create pool和 Removed from pool
b,策略二:
    可以尝试通过zk进行负载均衡,这样还待测试

 

相关推荐

  1. carbondata连接优化

    2024-06-16 22:20:03       32 阅读
  2. Linux系统内核-TCP连接和网络等待时间设置优化

    2024-06-16 22:20:03       60 阅读
  3. mysql并发连接设置

    2024-06-16 22:20:03       53 阅读
  4. tomcat、mysql连接配置

    2024-06-16 22:20:03       50 阅读
  5. tcp 连接上限突破

    2024-06-16 22:20:03       37 阅读
  6. 如何排查oracle连接不足问题

    2024-06-16 22:20:03       33 阅读
  7. Spring Boot配置MySQL数据库连接

    2024-06-16 22:20:03       32 阅读
  8. MySql修改最大连接

    2024-06-16 22:20:03       40 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-16 22:20:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-16 22:20:03       101 阅读
  3. 在Django里面运行非项目文件

    2024-06-16 22:20:03       82 阅读
  4. Python语言-面向对象

    2024-06-16 22:20:03       91 阅读

热门阅读

  1. 【C++】计算代码中程序的时间差

    2024-06-16 22:20:03       32 阅读
  2. 10:Hello, World!的大小

    2024-06-16 22:20:03       31 阅读
  3. Shell 学习笔记 - 变量的类型 + 变量的赋值

    2024-06-16 22:20:03       23 阅读
  4. 4.组件间通信-v-model

    2024-06-16 22:20:03       32 阅读
  5. 路由组件和非路由组件区别:

    2024-06-16 22:20:03       33 阅读
  6. LeetCode热题3.无重复的最长字串

    2024-06-16 22:20:03       32 阅读
  7. 在 PHP 中怎样实现实时数据推送功能?

    2024-06-16 22:20:03       30 阅读
  8. 2813. 子序列最大优雅度 Hard

    2024-06-16 22:20:03       31 阅读
  9. springcloud入门与实践

    2024-06-16 22:20:03       24 阅读
  10. Python编程:从入门到实践(第3版)

    2024-06-16 22:20:03       40 阅读
  11. 大厂笔试真题讲解—美团23—小美的蛋糕切割

    2024-06-16 22:20:03       29 阅读
  12. C# 程序结构

    2024-06-16 22:20:03       30 阅读