-
Notifications
You must be signed in to change notification settings - Fork 137
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
go threads aren't being re-used #452
Comments
ok - so i was able to replicate what I was guessing what was going wrong -->
for some reason - go never re-uses one of the threads that it initially allocated for curl...
even after 1200 requests on linux we still only have 12 threads ->
this also explains the huge difference we see with apache bench - where you can slap it with traffic and it doesn't spawn a ton of threads ->
|
If you look at the call stack of blocked M( go created OS threads), almost 90% of them are blocked in read system call. Go parks Ms when entering a blocking system call and since there are no available M(s) to service new requests it will spawn new OS threads(M). So the real problem is that read syscall call is slow under contention and it's blocked.Not that blocked threads do not count against |
Thanks Tijoy. It's probably something messed up with connection close and freeing up blockq waiters. I'll take a look. |
verified https://github.com/nanovms/nanos/pull/459/files this fixes this && #403 |
resolved in #459 |
so I just checked this out and I think we need to figure out what go's expectation is here
https://golang.org/pkg/runtime/debug/#SetMaxThreads
golang/go#14592
however. these threads should be re-used and it looks like when using curl it issues a thread per request and then exhausts itself - so we need to figure out how to get go to re-use them
The text was updated successfully, but these errors were encountered: