-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Very high memory consumption after updating to latest redash version #7048
Comments
Hello friends, this proble is still buggin us. We use the latest redash version and try to execute a query as simple as this:
Please notice that the passenger table is really big (like 200M rows). The problem is when we run the query the redash rqworker starts consuming huge amounts of memory (like 10GB, all the free memory of the server) and makes the whole server unresponsive. Can you please give a little love to this because we can't really use redash if we have this problem. |
There must definitely be a memory leak somewhere. Can you try running a query returning a lot of resutls on a postgresql database to check the behaviour ? |
That's a good example of a SQL query to never run, as that will attempt to return the entire contents of the table (all fields, all data) back to Redash, which will attempt to fit that in memory. Instead you should be running queries that extract the summary data you want. Something like this instead:
Which will return the number of rows in the |
First of all I am aware of the fact that this query returns a lot of data and shouldn't be run (usually), however please notice:
For now I have implemented a hacky solution of allowing the queries to run for up to 30 seconds before killing them so the leak can't grow that big and make the server unresponsive. However this means that we can't run most queries in redash and need to use dbeaver or psql directly. As I said before this definitely is a bug that has been introduced in the previous year or something, I had never had a similar problem with redash and I am using it for like 7 years (the oldest query in my self-hosted server is from May 2017)! |
Oh. I thought that had already been implemented for most data sources ages ago. It sounds like you're either not using one of the one's it's implemented for, or there may indeed be a bug. 😦 |
are we talking about #78? it's been 10 years and still open 😁 |
No i don't think that this is related to the #78. This is a new issue, I don't remember having is before. |
well i remember differently 🤷♂️ |
if you're using aws, you can always set a maximum-returned-rows on the db side. |
No we use self hosted postgres. For now we cancel the query after 30 s but this isn't a good solution for our needs. |
then i suggest "monitoring + education + training". a couple of years ago we had the same problem: inexperienced people doing
little to no out-of-memory issue afterwards |
Thank you @zachliu I'll try it this way! |
Hello, I'm using the latest redash version (from github): commit 76b5a30. This has been installed on a bare metal alma 9 server. After updating to this version I experience very large memory consumption from the rq worker (I start it with
python manage.py rq worker
). It takes all the memory of the server (like 15 GB and even the swap file) making the server unresponsive while the query runs. The query finishes after 10 minutes or so and returs the resuts so I don't get any actual error.However the same query takes 1-2 seconds when I run it on dbeaver and returns ~ 2000 rows.
Please notice that I experience this behavior only on that query, for other (smaller) queries it works without problems.
The query is run on postgres 15.
Thank you for any help
The text was updated successfully, but these errors were encountered: