From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fed2e7871ca258cd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-14 19:11:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!freenix!enst!enst.fr!not-for-mail From: James Rogers Newsgroups: comp.lang.ada Subject: Re: Server - tasking and long lived connections Date: Fri, 14 Dec 2001 20:10:55 -0700 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1008385862 32680 137.194.161.2 (15 Dec 2001 03:11:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Sat, 15 Dec 2001 03:11:02 +0000 (UTC) To: comp.lang.ada@ada.eu.org Return-Path: X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.6 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:17944 Date: 2001-12-14T20:10:55-07:00 Hi Eric. Which operating system are you targeting for this application? WinNT easily handles about 2000 of tasks. I do not know the limits on open file descriptors. The tasking approach is somewhat more efficient than the traditional Unix approach of creating a separate process to handle each connection. The tasking approach will require the same number of file descriptors and data base connections. Context switching will be faster with tasks than with processes. Which other design approaches would you consider if your operating system resources are too limited? Would you be able to expand the system by creating a set of application servers all accessing a central database through a network? Would you need a system that performed automatic load balancing across a network? One advantage of the tasking approach is that you will be able to create the tasking code as a task type, then create as many instances of that task type as you need. From the Ada point of view this solution is highly scalable. Jim Rogers Eric Merritt wrote: > > Hello All, > > I am in the process of designing a server that will > need to accept long lived (up to several hours) client > connections. The processes themselves will be fairly > I/O bound (database accesses), and at most the number > of processors will be in the range of 2 - 4. The > obvious choice (in my mind) for this is to use a > single task per connection. In this senario, context > switching will not be a major issues due to the length > of the connections. There will be little or no > performance gains by using tasking, but it handles the > long connection times well. > > I do, however, have a few reservations about > scalablity due to OS limitations on the number of > threads per machine and the number of open file > descriptors. Although at first the number of > connections will not be high, it is possible that it > could rapidly need to scale up to a fairly high > number, several hundred or more. This may mean that I > will just have to distribute the app across several > boxs and do some type of mirroring on the databases, > but I want to put that off as long as possible. > > I have quit a bit of experience in code this type of > application but usually with short lived connections > or a low number of total connections. > > Anyway, I am just looking for some one to either point > me in a different direction or confirm my current > approach (one thread per connection). > > Thank you for your input. > > __________________________________________________ > Do You Yahoo!? > Check out Yahoo! Shopping and Yahoo! Auctions for all of > your unique holiday gifts! Buy at http://shopping.yahoo.com > or bid at http://auctions.yahoo.com