Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Mar : Re: TIdTCPServer - Slowly decreasing connection limit
| Subject: | Re: TIdTCPServer - Slowly decreasing connection limit |
| Posted by: | "Adam Lister" (adam@spamless.tombola.com) |
| Date: | Tue, 21 Mar 2006 11:38:34 |
I *think* I discovered the problem.
Every client uses 2 threads, and we never changed the default memory
allocation (each thread gets 1mb), which means at 770 clients its using
around 1.5GB. I'm aware it has a small memory leak anyway so once it hit
the magical 2GB the number of connections it could cope with started to
slowly decrease.
I dropped the amount of memory allocated and it seems fine.
Adam
Huang Xiaobin wrote:
> Hi,
>
> I doubt there are two causes:
> (1) though the client disconnent, but the TaskThread with that client in
> server is still running because of
> some indy bugs(at least, i found one(TIdEchoServer) in indy10.1.5). so this
> severly affected server performance;
> (2) most of indy servers, such as EchoServer, TimeServer, HttpServer, use
> internal exception to disconnect
> client and free the associated resources. so i suggest you to trace whether
> the server actually close the connection
> socket when the client disconnect.
>
> wish you success!
>
>
> "Adam Lister" <adam@SPAMLESS.tombola.com>
> ??????:44153e66$1@newsgroups.borland.com...
>
>>We've got a server app based around TIdTCPServer and over the weekend it
>>suddenly seemed to develop a hard but decreasing limit to the number of
>>connections it would allow.
>>
>>Our app had been running for 1-2 weeks without problem. Around 9pm on
>>friday we had users complaining they couldnt connect, viewing the logs
>>shows they connect, authenticate successfully against the system and then
>>just fire the disconnect event. It appeared that there was a hard limit
>>of 770 connections, and as soon as anyone disconnected someone else could
>>connect. Over the next few hours this limit slowly decreased and by 11pm
>>it was a limit of 761.
>>
>>Stopping and restarting the app solved the problem, and other less busy
>>applications also using TIdTCPServer were unaffected so the problem was
>>local to that app/port.
>>
>>Does anyone have any experience of anything like this? I can only assume
>>that theres a particular type of failed disconnect thats locking a socket
>>in a closed but unusuable state.
>>
>>Details:
>>Dual Xeon 3.6 with 8GB Ram
>>Delphi 5
>>Indy 9 (newest version)
>>DisconnectSocket used to disconnect clients from the server end.
>>
>>
>>Thanks
>>Adam
none