1. 程式人生 > >hiveserver 佔用記憶體過大的問題

hiveserver 佔用記憶體過大的問題

今天為了求解hiveserver佔用記憶體過大的問題,特地加了hive在apache的郵件列表,討論半天。特別說的是 裡面的人確實很熱情啊 ,外國人做事確實很認真,討論帖發的時候都狠詳細。

粘出一些記錄:

Did you update your JDK in last time? A java-dev told me that could be
a  issue in JDK _26
(https://forums.oracle.com/forums/thread.jspa?threadID=2309872), some
devs report a memory decrease when they use GC - flags. I'm quite not
sure, sounds for me to far away.

The stacks have a lot waitings, but I see nothing special.

- Alex

2011/12/12 王鋒 <
[email protected]
>: > > The hive log: > > Hive history file=/tmp/hdfs/hive_job_log_hdfs_201112121840_767713480.txt > 8159.581: [GC [PSYoungGen: 1927208K->688K(2187648K)] > 9102425K->7176256K(9867648K), 0.0765670 secs] [Times: user=0.36 sys=0.00, > real=0.08 secs] > Hive history file=/tmp/hdfs/hive_job_log_hdfs_201112121841_451939518.txt > 8219.455: [GC [PSYoungGen: 1823477K->608K(2106752K)] > 8999046K->7176707K(9786752K), 0.0719450 secs] [Times: user=0.66 sys=0.01, > real=0.07 secs] > Hive history file=/tmp/hdfs/hive_job_log_hdfs_201112121842_1930999319.txt > > Now we have 3 hiveservers and I set the concurrent job num to 4,but the Mem > still be so large .I'm mad, God > > have other suggestions ? > > 在 2011-12-12 17:59:52,"alo alt" <
[email protected]
>> 寫道: >>When you start a high-load hive query can you watch the stack-traces? >>Its possible over the webinterface: >>http://jobtracker:50030/stacks >> >>- Alex >> >> >>2011/12/12 王鋒 <[email protected]> >>> >>> hiveserver will throw oom after several hours . >>> >>> >>> At 2011-12-12 17:39:21,"alo alt" <
[email protected]
> wrote: >>> >>> what happen when you set xmx=2048m or similar? Did that have any negative effects for running queries? >>> >>> 2011/12/12 王鋒 <[email protected]> >>>> >>>> I have modify hive jvm args. >>>> the new args is -Xmx15000m -XX:NewRatio=1 -Xms2000m . >>>> >>>> but the memory used by hiveserver is still large. >>>> >>>> >>>> >>>> >>>> >>>> At 2011-12-12 16:20:54,"Aaron Sun" <[email protected]> wrote: >>>> >>>> Not from the running jobs, what I am saying is the heap size of the Hadoop really depends on the number of files, directories on the HDFS. Remove old files periodically or merge small files would bring in some performance boost. >>>> >>>> On the Hive end, the memory consumed also depends on the queries that are executed. Monitor the reducers of the Hadoop job, and my experiences are that reduce part could be the bottleneck here. >>>> >>>> It's totally okay to host multiple Hive servers on one machine. >>>> >>>> 2011/12/12 王鋒 <[email protected]> >>>>> >>>>> is the files you said the files from runned jobs of our system? and them can't be so much large. >>>>> >>>>> why is the cause of namenode. what are hiveserver doing when it use so large memory? >>>>> >>>>> how do you use hive? our method using hiveserver is correct? >>>>> >>>>> Thanks. >>>>> >>>>> 在 2011-12-12 14:27:09,"Aaron Sun" <[email protected]> 寫道: >>>>> >>>>> Not sure if this is because of the number of files, since the namenode would track each of the file and directory, and blocks. >>>>> See this one. http://www.cloudera.com/blog/2009/02/the-small-files-problem/ >>>>> >>>>> Please correct me if I am wrong, because this seems to be more like a hdfs problem which is actually irrelevant to Hive. >>>>> >>>>> Thanks >>>>> Aaron >>>>> >>>>> 2011/12/11 王鋒 <[email protected]> >>>>>> >>>>>> >>>>>> I want to know why the hiveserver use so large memory,and where the memory has been used ? >>>>>> >>>>>> 在 2011-12-12 10:02:44,"王鋒" <[email protected]> 寫道: >>>>>> >>>>>> >>>>>> The namenode summary: >>>>>> >>>>>> >>>>>> >>>>>> the mr summary >>>>>> >>>>>> >>>>>> and hiveserver: >>>>>> >>>>>> >>>>>> hiveserver jvm args: >>>>>> export HADOOP_OPTS="$HADOOP_OPTS -XX:NewRatio=1 -Xms15000m -XX:MaxHeapFreeRatio=40 -XX:MinHeapFreeRatio=15 -XX:+UseParallelGC -XX:ParallelGCThreads=20 -XX:+UseParall >>>>>> elOldGC -XX:-UseGCOverheadLimit -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps" >>>>>> >>>>>> now we using 3 hiveservers in the same machine. >>>>>> >>>>>> >>>>>> 在 2011-12-12 09:54:29,"Aaron Sun" <[email protected]> 寫道: >>>>>> >>>>>> how's the data look like? and what's the size of the cluster? >>>>>> >>>>>> 2011/12/11 王鋒 <[email protected]> >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I'm one of engieer of sina.com. We have used hive ,hiveserver several months. We have our own tasks schedule system .The system can schedule tasks running with hiveserver by jdbc. >>>>>>> >>>>>>> But The hiveserver use mem very large, usally large than 10g. we have 5min tasks which will be running every 5 minutes.,and have hourly tasks .total num of tasks is 40. And we start 3 hiveserver in one linux server,and be cycle connected . >>>>>>> >>>>>>> so why Memory of hiveserver using so large and how we do or some suggestion from you ? >>>>>>> >>>>>>> Thanks and Best Regards! >>>>>>> >>>>>>> Royce Wang

最上面   Alex發現一篇文章

https://forums.oracle.com/forums/thread.jspa?threadID=2309872說是 jdk_1.0.26存在洩露的風險,我們正在使用也正是同一個版本,看這個url裡文章說的也是誰也不能確認,而oracle方自然說不由其負責。
I tried with java6u29 and java7 and they work great. Actually on the production server we are running for almost 4 days with java7 and it's stable, no crash, no slowdown, no restart in this period, and with less maximum memory. If it's going to last for a week then I trust it will go on fine.
最後是有人用java6u29 和java7 執行 穩定。特別是java7.明天嘗試在hiveserver伺服器換用java7試試。

  append。。。。

今天改用jdk 7測試 情況基本一致,看來問題並不是 jvm問題。

使用jmap -heap 發現  hiveserver 新生代 並沒有去按照ratio設定的 那樣,最大容量還是預設的800m,這個對資料分析來說太小了,使用xmn配置新生代,並配置最大新生代大小,而且將gc機制改為cms,目前記憶體佔用穩定在 2.3g左右。

最後的引數 :

export HADOOP_OPTS="$HADOOP_OPTS  -Xms5000m -Xmn4000m -XX:MaxNewSize=4000m -Xss128k  -XX:MaxHeapFreeRatio=80 -XX:MinHeapFreeRatio=40 -XX:+UseParNewGC -XX:+UseConcMarkSw
eepGC -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:-UseGCOverheadLimit -XX:MaxTenuringThreshold=8 -XX:P
ermSize=800M -XX:MaxPermSize=800M -XX:GCTimeRatio=19 -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps"

相關推薦

hiveserver 佔用記憶體的問題

今天為了求解hiveserver佔用記憶體過大的問題,特地加了hive在apache的郵件列表,討論半天。特別說的是 裡面的人確實很熱情啊 ,外國人做事確實很認真,討論帖發的時候都狠詳細。 粘出一些記錄: Did you update your JDK in last

win7--svchost佔用記憶體

電腦卡?---》重灌win7以後還是卡?----》svchost佔用記憶體這麼多? 解決辦法:我的電腦--》右鍵管理--》服務和應用程式-->服務---》Superfetch--》雙擊滑鼠左鍵

C#中執行緒佔用記憶體解決方法

專案中用到了多執行緒,而且是1000執行緒併發執行,發現記憶體佔用過高,於是對專案裡用到的物件逐個測試,發現是執行緒物件佔用記憶體 Thread[] threads = new Thread[1000]; for(int i = 0; i<threa

關於mongodb佔用記憶體的問題

一、現象         最近發現自己伺服器記憶體越來越少,查了一下原來是部署的mongodb使用記憶體線上性增加。不查不知道,一查嚇一跳,竟然佔用了3G的記憶體。。 二、分析      1.記憶體增加的原因                mongo為了優化他的讀寫效

GitLab效能調優-佔用記憶體的問題

開發十年,就只剩下這套架構體系了! >>>   

sql server 佔用實體記憶體的問題

轉載   https://www.cnblogs.com/visibleisfalse/p/6170640.html   前段時間部署了一臺測試機,將網站、資料庫、介面都等很多應用都部署在同一臺機器上,而且這臺機器其實只是一臺普通的電腦,8g記憶體而已。   後來

linux xorg佔用視訊記憶體解決

一、通過Ctrl + Alt +F1~F6任意一個進入文字介面;登入,nvidia-smi檢視視訊記憶體佔用二、回到圖形介面:Ctrl + Alt + F7再次nvidia-smi檢視視訊記憶體佔用,可發現視訊記憶體已經明顯降了下來

w3wp.exe程序佔用記憶體高解決方法

解決CPU佔用過多: 1、在IIS中對每個網站進行單獨的應用程式池配置。即互相之間不影響。 2、設定應用程式池的CPU監視,不超過25%(伺服器為4CPU),每分鐘重新整理,超過限制時關閉。 根據w3wp取得是哪一個應用程式池: 1、在工作管理員中增加顯示pid欄位。就可以看到佔用記憶體或者cpu最高

php-fpm佔用記憶體高分析

1、檢視每個php-fpm佔用的記憶體大小 ps -ylC php-fpm --sort:rss 2、檢視單個php-fpm程序消耗記憶體的明細 pmap $(pgrep php-cgi | head -1) 這裡可以根據需要減少不必要的模組載入。 php-fp

記一次Mysql佔用記憶體高的優化過程

一.環境說明: 作業系統:CentOS 6.5 x86_64 資料庫:Mysql 5.6.22 伺服器:阿里雲VPS,32G Mem,0 swap 二.問題情況: 1.某日發現公司線上系統的Mysql某個例項的從庫長時間記憶體佔用達到60%如下圖 2.於是開始

linux mysql 5.6 記憶體的問題

在linux上安裝5.6版本的mysql後,發現記憶體達到700M,經過一番上網查詢發現下面的設定可以減少記憶體: [mysqld] performance_schema_max_table_instances=400          ta

【筆記】ios 記憶體大小的限制 (因佔用記憶體而crash)

因ios對每個程式都有最大的記憶體分配限制,如果超過了這個閾值,會被系統強制關閉,造成crash,通常出現在bugly上的錯誤碼是 SEGV_ACCERR。在除錯的時候,會顯示類似這樣的資訊   EXC_RESOURCE RESOURCE_TYPE_MEMORY (lim

python解決mongo日誌佔用儲存的問題

當操作mongo,很頻繁存取的時候,mongo的日誌會變得越來越大, 針對公司每天百億級別的取和存,並保持mongo不重啟的情況下, 用python寫定時指令碼,並保持mongo一直線上,不重啟。 首先看一下在linux(centos)測試機上的mongo簡單配置檔案(

JProfiler工具開啟dump檔案,分析jar包程式記憶體後cpu100%

開發的收集車輛資料程式跑了3-5小時,就會出現如下結果發現程式執行記憶體在這幾個紅點波動,在CPU100%出現一段時間內程式會自動結束。後來利用工具命令分析問題得出是因為記憶體不夠導致一直在GC,因為GC Task Thread佔用CPU比較高。具體步驟如下ps -mp 16

VS2010工程佔用空間的原因和解決方法

如果不進行特定的設定,用VS2010建立的工程佔用磁碟空間會非常的大,原因是VS2010會自動生成.ipch和.sdf檔案,用於記錄整個開發過程中的變化,這些東西在99.9999%的情況下是完全用不到的,要解決佔用空間大的問題,有兩種方法: (1)臨時性方法:每次複製VS2

zabbix自動發現佔用記憶體top10程序並監控資源

背景 相信每一位運維人員手裡都掌握著不少的伺服器,少則幾十臺,多則成百上千,線上伺服器跑的服務五花八門,每臺伺服器資源消耗都不同,如果能夠對資源消耗較高的程序實現自動發現監控將對排查問題有很大的幫助。 實現 匯出資料 在zabbix客戶端下新建

C# Winform應用程式佔用記憶體解決方法整理(轉)

原文:http://www.jb51.net/article/56682.htm 背景: 微軟的 .NET FRAMEWORK 現在可謂如火如荼了。但是,.NET 一直所為人詬病的就是“胃口太大”,狂吃記憶體,雖然微軟聲稱 GC 的功能和智慧化都很高,但是記憶體的回收

Scrapy爬蟲-資料爬取時記憶體的解決辦法(轉)

scrapy有兩個佇列:記憶體佇列 和 磁碟佇列. 最簡單的辦法,設定持久化吧(-s JOBDIR選項),可以通過磁碟佇列檢視request。 scrapy crawl somespider -s JOBDIR=myspider 執行scrapy後,會在

visual code rg.exe或者git for window佔用記憶體越來越

visual code 開啟後,只見電腦越來越卡,開啟工作管理員,只見記憶體biu、biu的往上飆… 如果發現rg.exe佔用高額記憶體,首先你要考慮是不是你的編輯器很久沒更新了,然後更新下,如果不行的話------------ 檔案 => 首選項 => 設定 在紅色搜尋框裡輸

IOS獲取圖片方法,避免記憶體閃退

建議使用該方法獲取圖片 NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"sun" ofType:@"png"]; UIImage *image = [[UIImage alloc] initWit