# Consul memory exhausted

**URL:** <https://discuss.hashicorp.com/t/consul-memory-exhausted/11095>\
**Category:** Consul\
**Created:** [July 7, 2020, 6:08am UTC](https://discuss.hashicorp.com/t/consul-memory-exhausted/11095 "2020-07-07T06:08:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rinshad](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/rinshad/32/1954_2.png) [@Rinshad](https://discuss.hashicorp.com/u/Rinshad)\
**Post date:** [July 7, 2020, 6:08am UTC](https://discuss.hashicorp.com/t/consul-memory-exhausted/11095/1 "2020-07-07T06:08:01Z")

</div>

Hello,

Vault configured with 2 vault server and 3 consuls. Last week we moved two vault server under a load balancer after this change we have noticed all 3 consul memory (8G per node) exhausted. Also, vault servers are unsealed multiple times. Below are the errors which we noticed during this issue.

```
    vault[16184]: 2020-07-03T13:04:48.082Z [ERROR] expiration: failed to revoke lease: lease_id=sys/wrapping/wrap/h1bc3e02
 vault[16184]: 2020-07-03T13:04:58.081Z [ERROR] expiration: shutting down, not attempting further revocation of lease:
vault[16184]: 2020-07-03T13:02:55.903Z [INFO] expiration: revoked lease: lease_id=auth/prod/xxxx/xxx/xxxx/login/ ************************

vault[16184]: 2020-07-03T13:03:52.012Z [DEBUG] expiration: leases loading: progress=24000
vault[16184]: 2020-07-03T13:04:10.836Z [ERROR] core: failed to create token: error="failed to persist accessor index entry: Unexpected response code: 500 (rpc error making call: rpc error making call: EOF)"

Jul 03 13:04:10 vault[16184]: 2020-07-03T13:04:10.842Z [ERROR] expiration: failed to revoke lease: lease_id=sys/wrapping/wrap/h41 error="failed to read lease entry sys/wrapping/wrap/he1: Unexpected response code: 500"

```

As a temporary solution, we have doubled the memory size. Does anybody have any solution for the above-mentioned errors?

Thanks

---

<div class="post-metadata">

**Author:** ![mikegreen](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/mikegreen/32/3160_2.png) [@mikegreen](https://discuss.hashicorp.com/u/mikegreen)\
**Post date:** [July 7, 2020, 2:05pm UTC](https://discuss.hashicorp.com/t/consul-memory-exhausted/11095/2 "2020-07-07T14:05:42Z")

</div>

Consul maintains all data in memory. How big is your Consul database? You can get an idea by looking at a snapshot.  
You can start investigating your data here [https://learn.hashicorp.com/vault/monitoring/inspecting-data-consul](https://learn.hashicorp.com/vault/monitoring/inspecting-data-consul)

Possibly you have something generating a lot of leases with longer TTLs, ie, hundreds of thousands.  
Are you seeing anything like this in the log:  
`[WARN] expiration: lease count exceeds warning lease threshold`
