索引建立優化
,
"house": ,
"properties": ,
"title": ,
"price": ,
"area": ,
"createtime": ,
"lastupdatetime": ,
"cityenname": ,
"regionenname": ,
"direction": ,
"distancetosubway": ,
"subwaylinename": ,
"subwaystationname": ,
"tags": ,
"street": ,
"district": ,
"description": ,
"layoutdesc" : ,
"traffic": ,
"roundservice": ,
"rentway": ,
"suggest":,
"location":}}
}}複製**
配置優化 ./config/elasticsearch.yml
// 禁用萬用字元刪除
"action.destructive_requires_name": true,
# 重新整理間隔
"index.refresh_interval": "30s",
# 節點間的存活檢測間隔
"discovery.zen.fd.ping_interval": "1s",
# 存活超時時間
"discovery.zen.fd.ping_timeout": "1s",
# 存活超時重試次數
"discovery.zen.fd.ping_retries": 3
# node節點配置
"node.master":true
"node.data": false
# 資料節點配置
"node.master":false
"node.data": true
# 針對資料節點http功能關閉
# 負載均衡節點配置(一般不用es的配置)
複製**
./config/jvm.options
# 最小最大堆記憶體
-xms
-mmx
複製**
nginx 負載均衡 nginx.conf
# 啟用nginx core-module模組
./configure with-stream
複製**
./
stream
server
}複製**
ElasticSearch 效能優化
getrace系統的所有搜尋都是用elasticsearch來做的,在使用elasticsearch的過程中碰到了一些問題,這裡記錄一下。一 在查詢呼叫鏈的時候。整體資料量大 每天60g 7 420g 但是結果集比較少 只有幾百行 的時候,查詢時間經常會超過1分鐘,慢的甚至需要5,6分鐘.優化1 經...
elasticsearch效能優化
elasticsearch查詢依賴作業系統的頁面快取記憶體 file system cache 因此除了需要給elasticsearch的jvm分配足夠的記憶體以外,還需要給頁快取預留記憶體。例如單機32g記憶體,給jvm配置16g記憶體後,剩餘16g預留記憶體不需要額外配置,也不要讓其他程序占用這...
優化查詢 ElasticSearch
elasticsearch使用檔案系統快取提公升查詢效能,最好確保可用記憶體的一半設定到檔案系統快取。如果是io敏感,那麼最好使用ssd驅動,總是使用本地儲存,不要使用nfs或者smb的檔案系統。儘管amazon的ebs也可以很好工作,但是最好使用本地儲存。如果是cpu敏感,那麼應該購買更快的cpu...