Forum Discussion
12 years ago
Since this is my first post here I would like to thank soapUI team for the best web service test tool, not even counting it's also open source!!! Thank you, and keep up the fantastic work
Now, about this bug.
Funny but I actually kind of fixed it 6 weeks ago on my local soapUI installation. It took 2 lines of code on the right place to use the configuration already existing in soapUI global settings (soapUI Preferences -> HTTP Settings -> Max Connections per Host). It works great and soapUI restart is not required when changing the configuration.
Here's what I did, I added the 2 lines in SoapUIMultiThreadedHttpConnectionManager.IdleConnectionMonitorThread.run(). This is how run() looks like right now:
Now, about this bug.
Funny but I actually kind of fixed it 6 weeks ago on my local soapUI installation. It took 2 lines of code on the right place to use the configuration already existing in soapUI global settings (soapUI Preferences -> HTTP Settings -> Max Connections per Host). It works great and soapUI restart is not required when changing the configuration.
Here's what I did, I added the 2 lines in SoapUIMultiThreadedHttpConnectionManager.IdleConnectionMonitorThread.run(). This is how run() looks like right now:
@Override
public void run()
{
try
{
while (!shutdown)
{
// patch by eSandrei
// defaults are 2/20 connections which is a bottleneck for a load test (even if you run the load with 100 threads they will all
// wait in line for the 2 connections)
// changing to use SoapUI HTTP preferences (I hardcoded defaults 500/2000 as in other classes but these should be centralized)
// stubbed here and not in the outer class constructor to apply preferences without restarting SoapUI
// also, didn't choose request/releaseConnection because it is called too often, this one looks
// like it's called only when connMng is idle or every 5s
((ThreadSafeClientConnManager)connMgr).setDefaultMaxPerRoute((int)SoapUI.getSettings().getLong(HttpSettings.MAX_CONNECTIONS_PER_HOST, 500L));
((ThreadSafeClientConnManager)connMgr).setMaxTotal((int)SoapUI.getSettings().getLong(HttpSettings.MAX_TOTAL_CONNECTIONS, 2000L));
synchronized (this)
{
wait(5000);
// Close expired connections
connMgr.closeExpiredConnections();
// Optionally, close connections
// that have been idle longer than 30 sec
connMgr.closeIdleConnections(30, TimeUnit.SECONDS);
}
}
}
catch (InterruptedException ex)
{
// terminate
}
}
Related Content
- 11 months agonastester
- 5 years agokaiiii
- 2 years agojaredjamieson