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

Set size of connection pool greater than concurrency by default #21

Open
nsoufr opened this issue Sep 3, 2018 · 3 comments
Open

Set size of connection pool greater than concurrency by default #21

nsoufr opened this issue Sep 3, 2018 · 3 comments
Labels
next-release v1.0 Roadmap to reach stable API

Comments

@nsoufr
Copy link

nsoufr commented Sep 3, 2018

Because of the nature of Upperkut, it needs a certain number of connections to work properly in terms of performance. And it needs even more connections when users increase concurrency option.

So by default, we need to implement a default pool size that is greater than the concurrency option and enable users to customize it when they want.

class MyWorker
  setup_upperkut do |config|
    config.strategy = Upperkut::Strategy.new(self, redis: { url: ENV['REDIS_URL'], size: 200 } )
  end
end
@nsoufr nsoufr added v1.0 Roadmap to reach stable API next-release labels Sep 4, 2018
@lucaskds
Copy link
Contributor

We need a better approach because we're passing self to the strategy but is possible to change the concurrency after the Strategy instantiation, like:

class MyWorker
  setup_upperkut do |config|
    config.strategy = Upperkut::Strategy.new(self, redis: { url: ENV['REDIS_URL'] } )
    config.concurrency = 30
  end
end

This will cause a config with size = 5 and concurrency = 30... 🚫

@nsoufr
Copy link
Author

nsoufr commented Sep 13, 2018

🤔

@nsoufr
Copy link
Author

nsoufr commented Sep 19, 2018

We need to benchmark other gems in order to make a decision here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next-release v1.0 Roadmap to reach stable API
Projects
None yet
Development

No branches or pull requests

2 participants