# Is it really that painfull ? need advice

**URL:** <https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727>\
**Category:** Elasticsearch\
**Created:** [August 10, 2016, 4:47pm UTC](https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727 "2016-08-10T16:47:33Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![gh0stid](https://avatars.discourse-cdn.com/v4/letter/g/f9ae1b/32.png) [@gh0stid](https://discuss.elastic.co/u/gh0stid)\
**Post date:** [August 10, 2016, 4:47pm UTC](https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727/1 "2016-08-10T16:47:33Z")

</div>

Hello all,

sorry to bother you. just wondering and by wondering I mean , smashing my head on the computer desk over and over thinking and probably over thinking it ...

Lets say I have access to 1 server 16gigabyte of ram, 4 cpu 3ghz

- NOT TWO, one

I would like to use that ELK stack for trafic monitoring purpose. using log from fortigate device, currentely sent to syslogd server ( same machine as described earlier ) using logstash to forward those logs to ES and... finaly visualise em in Kibana !

Lets also say that I currently have ~ 25g of logs per day created in a "daily indice" ANDDDDD we will more than probably reach ~100gig of logs per day ( per daily indices )

now, to add complexity ! In a near future, we would like to be able to see up to 30 days of "logs information" in a single visualisation dashboard ( currentely at ~25giga we cannot. we get a "freaking 30 000ms timeout" in kibana for only 7days dashboard... \*\*\*\*\*\*\*\* any help is welcome here.. \*\*\*\*\*\*\*\*\*\* any way to generate a view no matter how long it will take ? like a monthly overnight report ? I couldnt care less... as long I can see it when needed...)

now ... ive been thru almost everything to optmize the stack,  
ram dedicated  
mlocktrue all  
desactivate swap in fstab  
change refresh interval  
etc.

Everything I can think of right now OR found on internet, but "personalise my mapping" and honestly, this part.. is absolutely a pain in the .... I am really forced to do it? I mean ffs. I have more than 200 field that would need to be personalised, exclude or whatever else...

AM I REALLY stuck with that customisation to do ? ( not only that but afterward... I would have to figure out a way to reindex the whole thing after creating my personalised template.. )

See my problem is ... it is a permanentely moving machine, It will continue again and again and again to receive logs from FTG device AND index em. it will never stop. So, i cannot stop logstash instance or whatever else to dedicate ressource that might be somehow missing neighter can I stop the "indexation"

Please, help me... Im literally close to lose my mind playing in those "freaking" templates...

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 10, 2016, 8:46pm UTC](https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727/2 "2016-08-10T20:46:51Z")

</div>

Sounds like you need more resources. Either more nodes in the cluster or a larger node.

Everything comes at a cost.

---

<div class="post-metadata">

**Author:** ![gh0stid](https://avatars.discourse-cdn.com/v4/letter/g/f9ae1b/32.png) [@gh0stid](https://discuss.elastic.co/u/gh0stid)\
**Post date:** [August 15, 2016, 3:54pm UTC](https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727/3 "2016-08-15T15:54:58Z")

</div>

Tried to add more ressources..

currentely have one more nodes. unfortunately, altough it is almost identical to the master... I keep getting OOM ?

 ![](https://us1.discourse-cdn.com/elastic/original/2X/a/a2f9a31d79bd8baf621c76c926ff0ded83214b73.jpg)

---

<div class="post-metadata">

**Author:** ![gh0stid](https://avatars.discourse-cdn.com/v4/letter/g/f9ae1b/32.png) [@gh0stid](https://discuss.elastic.co/u/gh0stid)\
**Post date:** [August 19, 2016, 5:17pm UTC](https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727/4 "2016-08-19T17:17:57Z")

</div>

???? anyone

please. pretty please lol ?

---

<div class="post-metadata">

**Author:** ![unknownunknown](https://avatars.discourse-cdn.com/v4/letter/u/4da419/32.png) [@unknownunknown](https://discuss.elastic.co/u/unknownunknown)\
**Post date:** [August 19, 2016, 6:59pm UTC](https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727/5 "2016-08-19T18:59:22Z")

</div>

I've been spending the last year and a half trying to squeeze as much performance as I can from a single machine running ES, so I feel your pain and wish there was more information about this. ES seems to assume cluster/cloud rather than big iron/appliance.

Your JVM instances (presumably those running ES) are running out of memory and are getting killed by the Linux kernel. One thing you should check is how much heap is being allocated to your ES instances.

If you are running more than one instance, you would need to ensure that the total allocated is less than your entire machine, say 6GB each for two instances. In the above screenshot there are at least 5 different PIDs associated with a JVM, and so there may be multiple instances of ES running -- so make sure the right number are running. On a 16GB system, however, I do not know why you would run more than one instance of ES.

The process hangs you that see are likely the result of the out of memory condition, but could also be caused by an I/O problem.

Based on the use case you described I think you are may be using undersized hardware.

---

<div class="post-metadata">

**Author:** ![gh0stid](https://avatars.discourse-cdn.com/v4/letter/g/f9ae1b/32.png) [@gh0stid](https://discuss.elastic.co/u/gh0stid)\
**Post date:** [August 19, 2016, 7:03pm UTC](https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727/6 "2016-08-19T19:03:31Z")

</div>

I run only one instances of elasticsearch 5 shards ( default ) no replica.

What information would you need to be able to help me diagnose this the best we could ?

I use use mlockall: true  
and heap\_size is 8192mb ( half of 16go RAM on system )

Now its two nodes, one 8 cpu, 16gb ram 400gb hard drive second is a clone of the first, but 4cpu 200gb hard drive.

thank you for replying..

---

<div class="post-metadata">

**Author:** ![unknownunknown](https://avatars.discourse-cdn.com/v4/letter/u/4da419/32.png) [@unknownunknown](https://discuss.elastic.co/u/unknownunknown)\
**Post date:** [August 19, 2016, 8:32pm UTC](https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727/7 "2016-08-19T20:32:18Z")

</div>

I would recommend running some monitoring tools like top(1), htop(1), free(1), and ps(1). Find out what processes are eating up memory. Is a stale elasticsearch process still around that should not be? Do you have an indexing process that is eating alot of memory?

Also, you should check what the JVM is using memory for. If you aren't already using doc\_values, its quite possible a good amount of your memory is being used up in field data. Use the various ES APIs (\_cat/health, \_nodes/stats, \_cluster/stats) to see how much heap is used and by what. Also check indexing memory and how much memory your open segments are taking up.

If you are running sysstat, sar(1) can help you track down long term trends in CPU, memory, and disk utilization. (sar -q, sar -r, and sar -d).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 19, 2016, 10:10pm UTC](https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727/8 "2016-08-19T22:10:08Z")

</div>

I'd reduce your shard count, you're probably wasting resources there.

---

<div class="post-metadata">

**Author:** ![gh0stid](https://avatars.discourse-cdn.com/v4/letter/g/f9ae1b/32.png) [@gh0stid](https://discuss.elastic.co/u/gh0stid)\
**Post date:** [August 22, 2016, 12:48pm UTC](https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727/9 "2016-08-22T12:48:19Z")

</div>

how would someone proceed to do that ? and how many shard should a person use for that "specific" use ?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 22, 2016, 10:35pm UTC](https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727/10 "2016-08-22T22:35:24Z")

</div>

You need to reindex to a new index with less shards.  
You can use something like [https://gist.github.com/markwalkom/8a7201e3f6ea4354ae06](https://gist.github.com/markwalkom/8a7201e3f6ea4354ae06), or [https://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-reindex.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-reindex.html) if you are on 2.3.

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [August 23, 2016, 7:55am UTC](https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727/11 "2016-08-23T07:55:54Z")

</div>

> [@gh0stid](#):
>
> Lets also say that I currently have ~ 25g of logs per day created in a "daily indice" ANDDDDD we will more than probably reach ~100gig of logs per day ( per daily indices )

I think with that amount of data per day (25g = 25 gigabytes?) on a single 16Gb RAM, 4 cpu machine, you're going to have a hard time with any data store. You're going to need more resources. How much more? Well, that's a little tricky to estimate without knowing

1. The mapping for your log documents
2. The byte size of each log document (in order to calculate bytes indexed/sec)
3. are logs ingested at a constant uniform rate or is it spikey
4. the expectations with regards to operational load on the cluster e.g. concurrent searches, aggregations, etc.

It's usually useful to do some rough estimations for these and provision a larger cluster than your estimate, then scale it down to the point where the performance meets your requirements. The alternative way is to start with a smaller cluster and gradually scale it up until the performance is satisfactory, but from experience, it can take longer going in this direction.

> [@gh0stid](#):
>
> Everything I can think of right now OR found on internet, but "personalise my mapping" and honestly, this part.. is absolutely a pain in the .... I am really forced to do it? I mean ffs. I have more than 200 field that would need to be personalised, exclude or whatever else...

You should consider using [Index Templates](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html) to define a mapping for your logs. As @warkolm mentioned, 5 shards for a daily log index of 25Gb is probably too many; you could probably have just 1 primary shard per daily index (with at least 1 replica) , but test this with your data and hardware to see if it meets your expectations.

> [@gh0stid](#):
>
> See my problem is ... it is a permanentely moving machine, It will continue again and again and again to receive logs from FTG device AND index em. it will never stop. So, i cannot stop logstash instance or whatever else to dedicate ressource that might be somehow missing neighter can I stop the "indexation"

Consider snapshotting your cluster as well as putting some kind of queueing system e.g. Kafka in front of your cluster so you have some reprieve to make some changes.

---

<div class="post-metadata">

**Author:** ![gh0stid](https://avatars.discourse-cdn.com/v4/letter/g/f9ae1b/32.png) [@gh0stid](https://discuss.elastic.co/u/gh0stid)\
**Post date:** [August 25, 2016, 5:35pm UTC](https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727/12 "2016-08-25T17:35:23Z")

</div>

ok,

so it is really that painfull, ive a call scheduled with elastic team to size my thing and ask for support.. im done fuc\*\*ng around. i just hope I can pay, X thousand and finaly get it done without having to struggle day after day with forums haha

thank you for replying people.

maybe it is just not. suitable for my needs...

---

<div class="post-metadata">

**Author:** ![unknownunknown](https://avatars.discourse-cdn.com/v4/letter/u/4da419/32.png) [@unknownunknown](https://discuss.elastic.co/u/unknownunknown)\
**Post date:** [September 1, 2016, 9:48pm UTC](https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727/13 "2016-09-01T21:48:31Z")

</div>

Would be very interested to know whether your conversation with the paid support enabled you to meet your needs.

---

<div class="post-metadata">

**Author:** ![gh0stid](https://avatars.discourse-cdn.com/v4/letter/g/f9ae1b/32.png) [@gh0stid](https://discuss.elastic.co/u/gh0stid)\
**Post date:** [September 27, 2016, 3:24pm UTC](https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727/14 "2016-09-27T15:24:38Z")

</div>

Unfortunately, it didnt.

going to SIEMonster now.  
the conversation only permit me to be able to know the "ratio" needed RAM VS data

long story made short its 1:16

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 29, 2016, 12:22am UTC](https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727/15 "2016-09-29T00:22:23Z")

</div>

I'm surprised we weren't able to help sizing things out. Would you be willing to PM me more details of who you spoke to so I can follow it up internally?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:16pm UTC](https://discuss.elastic.co/t/is-it-really-that-painfull-need-advice/57727/16 "2017-07-05T22:16:22Z")

</div>


