I have trouble with using Elasticsearch with Logstash.
When inserting data to ES through Logstash (not using Filebeat. Elasticsearch & Logstash only), CPU utilization of ES is over 90%.
Also, I expected if I use multiple Logstash, data inserting time is same or decreased compared to using 1 Logstash. However, my testing result is not like that.
Please advise how to use ES and multiple Logstash efficiently.
Below is how I tested.
[TEST ENVIRONMENT]
- O/S : CentOS 7.9
- cpu 32 vCore
- mem 64GB
- ELK version : OSS 6.8.17
- Run 1 ES & 2 Logstash (different port) on same server
[TEST#1 - using 1 Logstash] - Send 100mb of data to Logstash
- takes about 2 minutes to insert data to ES
- ES CPU utilization: 90 ~ 100%
- (only 100mb data, but CPU utilization is too high. It seems ES does not use all CPU cores)
- CPU Idle of server: 90 ~ 99%
[TEST#2 - using 2 Logstash] - Send 100mb of data to each Logstash (total of 200mb)
- takes about 4 minutes to insert data to ES
- (each Logstash handles same size of data as TEST#1, but takes twice longer than TEST#1)
- ES CPU utilization: 80 ~ 100%
- CPU Idle of server: 90 ~ 99%
[thread_pool status during testing]
- most of numbers are 0.
node_name name active queue rejected
node-01 analyze 0 0 0
node-01 fetch_shard_started 0 0 0
node-01 fetch_shard_store 0 0 0
node-01 flush 0 0 0
node-01 force_merge 0 0 0
node-01 generic 0 0 0
node-01 get 0 0 0
node-01 index 0 0 0
node-01 listener 0 0 0
node-01 management 1 0 0
node-01 refresh 0 0 0
node-01 search 0 0 0
node-01 search_throttled 0 0 0
node-01 snapshot 0 0 0
node-01 warmer 0 0 0
node-01 write 0 0 0
[ES SETTING - elasticsearch.yml]
network.host: ["_local_", "_site_"]
http.port: 9200
transport.port: 9300
bootstrap.memory_lock: true
bootstrap.system_call_filter: false
thread_pool.search.max_queue_size: 10000
thread_pool.bulk.size: 16
thread_pool.bulk.queue_size: 10000
thread_pool.write.size: 32
thread_pool.write.queue_size: 10000
http.max_content_length: 100mb
network.tcp.no_delay: true
network.tcp.keep_alive : true
network.tcp.reuse_address: true
network.tcp.send_buffer_size : 1024mb
network.tcp.receive_buffer_size : 1024mb