Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
998 views
in Technique[技术] by (71.8m points)

.net - System.Net.ServicePointManager.DefaultConnectionLimit == 24 --> BUG?

When checking the System.Net.ServicePointManager.DefaultConnectionLimit in .Net 4 in my debugger, I see really high numbers. I see 24 on one machine and see 48 on another machine.

This is even the case for a newly created ASP.NET MVC 3 project without any configuration changes done to it. Is this a bug? The documentation clearly states that the default is 2:

The maximum number of concurrent connections allowed by a ServicePoint object. The default value is 2.

From http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.defaultconnectionlimit(v=VS.100).aspx

The DefaultNonPersistentConnectionLimit and DefaultPersistentConnectionLimit fields are more realistic 4 and 2, respectively, but the DefaultConnectionLimit number seems out of range.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It's not a bug. It's propably 12 per CPU.

The value comes from <connectionManagement> in your Web.config or Machine.config. If neither of files contains element it's probably configured by autoConfig=True setting at <processModel> element.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...