Replies: 3 comments 4 replies
-
We cannot tell without a traffic capture or profiler information. IIRC there was a reason in 6.x that's been resolved months ago. In general, this client does not optimize for such use cases. In fact, high connection churn and short-lived connections are considered really bad practices. |
Beta Was this translation helpful? Give feedback.
-
Start with a larger thread pool size in your application: In a production application you would not be creating so many connections at once. |
Beta Was this translation helpful? Give feedback.
-
@wj8400684 @davebally please take the time to test the next major release of this library, which does not have this issue: https://www.nuget.org/packages/RabbitMQ.Client/7.0.0-alpha.6 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
var factory = new ConnectionFactory
{
VirtualHost = ConnectionFactory.DefaultVHost,
//AutomaticRecoveryEnabled = true,
HostName = DefaultHost,
UserName = DefaultUserName,
Password = DefaultPassWord,
Port = DefaultPort,
};
var watch = new Stopwatch();
for (int i = 0; i < 100; i++)
{
watch.Restart();
var rabbitmqConnection = factory.CreateConnection(Guid.NewGuid().ToString("n"));
watch.Stop();
}
0 => 80 milliseconds
1 => 6 milliseconds
2 => 1 milliseconds
3 => 3 milliseconds
4 => 3 milliseconds
5 => 3 milliseconds
6 => 3 milliseconds
7 => 3 milliseconds
8 => 3 milliseconds
9 => 3 milliseconds
10 => 9 milliseconds
11 => 4 milliseconds
12 => 3 milliseconds
13 => 3 milliseconds
14 => 3 milliseconds
15 => 3 milliseconds
16 => 3 milliseconds
17 => 3 milliseconds
18 => 1 milliseconds
19 => 744 milliseconds
20 => 1017 milliseconds
21 => 1 milliseconds
22 => 1011 milliseconds
23 => 1006 milliseconds
24 => 510 milliseconds
25 => 1021 milliseconds
26 => 1011 milliseconds
27 => 1018 milliseconds
28 => 508 milliseconds
29 => 515 milliseconds
30 => 1024 milliseconds
31 => 510 milliseconds
32 => 1013 milliseconds
33 => 1025 milliseconds
34 => 1025 milliseconds
35 => 1014 milliseconds
Beta Was this translation helpful? Give feedback.
All reactions