-
Notifications
You must be signed in to change notification settings - Fork 828
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 Leak doing INSERT on High-Load service #2109
Comments
sorry, just asked ai to generate issue) |
SwiftBike3317
changed the title
Memory Leak doing INSERT on High-Load golang service
Memory Leak doing INSERT on High-Load service
Aug 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
High Memory Allocation Leading to OOM Killers When Writing High RPS to PostgreSQL
Description
I'm encountering an issue where my Golang service, which processes around 10,000 requests per second (RPS), is causing the container to eventually be terminated by the OOM killer due to high memory allocation that isn't being cleared effectively.
The service is designed to write all incoming data to a PostgreSQL database. After running for a while, memory usage increases steadily, and it seems that garbage collection isn't able to keep up, eventually leading to an out-of-memory (OOM) condition.
Current Implementation
Data Handling:
Database Insertion:
I'm using the
pgxpool
package for managing database connections with the following settings:Data insertion looks like this:
Previous Attempts:
postgresql.conf
and insert after handling every request in separate goroutine .Observed Problem
Steps to Reproduce
Expected Behavior
Actual Behavior
Environment
1.22.5
16.4
5.6.0
Potential Solutions Considered
The text was updated successfully, but these errors were encountered: