curl-library
Re: Locking and multi on multiple connections.
Date: Thu, 9 Dec 2010 09:40:51 +0100 (CET)
On Thu, 9 Dec 2010, Michael Menegakis wrote:
> I identified at least part of this problem. The Ubuntu VirtualBox I test it
> on doesn't have a libcurl with c-ares support. Apparently, several other
> projects identified the problem and as of a message from 2 days ago (what
> are the odds?), it's pending for approval and inclusion in their next
> updates.
If you think ubuntu upstream is going to ship such a libcurl with c-ares in
the short term, then I think you need to reconsider. libcurl with c-ares still
have issues that we haven't fixed that cause problems to some amount of
people. Both debian and fedora have already tried to ship curl packages built
with c-ares and had to revert them.
But you can of course build your own libcurl with c-ares enabled, it's both
quick and easy to do. Or you can build it to use the threaded resolver which
accomplishes the same effect here.
> I came to googling that after benchmarking that specifically
> curl_multi_perform() produced a tough blocking.
Yes, if you're using libcurl built to use the ordinary synchronous name
resolver, libcurl will block during name resolves. And libcurl is then likely
to do a resolve on the first request and then it might re-use the resolved
info in subsequent requests if the same host name is used.
> I get the idea windows had it too but very rarely compared to that (c-ares
> bug?). I don't discount it yet though.
libcurl for windows builds with a threaded resolver by default so it doesn't
suffer from the name resolve blocking when built so.
> It leaves the blocking I noticed on very rapidly packed simultaneous
> easies, but I have it at least workarounded it with a simple flood
> protection.
It doesn't have anything to do with "flooding".
BTW, there are also a few other code flows that causes the multi interface to
block and we've tried to document them here:
http://curl.haxx.se/libcurl/c/libcurl-multi.html#BLOCKING
-- / daniel.haxx.se ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2010-12-09