Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout when filtering summary with many heartbeats #717

Closed
SamuelScheit opened this issue Dec 10, 2024 · 1 comment
Closed

Timeout when filtering summary with many heartbeats #717

SamuelScheit opened this issue Dec 10, 2024 · 1 comment

Comments

@SamuelScheit
Copy link

Describe the bug
I'm self hosting a wakapi instance for myself and I have 729.427 total hearbeats since 2022.
I have imported the data from wakatime and I've regenerated the summaries.
The overall summary works fine, as well as the time filter (also custom time ranges).
However when I try to use the following filters:

  • machine
  • language
  • category
  • project

the page loads for ~30 seconds and fails with a timeout.

When I retry the request with curl it fails with the following error:

curl: (52) Empty reply from server

The server logs the following line, but no errors:

2024-12-10T17:22:38.737153817Z {"time":"2024-12-10T17:22:38.733583204Z","level":"INFO","msg":"[request]","status":200,"method":"GET","uri":"/summary?interval=any&project=respond","duration":66486640442,"bytes":4096,"addr":"172.22.0.1:53906","user":"samuelscheit"}

System information
I'm using the docker compose template for hosting on a VPS with 8 Cores and 24GB Ram.

When I run the request the system is not overloaded and has ~80% CPU usage and ~40% RAM usage.

  • Wakapi v2.12.2
  • Linux 6.8.0 Ubuntu 24.04
  • Docker 27.3.1
  • Database postgres
@muety
Copy link
Owner

muety commented Dec 10, 2024

This is very much related to #716, so I'll close this issue and propose to continue the discussion there.

However, even though we can't utilize neither caching nor indexed queries for the given reasons, the request shouldn't take that long. On wakapi.dev (which btw. runs on much smaller hardware), a filtered query takes around ~ 10 s for me with a total of 652k heartbeats (MySQL though). Could you possibly look into tuning some database parameters?

Anyway, given that you're the second user to bring this up recently, I'll put this issue on top of my prio list (even though I actually can't think of a viable solution right now).

@muety muety closed this as completed Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants