# Load data until hwm (High Water Memory) when cold start

**URL:** <https://discuss.aerospike.com/t/load-data-until-hwm-high-water-memory-when-cold-start/1826>\
**Category:** How Aerospike Works\
**Created:** [September 11, 2015, 6:57am UTC](https://discuss.aerospike.com/t/load-data-until-hwm-high-water-memory-when-cold-start/1826 "2015-09-11T06:57:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiaosuo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/xiaosuo/32/342_2.png) [@xiaosuo](https://discuss.aerospike.com/u/xiaosuo)\
**Post date:** [September 11, 2015, 6:57am UTC](https://discuss.aerospike.com/t/load-data-until-hwm-high-water-memory-when-cold-start/1826/1 "2015-09-11T06:57:19Z")

</div>

My db’s ram size was over the HWM, and after a cold start, some data was lost due to HWM. Is that correct?

BTW: I disabled eviction.

---

<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:** [September 11, 2015, 9:58pm UTC](https://discuss.aerospike.com/t/load-data-until-hwm-high-water-memory-when-cold-start/1826/2 "2015-09-11T21:58:55Z")

</div>

> [@xiaosuo](#):
>
> My db’s ram size was over the HWM, and after a cold start, some data was lost due to HWM. Is that correct?

Correct, during coldstart, Aerospike reads up the the defined high water marks and evicts when the mark is exceeded.

> [@xiaosuo](#):
>
> BTW: I disabled eviction.

Can you describe how you have disabling evictions?

---

<div class="post-metadata">

**Author:** ![xiaosuo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/xiaosuo/32/342_2.png) [@xiaosuo](https://discuss.aerospike.com/u/xiaosuo)\
**Post date:** [September 12, 2015, 7:43am UTC](https://discuss.aerospike.com/t/load-data-until-hwm-high-water-memory-when-cold-start/1826/3 "2015-09-12T07:43:09Z")

</div>

I have configured asd:

```
namespace xxx {
  evict-tenths-pct 0
}

```

At the same time, no ttl is set for every key.

---

<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:** [September 14, 2015, 5:58pm UTC](https://discuss.aerospike.com/t/load-data-until-hwm-high-water-memory-when-cold-start/1826/4 "2015-09-14T17:58:36Z")

</div>

> [@xiaosuo](#):
>
> evict-tenths-pct 0

The typical way to disable eviction is to increase the [high-water-memory-pct](http://www.aerospike.com/docs/reference/configuration/#high-water-memory-pct) and [high-water-disk-pct([Configuration Reference | Aerospike Documentation](http://www.aerospike.com/docs/reference/configuration/#high-water-disk-pct)) to 100. After a quick code inspections I suspect setting [evict-tenths-pct](http://www.aerospike.com/docs/reference/configuration/#evict-tenths-pct) to 0 could result in an endless loop on coldstart.

> [@xiaosuo](#):
>
> At the same time, no ttl is set for every key.

If my code inspection is correct, this would be the reason why you didn’t hit that issue.

Could you provide the output of:

```auto
asadm -e "show distribution"

```

And if are you able to provide the logs from the coldstart?

---

<div class="post-metadata">

**Author:** ![xiaosuo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/xiaosuo/32/342_2.png) [@xiaosuo](https://discuss.aerospike.com/u/xiaosuo)\
**Post date:** [September 15, 2015, 3:08am UTC](https://discuss.aerospike.com/t/load-data-until-hwm-high-water-memory-when-cold-start/1826/5 "2015-09-15T03:08:26Z")

</div>

Maybe high-water-memory-pct is better than evict-tenths-pct, since nsup won’t scan all the partitions. But I think we should load data until stop-write other than hwm, as we allow to write more data between hwm and sw, there is no reason to stop it on cold start.

I read the related code again, but failed to find the dead loop.

Although I think there is noting to do with the cluster topology, here is the output

```
Percentage of records having objsz less than or equal to
                   value measured in Record Blocks
    Node 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
in24-140 3 3 4 4 4 5 6 8 12 100
in24-145 3 3 4 4 4 5 6 8 12 100
in24-146 3 3 4 4 4 5 6 8 12 100
in24-147 3 3 4 4 4 5 6 8 12 100
in24-148 3 3 4 4 4 5 6 8 12 100
in24-149 3 3 4 4 4 5 6 8 12 100
Number of rows: 6
```

I am sorry but the log was rotated and deleted.

---

<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:** [September 16, 2015, 1:16am UTC](https://discuss.aerospike.com/t/load-data-until-hwm-high-water-memory-when-cold-start/1826/6 "2015-09-16T01:16:37Z")

</div>

The `show distribution` should have had more output, I was looking for the TTL histogram.

> [@xiaosuo](#):
>
> But I think we should load data until stop-write other than hwm, as we allow to write more data between hwm and sw, there is no reason to stop it on cold start.

The main reason for this is that the RAM allocated to the primary index is never freed; if we were to read to SW and then evict to HWM, the extra arenas allocated to hold the additional records will not be released. For some deployments, this could be a significant amount of RAM.

---

<div class="post-metadata">

**Author:** ![xiaosuo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/xiaosuo/32/342_2.png) [@xiaosuo](https://discuss.aerospike.com/u/xiaosuo)\
**Post date:** [September 17, 2015, 7:43am UTC](https://discuss.aerospike.com/t/load-data-until-hwm-high-water-memory-when-cold-start/1826/7 "2015-09-17T07:43:46Z")

</div>

```
~~~~~~~~~~~~~~~impression - TTL Distribution in Seconds~~~~~~~~~~~~~~
        Percentage of records having ttl less than or equal to
                      value measured in Seconds
    Node 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
in24-140 0 0 0 0 0 0 0 0 0 0
in24-145 0 0 0 0 0 0 0 0 0 0
in24-146 0 0 0 0 0 0 0 0 0 0
in24-147 0 0 0 0 0 0 0 0 0 0
in24-148 0 0 0 0 0 0 0 0 0 0
in24-149 0 0 0 0 0 0 0 0 0 0
Number of rows: 6
```

I think it is correct as we don’t use any TTL mechanism.

Thanks.
