# ES Linux vs Windows - 100% mem use during index, different search times (Linux is slower)

**URL:** <https://discuss.elastic.co/t/es-linux-vs-windows-100-mem-use-during-index-different-search-times-linux-is-slower/54582>\
**Category:** Elasticsearch\
**Created:** [July 2, 2016, 4:29pm UTC](https://discuss.elastic.co/t/es-linux-vs-windows-100-mem-use-during-index-different-search-times-linux-is-slower/54582 "2016-07-02T16:29:56Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![haldrich](https://avatars.discourse-cdn.com/v4/letter/h/b19c9b/32.png) [@haldrich](https://discuss.elastic.co/u/haldrich)\
**Post date:** [July 2, 2016, 4:29pm UTC](https://discuss.elastic.co/t/es-linux-vs-windows-100-mem-use-during-index-different-search-times-linux-is-slower/54582/1 "2016-07-02T16:29:56Z")

</div>

We have been running a Windows ES cluster for some time. We decided that it seemed Linux often was considered faster in performance... So when we upgraded our cluster, we used Linux boxes.

A little background on the systems:  
Both are running on the same Hyper-V infrastructure.  
Both clusters are 20GB RAM 4vCPU boxes using the same shared storage.

Windows cluster was ES 2.1  
Linux cluster is ES 2.3

When indexing on the Linux cluster, we notice our system monitors alerting because they go to nearly 0% free memory in some cases... this seems to become more frequent with each reindex (we reindex data a lot, multiple times per hour).

At the moment, the Linux cluster is in pre-production testing, no ongoing queries against it.  
The Windows cluster however hovers (according to Task Manager) at about 13GB of 20GB used.

Why does ES on Linux seem to cause 100% memory utilization.

Further, we also notice in testing that the time taken reported in a query is longer for the Linux cluster (which currently has no load) than the Windows cluster (which is in production).

With multiple queries on the Windows cluster, the time taken will be between 1-10, whereas on the Linux cluster the time taken always reports between 13-45.

Note that we are using the same data for both tests and the same query... the only difference is the cluster. To get the lowest time results, we execute the same query in rapid succession. I expect a time of 1 is because the result is cached... shouldn't the same happen on the Linux cluster?

For Linux, we do have memlock on and confirmed working. We do have the heap set to 10GB (50% of total RAM).

Is there perhaps something I'm not properly tuning on Linux? I expected Linux to perform better than the Windows version.

Thanks!  
Heath

---

<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:** [July 3, 2016, 12:36am UTC](https://discuss.elastic.co/t/es-linux-vs-windows-100-mem-use-during-index-different-search-times-linux-is-slower/54582/2 "2016-07-03T00:36:35Z")

</div>

> [@haldrich](#):
>
> When indexing on the Linux cluster, we notice our system monitors alerting because they go to nearly 0% free memory in some cases

Are you talking overall system memory, or heap?

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [July 3, 2016, 6:43pm UTC](https://discuss.elastic.co/t/es-linux-vs-windows-100-mem-use-during-index-different-search-times-linux-is-slower/54582/3 "2016-07-03T18:43:13Z")

</div>

What Linux distribution and version is this? What kernel? What filesystem? What network setup? What do you mean by "same Hyper-V infrastructure"? And what is "shared storage" - SAN? NAS? NFS? What about swap space?

What Java distribution do you use?

Why do you use different ES versions and compare them? It's like apples and oranges.

---

<div class="post-metadata">

**Author:** ![haldrich](https://avatars.discourse-cdn.com/v4/letter/h/b19c9b/32.png) [@haldrich](https://discuss.elastic.co/u/haldrich)\
**Post date:** [July 4, 2016, 12:22pm UTC](https://discuss.elastic.co/t/es-linux-vs-windows-100-mem-use-during-index-different-search-times-linux-is-slower/54582/4 "2016-07-04T12:22:05Z")

</div>

Overall memory. Perhaps just reporting differently between Windows and Linux?

---

<div class="post-metadata">

**Author:** ![haldrich](https://avatars.discourse-cdn.com/v4/letter/h/b19c9b/32.png) [@haldrich](https://discuss.elastic.co/u/haldrich)\
**Post date:** [July 4, 2016, 12:24pm UTC](https://discuss.elastic.co/t/es-linux-vs-windows-100-mem-use-during-index-different-search-times-linux-is-slower/54582/5 "2016-07-04T12:24:54Z")

</div>

Jprante: Ununtu 14.04, Java 8 (most recent version)

The rest of the infrastructure is identical. So rather than deal with specs of what could be better/different, the question is. A) is there an expected performance decrease from ES 2.1 to 2.3? Or B) is there an expected performance/memory usage difference between Windows and Linux installs?

---

<div class="post-metadata">

**Author:** ![Ravi\_Shanker\_Reddy](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@Ravi\_Shanker\_Reddy](https://discuss.elastic.co/u/Ravi_Shanker_Reddy)\
**Post date:** [July 4, 2016, 12:33pm UTC](https://discuss.elastic.co/t/es-linux-vs-windows-100-mem-use-during-index-different-search-times-linux-is-slower/54582/6 "2016-07-04T12:33:18Z")

</div>

> [@haldrich](#):
>
> At the moment, the Linux cluster is in pre-production testing, no ongoing queries against it.The Windows cluster however hovers (according to Task Manager) at about 13GB of 20GB used.

Here you mentioned the heap as 20 GB and [quote="haldrich, post:1, topic:54582"]  
For Linux, we do have memlock on and confirmed working. We do have the heap set to 10GB (50% of total RAM).  
[/quote]

Here you are saying that the heap as 10 GB.

Hope here is the difference

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [July 4, 2016, 1:10pm UTC](https://discuss.elastic.co/t/es-linux-vs-windows-100-mem-use-during-index-different-search-times-linux-is-slower/54582/7 "2016-07-04T13:10:35Z")

</div>

Your question ignores that you must take careful analysis before addressing ES as a possible cause.

Also, the assumption there is one "Windows" and one "Linux" is ignoring the fact that there are different distributions, versions, and configurations with strong influence on performance. It's simply not a matter of "increase" or "decrease" but more a matter of configuration.

Of course there are always different performance and memory usages, but ES is not the cause in most cases.

---

<div class="post-metadata">

**Author:** ![haldrich](https://avatars.discourse-cdn.com/v4/letter/h/b19c9b/32.png) [@haldrich](https://discuss.elastic.co/u/haldrich)\
**Post date:** [July 4, 2016, 2:02pm UTC](https://discuss.elastic.co/t/es-linux-vs-windows-100-mem-use-during-index-different-search-times-linux-is-slower/54582/8 "2016-07-04T14:02:47Z")

</div>

The heap itself is 10GB. Total ram is 20

---

<div class="post-metadata">

**Author:** ![haldrich](https://avatars.discourse-cdn.com/v4/letter/h/b19c9b/32.png) [@haldrich](https://discuss.elastic.co/u/haldrich)\
**Post date:** [July 4, 2016, 2:05pm UTC](https://discuss.elastic.co/t/es-linux-vs-windows-100-mem-use-during-index-different-search-times-linux-is-slower/54582/9 "2016-07-04T14:05:34Z")

</div>

Thanks but that doesn't go to the question.  
Performance is different on the same exact hardware setup.

The question is not in analyzing performance, but what would be likely responsible for the difference.

Since the hardware is identical, it isn't that.

So is it a Windows Linux thing or an ES 2.1 vs 2.3 thing?

---

<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:** [July 4, 2016, 9:23pm UTC](https://discuss.elastic.co/t/es-linux-vs-windows-100-mem-use-during-index-different-search-times-linux-is-slower/54582/10 "2016-07-04T21:23:56Z")

</div>

That's the OS caching things, see [https://www.elastic.co/guide/en/elasticsearch/guide/2.x/heap-sizing.html#\_give\_less\_than\_half\_your\_memory\_to\_lucene](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/heap-sizing.html#_give_less_than_half_your_memory_to_lucene)

It's totally normal.

---

<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:38pm UTC](https://discuss.elastic.co/t/es-linux-vs-windows-100-mem-use-during-index-different-search-times-linux-is-slower/54582/11 "2017-07-05T22:38:28Z")

</div>


