Re: [xSocket-develop] production level socket server pitfalls
Status: Inactive
Brought to you by:
grro
|
From: Kevin B. <kev...@go...> - 2010-02-21 08:01:38
|
Hello Gregor, Actually I'm not thoroughly conversant with NIO architecture what do these internal dispatchers do? You say that each open connection allocates system resources and memory and also do each running thread. How does xSocket deal with clients, is each client handled in his own thread that means if 100 clients are connected will 100 threads be generated. Also what are open connections, is 100 clients = 100 open connections. The OS is Centos 5.2 based on this can I calculate the amount of memory that will be used up if 100 clients have active connections made to xSocket. Regards, Kevin On 2/20/2010 1:18 PM, Gregor Roth wrote: > > Hi Kevin, > > I would suggest setting the timeouts. By default the timeouts are very > high. > > Regarding to the memory, by xSocket uses 2 internal dispatchers by > default. By default each dispatcher will preallocate 65536 bytes non > direct memory (see system propery > org.xsocket.connection.client.readbuffer.preallocation.size). This > preallocated buffer will be used to read the network data. Each open > connection allocates (OS) system resources and memory. This depends on > the OS. Further more each running thread also allocates a predefined > amount of memory. This also depends on the OS. > > Gregor > > >> ----- Original Message ----- >> >> From: Kevin Boyd >> >> Sent: 02/19/10 09:47 AM >> >> To: xso...@li... >> >> Subject: [xSocket-develop] production level socket server pitfalls >> >> Hello, >> >> For a production level socket server what are the potential pitfalls >> that I have to consider : >> >> 1. I have started the server as per the tutorial on the homepage using >> >> >> IServer srv = new Server(8090, new TestHandler()); >> srv.run(); >> >> 2. The TestHandler class implements the following interfaces >> IDataHandler, IConnectHandler, IDisconnectHandler, >> IIdleTimeoutHandler, IConnectionTimeoutHandler. >> >> 3. I haven't set any "System Properties" as yet and >> "FlushMode.ASYNC" is not set. >> 4. Connection and Idle timeout's are set to default. >> >> >> I have uploaded this to my VPS host. However before letting it loose >> in production I wanted to test it for reliability and scalabity. Any >> suggestions here would be welcome. >> >> Memory is another aspect , My VPS host has allotted me 1GB ram with >> around 8GB burst capability, is this sufficient. (As of now I have >> only 500MB free) >> My clients would be continuously connected to the server 24x7, how >> much resource would each client connection take up in terms of ram, >> if 1000 or more clients would be connected how do I compute the >> amount of ram that would be necessary to safely run the socket server. >> >> Please suggest other points that I have missed out here. >> >> Regards, >> Kevin >> >> |