Hello,
I have an Elasticsearch cluster on 5 nodes.
I use Elasticsearch for log management and 3 indexes are created every hour (1 shard, 0 replica)
Every log line have 20-70 fields, like IP, port, hostname, user agent etc.
Some indexes are 30GB in size, some indexes are 2-3GB. Size depends on time of day.
When i make a query for top source IP addresses in last 3 months,
all elastic nodes io utililization (iostat -x 3) are %100 and my query getting time out response.
How can i improve the performance of the query?
Thanks.
Elasticsearch version: 7.16.2
OS version: centos 8
Hardware specs for each node:
8GB RAM
8 CPU:
model name : Intel(R) Xeon(R) Gold 6230R CPU @ 2.10GHz
cpu MHz : 2095.077
cache size : 36608 KB
Disk speed (SSD):
# hdparm -tT /dev/sdc
/dev/sdc:
Timing cached reads: 13696 MB in 2.00 seconds = 6855.42 MB/sec
Timing buffered disk reads: 2526 MB in 3.00 seconds = 841.65 MB/sec
Index template:
{
"index_patterns": [
"test-*"
],
"settings": {
"index": {
"max_result_window": "1000000",
"routing": {
"allocation": {
"total_shards_per_node": "1"
}
},
"refresh_interval": "120s",
"number_of_shards": "1",
"translog": {
"flush_threshold_size": "64m",
"durability": "async"
},
"number_of_replicas": "0"
}
},
"aliases": {},
"mappings": {
"numeric_detection": false,
"date_detection": false,
"properties": {
"date": {
"type": "date"
},
}
}
}
query example:
{"size":0, "query": {"bool":{"must":[{"query_string":{"query":"+date:[1635724800000 TO 1644278399000] +action.keyword:drop"}}]}}, "aggs":{"aggrsNameName": {"terms": {"field":"source_ip.keyword", "size": 10000}}} }