我使用下表處理約15GB(壓縮的.gz)的iislog。 使用亞馬遜EMR(1箇中型主實例,4個大型核心實例,2個任務實例)。大約需要1個小時才能得到這個查詢的結果:蜂巢提示可降低亞馬遜EMR的100%Cpu利用率
select uri, cs_Cookie as Cookie, count(*) as hits from tmp1 group by cs_Cookie, uri order by hits Desc;
我看到每次在所有DataNode的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';
爲什麼這是件壞事? 100%的CPU意味着你的羣集很忙,如果你低於100%,這意味着你沒有完全利用你的羣集。 –
我在尋找爲什麼我的集羣未被充分利用。我希望它是100% – Programmer