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

Memory peak when UI is used #121

Open
osoykan opened this issue Sep 19, 2024 · 3 comments
Open

Memory peak when UI is used #121

osoykan opened this issue Sep 19, 2024 · 3 comments

Comments

@osoykan
Copy link

osoykan commented Sep 19, 2024

Hi,

I’m using the db-scheduler UI extension and have developed a Ktor plugin for Kotlin based on this library. I haven’t tried the Spring Boot version yet.

In my Kotlin application, I utilize TaskLogic. During load testing with the showData option enabled, I observed that simply refreshing or accessing the /db-scheduler page causes memory usage to peak. I believe this is because db-scheduler eagerly populates a list through a consumer instead of exposing a Flux, as seen in Caching.java (Lines 48-53). Whereas pageSize should be considered before executing the query or limiting the Flux before it is collected.

For example, with 10k scheduled tasks each containing 150KB of data, the UI attempts to retrieve 150MB of data on every refresh and mouse hover unless showData is disabled. Even when showData is turned off, the UI still fetches task names and dates for all 10k items, effectively ignoring the pageSize setting.

Have you encountered this issue before, or is there a configuration option available to modify this behavior?

Thanks!

@geirsagberg
Copy link
Collaborator

I have the same issue myself. I suspect db-scheduler must be updated to support paging, alternatively db-scheduler-ui must implement a direct fetch from the databse, though that would be more brittle and DB-specific.

@geirsagberg
Copy link
Collaborator

In general, I try to keep the tasks as small as possible, and rather use IDs as data, with each tasks fetching the data it needs. We still run into an issue when we have 3 million tasks scheduled though 😅

@kagkarlsson
Copy link
Collaborator

Yeah the SchedulerClient sdk for fetching scheduled executions currently does not support pagination, which may cause some problems for use-cases with lots of executions.

Feel free to file a feature-request for it in db-scheduler 👍

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

3 participants