Hi:
I am testing the BULK insert(index) efficiency.
the python code as follow:
from elasticsearch import Elasticsearch
from elasticsearch import helpers
import time
es = Elasticsearch("127.0.0.1")
i = 0
data_list=[]
for i in range(50000000):
data_list.append({"_index":"stress","_type":"test","_source":{
"collectTime": 1414709176,
"deltatime": 300,
"deviceId": "48572",
"getway": 0,
"ifindiscards": 0,
"ifindiscardspps": 0,
...
...
...
"ifinunknownprotos": 0,
"ifinunknownprotospps": 0
}})
if len(data_list) == 5000:
helpers.bulk(es,data_list)
data_list[:]=[]
if len(data_list) != 0:
helpers.bulk(es,data_list)
but the efficiency is very low, about 2000 docs/s,and the cpu usage is only 300% (12 core),it is expected to 1200%.
when i running esrally to benchmark my elasticsearch the speed can reach 9000 docs/s , and the cpu usage can reach 1200%.
Do i miss something?