首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >在amazon EMR上降低100% Cpu使用率的配置单元提示

在amazon EMR上降低100% Cpu使用率的配置单元提示
EN

Stack Overflow用户
提问于 2013-06-04 17:39:39
回答 1查看 1.7K关注 0票数 1

我使用下表来处理大约15 am (.gz压缩)的iislog。使用amazon EMR (1个中型主实例、4个大型核心实例、2个任务实例)。甚至需要1个小时才能得到这个查询的结果:

select uri, cs_Cookie as Cookie, count(*) as hits from tmp1 group by cs_Cookie, uri order by hits Desc;

我看到所有DataNodes上的cpu利用率都是100%。那么,有没有人可以建议如何减少查询的时间和cpu的使用率呢?

表定义:

create external table marData(logdate string, time string, computername string, clientip string, uri string, qs string, localfile string, status string, referer string, w3status string, sc_bytes string, cs_bytes string, w3wpbytes string, cs_username string, cs_user_agent string, time_local string, timetakenms string, sc_substatus string, s_sitename string, s_ip string, s_port string, RequestsPerSecond string, s_proxy string, cs_version string, c_protocol string, cs_method string, cs_Host string, EndRequest_UTC string, date_local string, CPU_Utilization string, cs_Cookie string, BeginRequest_UTC string) partitioned by (month string) ROW FORMAT SERDE
'org.apache.hadoop.hive.contrib.serde2.RegexSerDe'
               WITH SERDEPROPERTIES (
               "input.regex" ="([0-9-]+) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) (\".*\"|[^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) (\".*\"|[^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) (\".*\"|[^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([0-9-]+ [0-9:.]+) ([^ ]*) ([^ ]*) (\".*\"|[^ ]*) ([0-9-]+ [0-9:.]+)",
               "output.format.string"="%1$s %2$s %3$s %4$s %5$s %6$s %7$s %8$s %9$s %10$s %11$s %12$s %13$s %14$s %15$s %16$s %17$s %18$s %19$s %20$s %21$s %22$s %23$s %24$s %25$s %26$s %27$s %28$s %29$s %30$s %31$s %32$s")
location 's3://logdata/Mar';
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-06-09 17:44:24

在这个查询过程中,节点的内存使用情况如何?

正如@Charles Menguy在评论中所说,高cpu使用率本身并不是一件坏事。

您可以考虑使用更多、更大的节点来在更短的时间内完成作业。这可能需要一些实验,但这对你来说可能更便宜。例如,我们发现切换到更大的节点(我们使用m2.xlarge)可以使我们的作业比最初使用更多m1.large实例时运行得更快。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16914473

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档