Skip to content

Use a connection pool for redis-session-store#7289

Merged
zachmargolis merged 1 commit intomainfrom
margolis-pool-session-connections
Nov 4, 2022
Merged

Use a connection pool for redis-session-store#7289
zachmargolis merged 1 commit intomainfrom
margolis-pool-session-connections

Conversation

@zachmargolis
Copy link
Contributor

  • Via ConnectionPool::Wrapper which may be slightly slower

- Via ConnectionPool::Wrapper which may be slightly slower

[skip changelog]
)
end

REDIS_SESSION_POOL_WRAPPER = ConnectionPool::Wrapper.new(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was on the fence about defining this here vs in session_store.rb

Pros:

  • it's a consistent spot we define all our pools

Cons:

  • relies on alphabetical ordering of initializers

Copy link
Contributor

Choose a reason for hiding this comment

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

I kinda like it being in session_store.rb, because it keeps all the session_store stuff in one place, but I don't feel strongly about that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's true! But as a counterpoint, we missed one of our redis connection pools in this other PR because it wasn't defined in the same place: #7283 (comment)


key_prefix: "#{IdentityConfig.store.domain_name}:session:",
url: IdentityConfig.store.redis_url,
client: REDIS_SESSION_POOL_WRAPPER,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

next steps: fork session store gem to be able to use a connection pool directly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@mitchellhenke mitchellhenke left a comment

Choose a reason for hiding this comment

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

👍🏼

@zachmargolis zachmargolis merged commit dfc4d8c into main Nov 4, 2022
@zachmargolis zachmargolis deleted the margolis-pool-session-connections branch November 4, 2022 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants