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

Reduce default idle time to 1ms #182

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

clue
Copy link
Contributor

@clue clue commented Nov 6, 2023

This simple changeset reduces the default idle time to 1ms (previously 60s). This makes it easier to use lazy connections also in short-lived applications as you no longer have to wait for it to time out for most common use cases.

The idle time can be configured using the ?idle=10.0 parameter as usual for more specific requirements. This can be particularly useful if you have a long-running application with sporadic requests to MySQL and a noticeable overhead for (re-)creating the underlying connection over a slow network.

I've also looked into renaming the "idle" time to "keepalive" but feel this would be misworded at this point. The "idle" time only defines the time the client is willing to keep the underlying connection alive without trying to automatically close it. Specifically, the mechanism does not include any messages to actively keep the connection alive using heartbeat messages.

Builds on top of #88, #87 and clue/reactphp-redis#130
Refs #147

@clue clue added this to the v0.6.0 milestone Nov 6, 2023
Copy link
Member

@WyriHaximus WyriHaximus left a comment

Choose a reason for hiding this comment

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

Nice!

@SimonFrings SimonFrings merged commit 28ccb94 into friends-of-reactphp:0.6.x Nov 7, 2023
13 checks passed
@SimonFrings SimonFrings deleted the short-idle branch November 7, 2023 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants