# Dgraph caches configuration

**URL:** https://discuss.dgraph.io/t/dgraph-caches-configuration/18494
**Category:** Dgraph
**Tags:** kind:question, area:documentation, dgraph
**Created:** [April 12, 2023, 9:53pm UTC](https://discuss.dgraph.io/t/dgraph-caches-configuration/18494 "2023-04-12T21:53:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![alexeevaa](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/alexeevaa/32/8341_2.png) [@alexeevaa](https://discuss.dgraph.io/u/alexeevaa)
#### Post date: [April 12, 2023, 9:53pm UTC](https://discuss.dgraph.io/t/dgraph-caches-configuration/18494/1 "2023-04-12T21:53:13Z")

</div>

I could not find any info on how to configure Dgraph caches.  
There is cache size, cache percentages and three caches:

```auto
PostingListCache,PstoreBlockCache,PstoreIndexCache

```

As far as i can tell PostingListCache does not work at all, but worked in 21.12 on dgraph side.  
In badger repo there is info on block cache:

> <https://github.com/dgraph-io/badger/blob/a89c52c8368658690b1669fdce4ede80cfaa2cbc/table/table.go#L78>

Also here we can find something about index cache:

> <https://github.com/dgraph-io/badger/blob/a89c52c8368658690b1669fdce4ede80cfaa2cbc/table/table.go#L514>

Seems like block cache stores decompressed parts of badger tables & index cache stores badger table indices. Both help to avoid reading from disc and doing related work. Still i have no clue how to adjust them. Are there any general rules? Like, what percentage of RAM should I use? What should I do to help writes over reads or vice versa?

---

<div class="post-metadata">

### Author: ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)
#### Post date: [April 12, 2023, 10:18pm UTC](https://discuss.dgraph.io/t/dgraph-caches-configuration/18494/2 "2023-04-12T22:18:18Z")

</div>

Like this

```auto
--cache "size-mb=1024; percentage=10,65,25;" 
#PostingListCache 10%, PstoreBlockCache 65%, PstoreIndexCache 25%

```

In general size-mb should be half of the available RAM.

The defaults are

```auto
size-mb=1024; percentage=0,65,35;

```
