I'm trying to make my Elasticsearch work faster.
I have a logstash that's processing 17k/s events, when using null output.
If I set Elasticsearch as my output I'm able to get 6k/s only.
The Elasticsearch 1.7.1 is currently a single node on a separate server.
It's 16 cores, 64 GB of RAM + SSD disk.
I can see that the CPU utilisation is quite low - around 40%.
The IO is also nothing for SSD - 20MB/s of writes.
The heap space is set to 30GB, so it shouldn't be a problem too.
Does anyone have an idea how can I check what's limiting my Elasticsearch?
I've tried to set more workers on logstash elasticsearch output - no significant change observed.
Ooops... looks like I missed the index.store.throttle.type: none
switch... It would make perfect sense, as I could see that the IO was never above 20MB/s... and that's the default value of throttling.
Ok... looks like setting index.store.throttle to none helped a little.
But still the elasticsearch isn't consuming the load generated by logstash.
The logstash generated around 17k events/s
I'm sending them using http mode to a single elasticsearch using 4 workers.
The Elasticsearch configuration is as follows:
cluster.name: MD-test
index.number_of_shards: 1
index.number_of_replicas: 0
path.logs: /opt/MD/logs/monitoring
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["127.0.0.1", "10.141.51.19:9300"]
#10.141.51.19:9300 is unavailable for now
index.store.throttle.type: none
I get an overall throughput of 8.5k - 9k events/s.
Mem: 65972480k total, 38879532k used, 27092948k free, 182728k buffers
The CPU usage is around 25%
The disk IO is:
writes: 20-40MB/s
reads: 0
cancelled writes: 10-20 MB/s
What's limiting me now? How can I check it?
Didn't install Marvel, as this machine doesn't have internet access, but I can workaround it if needed.
Hi, try to increase number of shards to 4 (number of workers).
Single ES node can easily handle 20-25 events/sec but it depends on many factors. Maybe you have a lot of fields or some analyzers or doc values in your mapping?
increasing number of shards didn't help much.
I could get 10.000 events per second. Now it's 11.500.
The cpu usage is around 30-40%.
I was thinking about increasing the number of indexing threads.
As documentation says - it should be equal to number of CPU cores by default, but in node stats I can see:
Firstly disable _all if don't need it. What about _source do you using it or not (if not try to disable it)?
Try to increase "index.refresh_interval" : "5s" to 30s.
I've changed the refresh_interval, removed "store" option and _all field.
Btw. it turned out, that somehow the mapping wasn't applied, so I had the default configuration - all strings analyzed etc.
So after applying all these changes I couldn't see any difference in performance.
I've also performed some experiments with logstashes...
I was able to parse 7000 entries per second using one Logstash & one Elasticsearch.
I was able to parse 1100 entries per second using two Logstashes on single server & one Elasticsearch
I was able to parse 1400 entries per second using three Logstashes on single server & one Elasticsearch.
I couldn't see much difference between 1/2 logstashes on a server when using null output.
But now it looks like it makes a difference for Elasticsearch.
So I assume it's either a Logstash issue (Elasticsearch output limiting the Logstash performance) or Elasticsearch working better when more clients call him (but I've tried to tune the "workers" switch on logstash elasticsearch output - no improvement observed.)
I'll try to add more Logstashes tomorrow to see if Elasticsearch will handle more load.
Yes, I know... removed everyting, the mapping changes got applied
I'm waiting for additional servers to check if putting more pressure on Elasticsearch will make it sweat a little
Hmm... I've tried with 2 more elasticsearches on different servers...
The usage of Elasticsearch is still 25 - 30% and it's handling around 14000 entries per second.
Have you tried to start two independent logstash instance at once? Maybe you are limited by logstash output plugin not by elasticsearch itself?
For data rate 17k/sec is about 1 468 800 000 documents a day it a lot but can be handled by one es instace. But if you are planning to keep this data for a long period one instance is not sufficient.
Which version of Logstash are you using? What does your configuration look like? Have you tried using more than one Logstash instance on different hosts to ensure Logstash is not the bottleneck? Is CPU saturated on the Logstash host during indexing?
Yes, that's what I've been waiting for - more servers to run Logstashes on... I've reached 14k per second using 3 Logstashes and adding more didn't make any difference.
I know one instance for elasticsearch is not enough - I just run on 1 to ease the maintenance and tests.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.