# Reduce memory usage for Loki Query

**URL:** <https://community.grafana.com/t/reduce-memory-usage-for-loki-query/59301>\
**Category:** Grafana Loki\
**Created:** [January 19, 2022, 5:18pm UTC](https://community.grafana.com/t/reduce-memory-usage-for-loki-query/59301 "2022-01-19T17:18:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![calschut](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@calschut](https://community.grafana.com/u/calschut)\
**Post date:** [January 19, 2022, 5:18pm UTC](https://community.grafana.com/t/reduce-memory-usage-for-loki-query/59301/1 "2022-01-19T17:18:52Z")

</div>

What settings can I adjust to reduce memory usage when querying?  
I’m running loki in a single instance on a small 1CPU node and limiting memory to only a few hundred MB.

I was thinking reducing parallelism somehow

```auto
  frontend_worker:
    parallelism: 1

```

Would reducing limits\_config.max\_query\_parallelism also help?

My grafana dashboard isn’t able to complete all the loki queries without loki running out of memory.

My queries also load json twice (embedded json text) like the following which probably doesn’t help…

`{app="ingress-nginx"} !~ "(grafana|jaeger)" | json | line_format "{{.log}}" | json`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/grafana/original/2X/e/ef5308cc58c9e5a13187b5012eb99f406928462f.png) [@system](https://community.grafana.com/u/system)\
**Post date:** [January 19, 2023, 5:19pm UTC](https://community.grafana.com/t/reduce-memory-usage-for-loki-query/59301/2 "2023-01-19T17:19:26Z")

</div>

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
