Re: Problem with blocking connect().
Uoti Urpala <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Vjacheslav Chekushin wrote: > I have problem with kannel 1.2.0. > In production enviroment I forced to use kannel 0.12.3. > If I use 1.2.0 under heavy load (realy not so 'heavy', it's about 1-2 > request per second) then kannel periodically hangs up for some time. > After some investigation it seems I find where is the problem. > I think it is in http_start_request -> write_request -> conn_open_tcp. > > There is remark at begining of conn.c : > TODO: have conn_open_tcp do a non-blocking connect(). > > So in my case connect blocks fairly often and kannel is > unusable. I have written an improved version of the HTTP client code which includes nonblocking connects. It also has features like nonblocking DNS queries (though further queries do get blocked, but already resolved addresses continue to work), and the ability to limit the number of simultaneous connections made to one server. The latter is useful as the old code could open thousands of connections to a server that couldn't handle the requests as quickly as Kannel was sending them, overloading the server. This code is included in the version Kalle posted about earlier this month.