RE: Problem with blocking connect().
"Oded Arbel" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
There's really no point in doing a non-blocking connect, as the HTTP thread is a stand alone and 1 to 2 requests a second is not enough of a heavy load. the connect blocks because the server isn't answering fast enough, and that's ok too (I mean - its ok for the client to block, its not ok that the server is taking its time). -- Oded Arbel m-Wise mobile solutions [email protected] +972-9-9581711 (116) +972-67-340014 ::.. Experience is what causes a person to make new mistakes instead of old ones. > -----Original Message----- > From: Vjacheslav Chekushin [mailto:[email protected]] > Sent: Monday, October 21, 2002 12:45 PM > To: devel > Subject: Problem with blocking connect(). > > > Hi, list. > 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. > > Here the wapbox.log snapshot: > > (added debug points in socket.c) > 2002-10-21 09:46:14 [10] DEBUG: service=80 > 2002-10-21 09:46:14 [10] DEBUG: our service=0 > 2002-10-21 09:46:14 [10] DEBUG: hostname=wap.hotelguide.com > 2002-10-21 09:46:14 [10] DEBUG: interface name=(null) > 2002-10-21 09:46:14 [10] DEBUG: try to connect > > In case of immediate return from connect here must be > somethink like this: > 2002-10-21 09:46:13 [10] DEBUG: HTTP: Sending request: > and request dumping but thread [10] hangs on this point > > > 2002-10-21 09:46:14 [1] DEBUG: WSP: machine 0x8137688, state > CONNECTED, event > S-MethodResu > lt.req > 2002-10-21 09:46:14 [1] DEBUG: WSP: method 105, state > PROCESSING, event > S-MethodResult.req > 2002-10-21 09:46:14 [1] DEBUG: WSP 2/105: New method state REPLYING > 2002-10-21 09:46:14 [1] DEBUG: WSP 2: New state CONNECTED > 2002-10-21 09:46:14 [5] DEBUG: WTP: resp_machine 105, state > RESULT_WAIT, event > TR-Result.req. > 2002-10-21 09:46:14 [5] DEBUG: WTP 105: New state RESULT_RESP_WAIT > 2002-10-21 09:46:14 [5] DEBUG: WTP: Created WTPRespMachine > 0x81658a0 (106) > 2002-10-21 09:46:14 [5] DEBUG: WTP: resp_machine 106, state > LISTEN, event RcvInvoke. > 2002-10-21 09:46:14 [5] DEBUG: WTP 106: New state INVOKE_RESP_WAIT > 2002-10-21 09:46:14 [1] DEBUG: WSP: machine 0x813efa8, state > CONNECTED, event > TR-Invoke.ind > 2002-10-21 09:46:14 [1] DEBUG: WSP: method 106, state > NULL_METHOD, event > TR-Invoke.ind > 2002-10-21 09:46:14 [1] DEBUG: WSP 6/106: New method state HOLDING > 2002-10-21 09:46:14 [1] DEBUG: WSP: method 106, state > HOLDING, event Release > 2002-10-21 09:46:14 [1] DEBUG: WSP 6/106: New method state REQUESTING > 2002-10-21 09:46:14 [1] DEBUG: WSP 6: New state CONNECTED > 2002-10-21 09:46:14 [1] DEBUG: WSP: machine 0x813efa8, state > CONNECTED, event > S-MethodInvoke.res > 2002-10-21 09:46:14 [1] DEBUG: WSP: method 106, state > REQUESTING, event > S-MethodInvoke.res > 2002-10-21 09:46:14 [1] DEBUG: WSP 6/106: New method state PROCESSING > 2002-10-21 09:46:14 [1] DEBUG: WSP 6: New state CONNECTED > 2002-10-21 09:46:14 [5] DEBUG: WTP: resp_machine 106, state > INVOKE_RESP_WAIT, > event TR-Invoke.res. > 2002-10-21 09:46:14 [5] DEBUG: WTP 106: New state RESULT_WAIT > 2002-10-21 09:46:16 [5] DEBUG: WTP: resp_machine 105, state > RESULT_RESP_WAIT, > event RcvAck. > 2002-10-21 09:46:16 [5] DEBUG: WTP 105: New state LISTEN > 2002-10-21 09:46:16 [5] DEBUG: WTP: Destroying WTPRespMachine > 0x8165f78 (105) > 2002-10-21 09:46:16 [1] DEBUG: WSP: machine 0x8137688, state > CONNECTED, event > TR-Result.cnf > 2002-10-21 09:46:16 [1] DEBUG: WSP: method 105, state > REPLYING, event TR-Result.cnf > 2002-10-21 09:46:16 [1] DEBUG: WSP 2/105: New method state NULL_METHOD > 2002-10-21 09:46:16 [1] DEBUG: Destroying WSPMethodMachine 105 > 2002-10-21 09:46:16 [1] DEBUG: WSP 2: New state CONNECTED > 2002-10-21 09:46:18 [5] DEBUG: WTP: Created WTPRespMachine > 0x8157648 (107) > 2002-10-21 09:46:18 [5] DEBUG: WTP: resp_machine 107, state > LISTEN, event RcvInvoke. > 2002-10-21 09:46:18 [5] DEBUG: WTP 107: New state INVOKE_RESP_WAIT > 2002-10-21 09:46:18 [1] DEBUG: WSP: machine 0x8136530, state > CONNECTED, event > TR-Invoke.ind > 2002-10-21 09:46:18 [1] DEBUG: WSP: method 107, state > NULL_METHOD, event > TR-Invoke.ind > 2002-10-21 09:46:18 [1] DEBUG: WSP 12/107: New method state HOLDING > 2002-10-21 09:46:18 [1] DEBUG: WSP: method 107, state > HOLDING, event Release > 2002-10-21 09:46:18 [1] DEBUG: WSP 12/107: New method state REQUESTING > 2002-10-21 09:46:18 [1] DEBUG: WSP 12: New state CONNECTED > 2002-10-21 09:46:18 [1] DEBUG: WSP: machine 0x8136530, state > CONNECTED, event > S-MethodInvoke.res > 2002-10-21 09:46:18 [1] DEBUG: WSP: method 107, state > REQUESTING, event > S-MethodInvoke.res > 2002-10-21 09:46:18 [1] DEBUG: WSP 12/107: New method state PROCESSING > 2002-10-21 09:46:18 [1] DEBUG: WSP 12: New state CONNECTED > 2002-10-21 09:46:18 [5] DEBUG: WTP: resp_machine 107, state > INVOKE_RESP_WAIT, > event TR-Invoke.res. > 2002-10-21 09:46:18 [5] DEBUG: WTP 107: New state RESULT_WAIT > 2002-10-21 09:46:18 [4] DEBUG: Timeout-A elapsed. > 2002-10-21 09:46:18 [5] DEBUG: WTP: resp_machine 106, state > RESULT_WAIT, event > Timeout-A. > 2002-10-21 09:46:18 [5] DEBUG: WTP 106: New state RESULT_WAIT > 2002-10-21 09:46:19 [5] DEBUG: WTP: Created WTPRespMachine > 0x815fb50 (108) > 2002-10-21 09:46:19 [5] DEBUG: WTP: resp_machine 108, state > LISTEN, event RcvInvoke. > 2002-10-21 09:46:19 [5] DEBUG: WTP 108: New state INVOKE_RESP_WAIT > > > -- > Vjacheslav Chekushin mailto:[email protected] > Latvian Mobile Phone Company http://www.lmt.lv > > >