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

Reuse http client #962

Merged
merged 3 commits into from
Aug 21, 2024
Merged

Conversation

aleksmaus
Copy link
Contributor

What type of PR is this?

/kind feature

Any specific area of the project related to this PR?

/area outputs

What this PR does / why we need it:

This PR reuses http.Client instance for the outputs, were it was previously created per each request.
The http.Client reuse is recommended:
https://cs.opensource.google/go/go/+/refs/tags/go1.22.6:src/net/http/client.go;l=34

We are seeing 3-4x increase of throughput for Elasticsearch output in out tests.

I tried to keep the approach to the http client and the transport creation the same as before, namely logging and continuing on error, extracted some code into the function.

@poiana poiana requested review from Issif and leogr August 6, 2024 22:07
@poiana
Copy link

poiana commented Aug 6, 2024

Welcome @aleksmaus! It looks like this is your first PR to falcosecurity/falcosidekick 🎉

@poiana poiana added the size/L label Aug 6, 2024
Signed-off-by: Aleksandr Maus <[email protected]>
@aleksmaus aleksmaus force-pushed the feature/reuse_http_client branch from 7cbd6f6 to c5c5208 Compare August 6, 2024 22:13
@Issif Issif added this to the 2.30 milestone Aug 7, 2024
@Issif Issif self-assigned this Aug 7, 2024
Signed-off-by: Aleksandr Maus <[email protected]>
@Issif
Copy link
Member

Issif commented Aug 7, 2024

Hi,

This is an interesting PR, thanks. I can't review for now, I'm on a family road trip for 2 weeks. Will review when I'm back

@aleksmaus
Copy link
Contributor Author

I can't review for now, I'm on a family road trip for 2 weeks. Will review when I'm back

Thank you! Have a great trip!

Copy link
Member

@Issif Issif left a comment

Choose a reason for hiding this comment

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

seems all good to me 👍

@poiana poiana added the lgtm label Aug 21, 2024
@poiana
Copy link

poiana commented Aug 21, 2024

LGTM label has been added.

Git tree hash: de419f827e62e07c36d901ac91486cb2cba4e26f

@poiana
Copy link

poiana commented Aug 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aleksmaus, Issif

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana merged commit 54ac9bb into falcosecurity:master Aug 21, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants