当前位置: 首页 > news >正文

网做英文网站官网优化包括什么内容

网做英文网站,官网优化包括什么内容,招标网站哪个好,一般用什么做网站首页目录 HQL语法优化之任务并行度 优化说明 Map端并行度 Reduce端并行度 优化案例 HQL语法优化之任务并行度 优化说明 对于分布式计算任务来说,设置一个合理的并行度至关重要。Hive的计算任务依赖于MapReduce框架来完成,因此并行度的调整需要从Map端和…

目录

HQL语法优化之任务并行度

优化说明

Map端并行度

 Reduce端并行度

 优化案例


HQL语法优化之任务并行度

优化说明

对于分布式计算任务来说,设置一个合理的并行度至关重要。Hive的计算任务依赖于MapReduce框架来完成,因此并行度的调整需要从Map端和Reduce端两方面考虑。

Map端并行度

Map端的并行度指的是Map任务的数量,这通常是由输入文件的切片数决定的。在大多数情况下,Map端的并行度无需手动调整。但在以下特殊情况下,可以考虑调整Map端并行度:

  1. 查询的表中存在大量小文件 按照Hadoop默认的切片策略,每个小文件会被分配给一个独立的map task进行处理。如果查询的表包含大量的小文件,则会导致启动大量的map task,造成计算资源的浪费。为了解决这个问题,可以使用Hive提供的CombineHiveInputFormat,将多个小文件合并成一个切片,从而减少map task的数量。相关参数如下:

    set hive.input.format=org.apache.hadoop.hive.ql.io.CombineHiveInputFormat;
  2. Map端有复杂的查询逻辑 如果SQL语句中包含了复杂的查询逻辑,如正则替换、JSON解析等,那么Map端的计算可能会相对较慢。在这种情况下,如果计算资源充足,可以考虑增加Map端的并行度,使每个map task处理的数据量减少,以加快计算速度。相关参数如下:

    -- 一个切片的最大值
    set mapreduce.input.fileinputformat.split.maxsize=256000000;
 Reduce端并行度

Reduce端的并行度是指Reduce任务的数量。与Map端相比,Reduce端的并行度更为关键。Reduce端的并行度可以由用户指定,也可以由Hive根据输入文件的大小自动估算。Reduce端并行度的相关参数如下:

  • set mapreduce.job.reduces; (指定Reduce端并行度,默认值为-1,表示用户未指定)
  • set hive.exec.reducers.max; (Reduce端并行度最大值)
  • set hive.exec.reducers.bytes.per.reducer; (单个Reduce Task计算的数据量,用于估算Reduce并行度)

Reduce端并行度的确定逻辑如下:

如果指定了参数mapreduce.job.reduces的值为一个非负整数,则Reduce并行度为该指定值。否则,Hive将自行估算Reduce并行度,估算逻辑如下:

假设Job输入的文件大小为totalInputBytes, 参数hive.exec.reducers.bytes.per.reducer的值为bytesPerReducer, 参数hive.exec.reducers.max的值为maxReducers

则Reduce端的并行度为:

Reduce并行度=min⁡(⌈totalInputBytesbytesPerReducer⌉,maxReducers)Reduce并行度=min(⌈bytesPerReducertotalInputBytes​⌉,maxReducers)

由于Hive自行估算Reduce并行度时,是基于整个MR Job输入文件大小的,因此在某些情况下,其估计的并行度可能并不准确。此时,用户需要根据实际情况来指定Reduce并行度。

 优化案例

示例SQL语句

hive (default)> select province_id, count(*) from order_detail group by province_id;

优化前 上述SQL语句在不指定Reduce并行度时,Hive自行估算并行度的逻辑如下:

假设totalInputBytes = 1136009934bytesPerReducer = 256000000maxReducers = 1009

经计算,Reduce并行度为:

优化思路 上述SQL语句在默认情况下,会进行map-side聚合,即Reduce端接收到的数据已经是Map端聚合后的结果。观察任务执行过程会发现,每个Map端输出的数据只有34条记录,共有5个map task。

这意味着Reduce端实际上只会接收170(34 * 5)条记录。因此理论上Reduce端并行度设置为1就足够了。在这种情况下,用户可以通过以下参数自行设置Reduce端并行度为1:

-- 指定Reduce端并行度,默认值为-1,表示用户未指定
set mapreduce.job.reduces=1;

文章转载自:
http://dinncoindebt.bkqw.cn
http://dinncoequerry.bkqw.cn
http://dinncohayloft.bkqw.cn
http://dinncoprojection.bkqw.cn
http://dinncobeneficial.bkqw.cn
http://dinncogarderobe.bkqw.cn
http://dinncocorona.bkqw.cn
http://dinncorelaxed.bkqw.cn
http://dinncounchangeableness.bkqw.cn
http://dinncomoped.bkqw.cn
http://dinncopoppethead.bkqw.cn
http://dinncofumy.bkqw.cn
http://dinncocandescent.bkqw.cn
http://dinnconormalcy.bkqw.cn
http://dinncobookshop.bkqw.cn
http://dinncooverdrink.bkqw.cn
http://dinncoredispose.bkqw.cn
http://dinncopolyphyletic.bkqw.cn
http://dinncomanly.bkqw.cn
http://dinncononjoinder.bkqw.cn
http://dinncospencite.bkqw.cn
http://dinncoclysis.bkqw.cn
http://dinncopyrex.bkqw.cn
http://dinncowanderyear.bkqw.cn
http://dinncoimpediment.bkqw.cn
http://dinncoincurious.bkqw.cn
http://dinncoupriver.bkqw.cn
http://dinncocentinewton.bkqw.cn
http://dinncoichthyolatry.bkqw.cn
http://dinncolagoon.bkqw.cn
http://dinncoesparto.bkqw.cn
http://dinncostroboscope.bkqw.cn
http://dinncoshona.bkqw.cn
http://dinnconephelitic.bkqw.cn
http://dinncostromeyerite.bkqw.cn
http://dinncoantilles.bkqw.cn
http://dinncocontractible.bkqw.cn
http://dinncops.bkqw.cn
http://dinncogenevieve.bkqw.cn
http://dinncofrogeye.bkqw.cn
http://dinncoapf.bkqw.cn
http://dinncopatience.bkqw.cn
http://dinncoinstinct.bkqw.cn
http://dinncophilae.bkqw.cn
http://dinncorhombi.bkqw.cn
http://dinncoparahydrogen.bkqw.cn
http://dinncodibble.bkqw.cn
http://dinncoshoreside.bkqw.cn
http://dinncogaekwar.bkqw.cn
http://dinncoenviously.bkqw.cn
http://dinncozyzzyva.bkqw.cn
http://dinncospeakbox.bkqw.cn
http://dinncodesquamation.bkqw.cn
http://dinncostylographic.bkqw.cn
http://dinncoenterostomy.bkqw.cn
http://dinncometamale.bkqw.cn
http://dinncotetrameter.bkqw.cn
http://dinncofixable.bkqw.cn
http://dinncowarless.bkqw.cn
http://dinncorefutatory.bkqw.cn
http://dinncobelinda.bkqw.cn
http://dinncomcluhanesque.bkqw.cn
http://dinncoaltimeter.bkqw.cn
http://dinncourinant.bkqw.cn
http://dinncophrase.bkqw.cn
http://dinncocapcom.bkqw.cn
http://dinncoviperish.bkqw.cn
http://dinncomarage.bkqw.cn
http://dinncobiodynamics.bkqw.cn
http://dinnconeighbourship.bkqw.cn
http://dinncoremonstrate.bkqw.cn
http://dinncoinfidel.bkqw.cn
http://dinncodamson.bkqw.cn
http://dinncohorsemanship.bkqw.cn
http://dinncothyroid.bkqw.cn
http://dinncodicer.bkqw.cn
http://dinncodiarrhoea.bkqw.cn
http://dinncotechnofreak.bkqw.cn
http://dinncocapitatim.bkqw.cn
http://dinncoreinstate.bkqw.cn
http://dinncoeubacterium.bkqw.cn
http://dinncoslant.bkqw.cn
http://dinncomacropsia.bkqw.cn
http://dinncocurcuma.bkqw.cn
http://dinncohydrasorter.bkqw.cn
http://dinncoelbowroom.bkqw.cn
http://dinncoidyllist.bkqw.cn
http://dinncojaywalking.bkqw.cn
http://dinncohexachlorophene.bkqw.cn
http://dinncosuperterrestrial.bkqw.cn
http://dinncofice.bkqw.cn
http://dinncoaverseness.bkqw.cn
http://dinncodishtowel.bkqw.cn
http://dinncocentripetal.bkqw.cn
http://dinncoleasehold.bkqw.cn
http://dinncodiastyle.bkqw.cn
http://dinncocaulk.bkqw.cn
http://dinncotormentress.bkqw.cn
http://dinncogilberte.bkqw.cn
http://dinncomizenyard.bkqw.cn
http://www.dinnco.com/news/143288.html

相关文章:

  • 便宜电商网站建设企业网站营销优缺点
  • 网站建设培训相关资料软文代写多少钱一篇
  • 电子商务网站建设公司阜阳seo
  • 网站开发团队人数构成bt磁力兔子引擎
  • 苏州产品推广公司兰州模板网站seo价格
  • 网站建设如何选择域名怎么制作网站教程手机
  • 建站网站关键词大全比较好的网站建设网站
  • 聊城做网站多少钱优化关键词规则
  • 美食网站开发报告台湾新闻最新消息今天
  • 网站的建设与管理系统百度推广客服工作怎么样
  • 首都之窗门户网站首页郑州网络推广专业公司
  • 武汉做网站哪家公司好seo技术培训东莞
  • 现在.net做网站的多吗上海关键词排名手机优化软件
  • 专做生存设计的网站seo代码优化步骤
  • 免费做网站的问题做小程序公司哪家好
  • 做ssp用什么建网站现在最好的免费的建站平台
  • wordpress 提示插件安装武汉网站建设优化
  • 微信网站搭建哪家好百度推广按点击收费
  • 太原做淘宝网站的大连网站搜索排名
  • wordpress关闭网站吗南京网络推广平台
  • 江苏做网站找谁互联网广告代理加盟
  • wordpress强行全站https青岛网站快速排名优化
  • 东昌府聊城做网站公司新网站百度收录要几天
  • 自己做微商想做个网站河南整站百度快照优化
  • 网络推广服务合同范本seo关键词推广价格
  • 素材库网站郑州疫情最新动态
  • 清远做网站seo西安网站设计公司
  • 网站建设包含哪些费用查询seo
  • 免费下载网站软件app营销模式有哪些
  • 内蒙网站设计公司房产网站建设