Skip to content

[surfacer.postgres] Postgresql surfacer bulk inserts - #717

Merged
manugarg merged 9 commits into
cloudprober:masterfrom
markoposavec:postgresql-surfacer-bulk-inserts
Apr 18, 2024
Merged

manugarg merged 9 commits into
cloudprober:masterfrom
markoposavec:postgresql-surfacer-bulk-inserts

Conversation

@markoposavec

Copy link
Copy Markdown
Contributor

Hello!
I've added option to add bulk writing into postgres database. Currently all metrics from one metrics event object are written in one transaction which was very slow in my use case because of slow connections towards database. I've added batching of metrics events into one transaction. This change improved the speed in my use case by ~10x.

With default values system is working as it was before, event metrics are sent one by one to database.

Let me know if I should change anything,
Thanks!

@markoposavec markoposavec changed the title Postgresql surfacer bulk inserts [surfacer.postgres] Postgresql surfacer bulk inserts Apr 10, 2024

@manugarg manugarg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @markoposavec for this PR. Please take a look at the inline comments.

Comment thread surfacers/internal/postgres/postgres.go Resolved
Comment thread surfacers/internal/postgres/postgres.go Resolved
Comment thread surfacers/internal/postgres/postgres.go Resolved
Comment thread surfacers/internal/postgres/postgres.go Resolved
@markoposavec

Copy link
Copy Markdown
Contributor Author

For some reason made a rebase and it shows changes from the other commit about tls.

@manugarg

Copy link
Copy Markdown
Contributor

For some reason made a rebase and it shows changes from the other commit about tls.

That's weird. Can you try the following:

git checkout master
git pull master
git checkout <your branch name>
git rebase master
git push -f

I am not sure if above will work, might need to check internet :)

maposavec and others added 8 commits April 16, 2024 08:07
)

- This is important for Windows tests where deleting the test binary
fails if it's still executing (for testing external probe process).
- We use a temp pids file to collect the pids of the started processes 
and kill those pids before exiting the test.
@markoposavec

Copy link
Copy Markdown
Contributor Author

that fixed the issue, thanks 😄

@manugarg manugarg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor suggestion. Looks good otherwise.

Comment thread surfacers/internal/postgres/postgres.go Resolved
@manugarg
manugarg merged commit b132c0e into cloudprober:master Apr 18, 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

Successfully merging this pull request may close these issues.

2 participants