Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kamalaboulhosn
Copy link

When this code was originally added, it seems it was commented out. Uncommenting it out avoids throttling of threadpool worker thread creation. With the throttling, operations such as parallel https requests are slowed down significantly due to all of the threads created in order to complete the SSL operations.

@kumpera
Copy link
Contributor

kumpera commented May 16, 2013

This creates too much burden at startup for mobile apps. Not really an option.

@knocte
Copy link
Contributor

knocte commented May 16, 2013

Cannot it then be wrapped under a #if !MOBILE directive?

@blucz
Copy link
Contributor

blucz commented May 16, 2013

Rodrigo,

I appreciate that simply uncommenting this might not be acceptable, but we should still endeavor to fix the problem. Not all users of mono are in mobile environments.

Even making a relatively modest (3-5) number of parallel SSL requests before the threadpool has had time to scale out paralyzes the runtime, causing delays that sometimes exceed 5-10s and unexpected latency in many places since the threadpool is so heavily used.

Here's two proposals:

(1) Make this a configuration option, either as an environment variable or otherwise, so users who don't intend to be unwittingly affected by mobile platform optimizations can opt out of this conservative behavior.

(2) Apply the patch, but also reduce MinThreads defaults on mobile platforms to reflect the number of threads that may be safely created quickly at startup. This way, mobile users still get the slow growth by default, but anyone who wants to allow faster on-demand thread creation can opt in using the ThreadPool.SetMinThreads API.

Would you be inclined to accept a patch that implemented either of these?

@alexrp
Copy link
Contributor

alexrp commented Jul 2, 2013

I think (2) seems like a reasonable approach. @kumpera ?

@migueldeicaza
Copy link
Contributor

Hey guys,

This is not only a problem for mobile, it is also a problem for desktops.

Luckily, we already have a --server option (which btw, needs documenting) which can be used to add these behavioral changes. So let us use that existing flag.

@knocte
Copy link
Contributor

knocte commented Aug 2, 2013

Hey @migueldeicaza , I've implemented your suggestion in this alternative pull request: #725 . Thanks

@knocte
Copy link
Contributor

knocte commented Aug 16, 2013

PR #725 was merged, so then I guess this PR can be closed too.

@kumpera kumpera closed this Aug 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants