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
ClientPool - extending pool / add new clients dynamically #692
Comments
Hi @RomanPoprava , |
Unfortunately I don't have any examples in existing load-testing frameworks.
This approach can be used for testing both Open and Closed systems. And here is some example part of the implementation:
And the client pool class is:
And my client is:
I am actively testing and finishing implementation of this pool right now, so please let me know what do You think, maybe You have some better ideas how to handle this case. Thank you. :) |
@RomanPoprava It seems that you would like to have a dynamically Resizable Client Pool. I like your idea, and I remember I also wanted to provide something similar. The only thing that stopped me from building it was that such an abstraction is problematic to make generic. Imagine you have a WebSocket, and you would like to use a Resizable Client Pool. Imagine now that your ClientPool is full, and it needs to be resized to add more WebSocket clients. The thing is that adding WebSocket means not just creating a WebSocketClient (like you have with HTTP) but rather creating an instance of WebSocket plus initiating a connection. Only after initializing/opening a connection can you treat such an instance of WebSocket as ready to use from your ClientPool. Now, you have a problem: you don't want to block your test execution while waiting to initialize a new WebSocketClient. Because of this, this "resize" should be quite smart and invoked in the background before the real need to get WebScoketClient from ClientPool. Basically, we should support some configuration for the Client Pool to start a "heavy" resize process ahead of time. I like the idea of a resizable Client Pool; we just need to define a simple API for it. |
As an option to implement this - create a buffer of clients for the client pool. |
Currently given by NBomber client pool can be initialized with constant number of clients, before the bombing phase.
It's hard to calculate necessary number of clients for open system type load simulation. So in some cases you can underestimate clients count needed for client pool. And during bombing your client pool will not have any available clients for the new threads.
Example:
in
WithInit()
you are creating 10 clients and adding them into client pool.in
.WithLoadSimulations()
you are setting e.g.Inject
for 20 virtual users with interval 1 second with duration 1 minute.The text was updated successfully, but these errors were encountered: