Delete data in Elasticsearch(6.4.1) cluster is very slow


I used python script to delete the data in Elasticsearch cluster(5 nodes). the speed is very slow, only 5K/s.
my script code is:

from elasticsearch import Elasticsearch
import sys
import time

class ElasticSearchClient(object):
def get_es_servers():
es_servers = [{
"host": "localhost",
"port": "9200"
es_client = Elasticsearch(hosts=es_servers)
return es_client

class LoadElasticSearch(object):
def init(self):
self.index = "logmonster"
self.es_client = ElasticSearchClient.get_es_servers()

def delete_by_casename(self, caseName):
    query = {"query":{"match": {"CaseName": {"query":'"'+caseName+'"',"operator": "and"}}}}
    return self.es_client.delete_by_query(index='logmonster',body=query,conflicts='proceed',request_timeout=500)

def main(self):
    result = self.delete_by_case_mme(CASE_NAME, MME_NAME)

if name == 'main':
load_es = LoadElasticSearch()

what can I do so that I can promote the delete speed?

Liao Chunbo

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.