Jagadesh Reddy
Jagadesh Reddy

Reputation: 1

Trino application to release the memory within few mins

I've got my HPA like this. The pods are scaling well but its not scaling down and the memory is below threshold level. Applications are not releasing the memory. Waiting from past 2 hrs but still the apps are not releasing the memory and the pods are not coming down. How to overcome this issue.

Currently there is not much load on the memory. There is no running queries found in Trino.

After restarting the pods, the memory got released. How the trino application can release the memory within few mins.

HPA

Upvotes: 0

Views: 458

Answers (3)

Lester Martin
Lester Martin

Reputation: 331

OSS Trino, and vendors such as Starburst, usually leverage CPU utilization as the determining fractor to scale up/down instead of memory. This article talks a bit about this approach; https://medium.com/bestsecret-tech/maximize-performance-the-bestsecret-to-scaling-trino-clusters-with-keda-c209efe4a081

Upvotes: 0

AirGuy
AirGuy

Reputation: 1

Trino, like many JVM-based applications, retains allocated memory within its process even if it's no longer in use, making it unavailable for the OS, and only a pod restart forces the JVM to release it.

Upvotes: 0

David Ogren
David Ogren

Reputation: 4810

I don't know anything about Trino, but lots of applications do not release memory, especially Java applications. Java applications (and fundamentally any application with GC) manage their own memory and so releasing memory is difficult and generally non-productive.

In general, I find HPA based on memory to be the wrong decision unless you really know what you are doing. I'd autoscale based on CPU if you need to autoscale.

EDIT: Some quick investigation does seem to show that Trino is a Java application. So it will never release memory. Memory based HPA is never going to work.

Upvotes: 0

Related Questions