From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,fa387db71612325a X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1994-09-30 15:34:08 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!spool.mu.edu!agate!deep.rsoft.bc.ca!deep7.dial.mindlink.bc.ca!a11389 From: a11389@mindlink.bc.ca (Muiz Motani) Newsgroups: comp.unix.osf.misc Subject: Re: Max RPCs Queued per Server Date: Fri, 30 Sep 1994 12:40:52 Organization: Intelligent Distribution Distribution: usa Message-ID: References: NNTP-Posting-Host: deep7.dial.mindlink.bc.ca X-Newsreader: Trumpet for Windows [Version 1.0 Rev A] In article jdement@lookout.mtt.it.uswc.uswest.com (Jeffrey DeMent) writes: >From: jdement@lookout.mtt.it.uswc.uswest.com (Jeffrey DeMent) >Subject: Max RPCs Queued per Server >Date: Fri, 30 Sep 1994 18:35:28 GMT >DCE Community, >I'm trying to figure out how many rpc's can be queued up to a individual server >in a DCE system, and I need a sanity check and some help. >Can someone look at my thinking as described below and make some sense out of >it? >ASSUMPTIONS: > 1)TCP only -- if someone wants to address UDP great, otherwise I'll deal with > it on another post. > 2)Dynamically chosen endpoints -- apparently if this is not the case, other > things change. Nothing really changes if you have dynamically chosen endpoints versus well-known end-points. The only difference is that the EPM (rpcd) will perform a referral service. If a server has a dynamically chosen end-point and registers itself with rpcd, then the client's first call will go to rpcd. The rpcd will reply to the client with the end-point of the target server and all subsequent call processing will be identical to well-known end-points. > 3)"maximum listen backlog" on a socket is 8 -- WHAT IS THIS "MAXIMUM LISTEN > BACKLOG", I'm thinking it's a TCP thing, not a DCE concept ? This maximum listen backlog refers to the backlog parameter on the socket_listen() call. This is the API which blocks until it receives data on a socket. The backlog parameter tells TPC/IP how many pending socket receives to queue up - i.e. how large a buffer to allocate. > 4)I'll specify "max_call_requests" of 16 in my server initialization code in > the rpc_server_listen() call. You should realize that this actually tells the RPC runtime how many executor threads to allocate. In this case, the runtime will allocate 16+1=17 executor threads, which means that at any one time, up to 17 requests can be concurrently processed, or more accurately, that 17 server manager routines can run at any one time. >LOGIC: > 1)Within my DCE server process, a single "listener thread" is set up for > TCP that listens to all TCP connection requests on a socket (this is > called a "listening socket" and is different and counted separately from > "comm sockets" described below (correct) ?). Absolutely correct. This is the thread in which the socket_listen() call blocks for data on sockets. > 2)For each connection request (first DCE rpc from a client ?) the "listener > thread" receives, it creates a socket and a "receiver thread" is assigned > for subsequent communication with the client (who requested the connection). > The socket created here that the "receiver thread" listens on is called a > "comm socket". Right. In TPC/IP terms, the listener thread creates a receiver thread and spawns an I/O socket on which the receiver thread can read the data which is being sent on the socket. > 3)The "receiver thread" accepts an rpc's data and queues it up for use by a > "call thread". The number of "call threads" is dictated by the > "max_call_requests" in the rpc_server_listen() call. This is also correct. You should also remember that there is a one-to-one relationship between receiver threads and executor threads. For every executor thread there is a corresponding receiver thread. > Now I'm a little confused ..... > * The class notes say: number of requests (I read this rpc's) in queue > waiting for a "call thread" to execute them is 8 times the number of > "call threads" which means in my example I have the capacity for 8*16 > rpc's in the queue plus another 16 rpc's being executed by my 16 "call > threads" -- for a total of 128+16=144 -- my DCE server can have 144 rpc's > in queue or executing. > Is this right ? There is another queue which you should be aware of. Every time a request comes in to the server, the request is queued on to global queue (I forget what the name of this queue is). Each receiver/executor thread pair blocks on a semaphore which indicates whether there is data on this queue. When the receiver/executor completes the request it looks for more requests on this global queue. The queue between the receiver and executor threads is only 1 element long. The queue which all the receiver threads check to see if there are any more requests is a fixed length long which I don't quite remember the length of (let's call it m). Then there is a backlog of 8 on the socket_listen() call. Therefore, you actually have a capacity of: 17 # of executors + m global queue length + 8 max backlog It's been a while since I looked at the connection oriented code and I'm sure that somebody wil correct me on some of these points, but I hope this helps. I will also dig out some of my old notes and see if I can find a definitive answer. > * But my class notes also talk about DCE creating sockets using the > following logic: "max_call_requests" divided by "maximum listen backlog" > which in my case would be 16/8=2, and it seems to suggest these are the > aforementioned "comm sockets" which have "receiver threads" on them. > But that seems to make no sense if everything else here holds. > ..... so I'm confused ! >Anyone care to tread into this and show me the light ? > _______________________________________________________________________ Muiz Motani (604)274-8894 Intelligent Distribution a11389@mindlink.bc.ca