Re: [PATCH] Naive approach to HTTP-timeouts

Vjacheslav Chekushin <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization LMT
Message-ID <[email protected]>
Hi, David.

Ok. Let's suppose that we get realy high load on kannel http server.
So we get, let's say, ~5 new connection in second.
Threrefore we will check for timeouts ~5 times in second. I think it is not
efficient way.
That why I have created the thread to deal with it.
You must to choose between wasted thread's resources and perfomance
degradation. My choice was - thread's resources.
You can make your own choice.

David Schmitz wrote:
> Hi Slava,
> 
> argh, correct. An IMO easy solution is to call check_timeout even if the 
> recent poll did not timeout, as in:
> [snip]
> if ((ret = gwthread_poll(tab, n, MIN_TIME_OUT)) < 1) {
>            switch(ret) {
>            case 0: /* timeout */
>                break;
>            case -1: /* error */
>                if (errno != EINTR) /* a signal was caught during poll() 
> function */
>                    warning(0, "HTTP: gwthread_poll failed.");
>                continue;
>                break;
>            default: /* should not happen */
>                panic(0, "This is not supposed to happen!");
>            }
>        }
>        check_timeout();
> [snap]
> That should take care of loaded environments...
> 
> Regards,
> David
> 
> Vjacheslav Chekushin schrieb:
> 
>> Hi, David.
>>
>> If I understand correctly then check_timeouts() will be called only if 
>> no any new connection to kannel http server for MIN_TIME_OUT time.
>> So for busy enviroment this check will be quite undeterminate and can
>> be not called for hours. Isn't it?
>>
>> David Schmitz wrote:
>>
>>> Hi again,
>>>
>>> attached is the new patch for HTTP-timeouts. I have included the work 
>>> of Slava wrt. server-timeouts, but modified it such that no new 
>>> thread is needed. Another new thing is the purging of active clients 
>>> upon port-removal, as suggested by Alex.
>>>
>>> Please, try it out and share your comments :)
>>>
>>> Best regards,
>>> David
>>>
>>
> 
> 


-- 
Vjacheslav Chekushin                                mailto:[email protected]
Latvian Mobile Phone Company                        http://www.lmt.lv
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.