# RAM Usage in a Linux Server, Aerospike-only computer

**URL:** <https://discuss.aerospike.com/t/ram-usage-in-a-linux-server-aerospike-only-computer/1198>\
**Category:** Configuration\
**Created:** [April 20, 2015, 1:53pm UTC](https://discuss.aerospike.com/t/ram-usage-in-a-linux-server-aerospike-only-computer/1198 "2015-04-20T13:53:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcritt](https://avatars.discourse-cdn.com/v4/letter/r/7feea3/32.png) [@rcritt](https://discuss.aerospike.com/u/rcritt)\
**Post date:** [April 20, 2015, 1:53pm UTC](https://discuss.aerospike.com/t/ram-usage-in-a-linux-server-aerospike-only-computer/1198/1 "2015-04-20T13:53:41Z")

</div>

In the Aerospike documentation it is recommended that 50% of the provisioned RAM be used for primary and secondary indexes.

We have a Linux server that we purchased that is dedicated to just running Aerospike. In that sort of environment is it alright to use 80% of the provisioned RAM for Aerospike. We are assuming, in a headless dedicated server, that 20% on a 250GB RAM server is plenty to run Linux and other apps. Is this assumption correct?

---

<div class="post-metadata">

**Author:** ![kporter](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/kporter/32/515_2.png) [@kporter](https://discuss.aerospike.com/u/kporter)\
**Post date:** [April 20, 2015, 6:45pm UTC](https://discuss.aerospike.com/t/ram-usage-in-a-linux-server-aerospike-only-computer/1198/2 "2015-04-20T18:45:31Z")

</div>

> [@rcritt](#):
>
> In the Aerospike documentation it is recommended that 50% of the provisioned RAM be used for primary and secondary indexes.

It is a general **conservative** guideline which [I believe is actually 60%](http://www.aerospike.com/docs/reference/configuration/#high-water-memory-pct), are you able to provide a link to the docs stating 50?

There also may be a bit of confusion here, are you discussing [high-water-memory-pct](http://www.aerospike.com/docs/reference/configuration/#high-water-memory-pct) or [memory-size](http://www.aerospike.com/docs/reference/configuration/#memory-size)?

Typically we recommend having `high-water-memory-pct` configured to 60% to allow space during migrations allowing your system to evict data soonest to expire during such spikes. Of course this feature doesn’t work if all of your data’s TTL is set to never expire, in which case you may increase this value above [stop-writes-pct](http://www.aerospike.com/docs/reference/configuration/#stop-writes-pct).

For `memory-size` we typically recommend leaving 15-20% of the systems RAM unallocated to any namespace to allow for Aerospike process and Linux system overhead.

---

<div class="post-metadata">

**Author:** ![egbuck](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@egbuck](https://discuss.aerospike.com/u/egbuck)\
**Post date:** [April 20, 2015, 8:15pm UTC](https://discuss.aerospike.com/t/ram-usage-in-a-linux-server-aerospike-only-computer/1198/3 "2015-04-20T20:15:56Z")

</div>

I’m a bit confused by this – I you were to allocate 80% of the total system RAM to a given namespace (leaving the rest for the Aerospike process / Linux overhead), but you were also to set high-water-memory-pct to 60%, wouldn’t the Aerospike process just proceed to evict records until the RAM reached 60%?

In other words, given 1TB of available RAM, and a high-water-memory-pct = 60%, is there any point allocating more than 600GB to any given namespace? Is the additional 200GB just there to handle spikes during data migration?

---

<div class="post-metadata">

**Author:** ![kporter](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/kporter/32/515_2.png) [@kporter](https://discuss.aerospike.com/u/kporter)\
**Post date:** [April 20, 2015, 10:09pm UTC](https://discuss.aerospike.com/t/ram-usage-in-a-linux-server-aerospike-only-computer/1198/4 "2015-04-20T22:09:13Z")

</div>

First, I think there is a bit of confusion on how these parameters work so I will try to clear that up. But I believe your sentiment is valid. I will first discuss how these parameters work with each other and then discuss why.

# How:

The `memory-size` for a particular namespace is the maximum amount of data that namespace can store in RAM. The `high-water-memory-pct` is a threshold that activates the namespace supervisor (nsup) thread’s eviction routine. The threshold is determined by the amount RAM you are using divided by the amount of memory configured for this namespace.

So to use your example, if you have 1TB of available RAM and configure you namespace to 600GB and `high-water-memory-pct` to 60 then eviction will start at 360GB. Though NSUP now evicting, depending on how NSUP is configured it may not evict fast enough so you may still reach the 90 `stop-writes-pct` or 540 GB. Stop-writes doesn’t actually mean that all writes stop, just the writes originating from a client. Stop-writes will continue to allow replica writes and migrations to pass through.

# Why:

For the why I will refer you to this article explaining some of our choices in configuration defaults:

[https://discuss.aerospike.com/t/some-aerospike-conf-defaults-explained/863](https://discuss.aerospike.com/t/some-aerospike-conf-defaults-explained/863)
