This repository has been archived by the owner on Jan 31, 2024. It is now read-only.
forked from lpgauth/lhttpc
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding control flow on connections refused
When many connections were being refused, the load balancer would impose no good control flow mecanism on incoming requests. After a while, demand can overtake the process and grow the message queue until the VM goes out of memory. This patch adds a counter of refused connections (happens when the server is down); if too many connections are refusd in a row (as many as the possible sockets), some of the requests will be blocked and will return {error, offline}. Whenever a successful request is made, the counter is dropped. The patch also contains a few minute optimizations for record assignment, gaining minimal amounts of speed.
- Loading branch information
Showing
1 changed file
with
43 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters