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 external HTTP connections from workers #269

Open
Angelmmiguel opened this issue Apr 12, 2024 Discussed in #268 · 0 comments
Open

Reuse external HTTP connections from workers #269

Angelmmiguel opened this issue Apr 12, 2024 Discussed in #268 · 0 comments
Labels
🚀 enhancement New feature or request

Comments

@Angelmmiguel
Copy link
Contributor

Discussed in #268

Originally posted by dlozina March 29, 2024
Hi all,

First of all thank you for this project. I am really glad that we can build workers in such a quick manner and test them out.

A key feature of our Workers is their ability to perform HTTP requests externally. This capability allows our Worker to accept data from a client, modify it, and then forward it to another service or worker.

Currently, I'm exploring a use case that involves retrieving data, processing it, and then saving it to Data Storage. This requires one HTTP request to fetch data from Data Storage and another to save the processed data back.

However, I've observed that while it's possible to initiate multiple HTTP requests within the workers, these requests don't reuse connections when directed to the same server. For HTTPS requests, this necessitates a new handshake for each request, leading to slower execution times. This could be due to the fact that each request initiated by a worker potentially launches a new thread and a separate reqwest client, making connection pooling unfeasible.

Is there a workaround or solution for this issue that would allow us to reuse connections, especially since the requests are being made from the host machine? (We don't need any modifications to wasam interface)
Can we reuse the same instance of the reqwest client and enable connection pooling.

Thank you!

Dino

@Angelmmiguel Angelmmiguel added the 🚀 enhancement New feature or request label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant