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

loopback 4 services - how to configure keep-alive agent in lb4 service calls #7012

Closed
vinutha93bnvs opened this issue Jan 12, 2021 · 7 comments
Labels

Comments

@vinutha93bnvs
Copy link

vinutha93bnvs commented Jan 12, 2021

Greetings,

To enhance the performance of a http requests (http.Agent), npm offers few packages like keepaliveAgent (https://www.npmjs.com/package/agentkeepalive)

This can improve the overall performance for frequent http calls by keep-alive connection and open sockets.

Can someone please guide how to configure KeepAliveAgent while making service calls with loopback 4 services ?

@vinutha93bnvs vinutha93bnvs changed the title keep-alive connection for loopback REST services - how to configure loopback 4 services - how to configure keep-alive agent in lb4 service calls Jan 15, 2021
@vinutha93bnvs
Copy link
Author

Can i get some help

@marioestradarosa
Copy link
Contributor

@vinutha93bnvs I am a little bit confused, please clarify. Do you want to enable keep-alive whenever you call other serves from your loopback 4 application or you want to enable other clients to call your loopback 4 application and honor keep-alive: true requests ?

@vinutha93bnvs
Copy link
Author

@marioestradarosa

I am trying to optimize the connections on my server. i.e. enable keep-alive whenever you call other serves from my loopback 4 application.
More precisely, I am looking for enabling keep-alive / re-use connections on my Rest-Connector

@marioestradarosa
Copy link
Contributor

@vinutha93bnvs do you have the property gracePeriodForClose in your index.ts file ?. If so try to remove it since it should default to infinity.

Check: https://loopback.io/doc/en/lb4/apidocs.http-server.basehttpoptions.graceperiodforclose.html

@vinutha93bnvs
Copy link
Author

@marioestradarosa
I have not configured gracePeriodForClose in my application.

@stale
Copy link

stale bot commented Oct 3, 2021

This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.

@stale stale bot added the stale label Oct 3, 2021
@stale
Copy link

stale bot commented Nov 2, 2021

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants