Git Product home page Git Product logo

Comments (4)

dstathis avatar dstathis commented on June 27, 2024

There seems to be two issues here:

  1. Queries larger than a certain size are blocked. This is clearly related to the linked bug and should be easy to fix if we are okay increasing the value. We can discus this within the team.
  2. Loki crashes. This does not happen in the upstream issue. What resources are available to the Loki pod on your system? It might not be enough to handle such large queries. Do you have the cpu or memory config values set? How much memory does your k8s system have?

from loki-k8s-operator.

cbartz avatar cbartz commented on June 27, 2024

@dstathis We are using 1 Gi for memory and cpu config is unset.

In terms of memory:

$ kubectl top pod loki-0
NAME     CPU(cores)   MEMORY(bytes)   
loki-0   19m          711Mi
root@loki-0:/# cat /sys/fs/cgroup/memory.max 
1073741824

the container requests

    resources:
      limits:
        memory: "1073741824"
      requests:
        cpu: 250m
        memory: 200Mi

The particular k8s node has 32 GiB of total memory.

from loki-k8s-operator.

sed-i avatar sed-i commented on June 27, 2024
  • Are you able to manually temporarily update the loki config with a higher grpc_server_max_send_msg_size? You can juju ssh, apt install vim, edit /etc/loki/loki-local-config.yaml and pebble restart loki. If this works then we could easily add it as a config option.
  • Perhaps you could narrow down your LogQL queries so they return less data?

from loki-k8s-operator.

cbartz avatar cbartz commented on June 27, 2024

Thanks for your answers. I will close the ticket as the cause of the crash seems to be clearly memory related (137 exit code) and not due to the ResourceExhausted (I saw this also for other queries without the ResourceExhausted), so this probably indicates that we need to increase the memory (1 Gi seems to be too low, just tested with 2 Gi and at first glance it looks better). I wonder if the charm could log a memory-related warning in this case (if loki exits with 137) to avoid the operator having to look into the k8s logs for troubleshooting.

If necessary I will open another issue related to the grpc_server_max_send_msg_size config, I could not reproduce it so far this morning.

And of course narrowing the LogQL queries helps, but sometimes it is hard to narrow when you need to find the root cause of an issue first (so you need to know what to narrow for).

from loki-k8s-operator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.