* Re: Max RPCs Queued per Server
1994-09-30 18:35 Max RPCs Queued per Server Jeffrey DeMent
@ 1994-09-30 16:40 ` Muiz Motani
1994-10-04 3:02 ` Nathaniel Mishkin
0 siblings, 1 reply; 3+ messages in thread
From: Muiz Motani @ 1994-09-30 16:40 UTC (permalink / raw)
In article <CwyGz5.FG4@da_vinci.ecte.uswc.uswest.com> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Max RPCs Queued per Server
@ 1994-09-30 18:35 Jeffrey DeMent
1994-09-30 16:40 ` Muiz Motani
0 siblings, 1 reply; 3+ messages in thread
From: Jeffrey DeMent @ 1994-09-30 18:35 UTC (permalink / raw)
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.
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 ?
4)I'll specify "max_call_requests" of 16 in my server initialization code in
the rpc_server_listen() call.
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) ?).
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".
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.
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 ?
* 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 ?
Jeff
_____________________________________________________________________
Jeffrey L. DeMent _._._._._._._
U S WEST Technologies (_|_|_|_|_|_|_)
1475 Lawrence Street, Suite 304 ` \` | | '/ '
Denver, Colorado 80202 ` \`| |'/ '
` \| |/ '
Phone: (303) 595-0519 ` \0/ '
Fax: (303) 595-5055 `~#~'
^
Internet: jdement@lookout.mnet.uswest.com / \
_____________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Max RPCs Queued per Server
1994-09-30 16:40 ` Muiz Motani
@ 1994-10-04 3:02 ` Nathaniel Mishkin
0 siblings, 0 replies; 3+ messages in thread
From: Nathaniel Mishkin @ 1994-10-04 3:02 UTC (permalink / raw)
Muiz Motani (a11389@mindlink.bc.ca) wrote:
: In article <CwyGz5.FG4@da_vinci.ecte.uswc.uswest.com> jdement@lookout.mtt.it.uswc.uswest.com (Jeffrey DeMent) writes:
: > 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
Actually the listen backlog refers to how many incoming pending
as-yet-unaccepted connections a socket can have before the OS starts
telling the remote end that the connection attempt has failed. The
listen backlog parameter has no effect on sockets that correspond to
established connections. Unless things are really loaded and/or
wedged, the RPC runtime should be able to accept() incoming connection
requests as they arrives. (Whether it'll be able to do anything with
the open connections is another matter.)
: >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.
You mean the accept() call.
: 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.
With all these threads, you gotta hope your threads implementation is
good, eh?
: 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 ?
I suppose someone could figure it all out but I think it all really
comes down to depending on characteristics of the socket
implementation (and in general the kernel as a whole) that the DCE RPC
runtime (much less the app built on top of DCE RPC) has little or no
control over (e.g., the number of available mbufs). I.e., in the name
of generality and with an eye toward future implementations, the DCE
RPC API has more knobs than it can have a reasonable implementation
of.
--
-- Nat Mishkin
Atria Software, Inc.
mishkin@atria.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1994-10-04 3:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-09-30 18:35 Max RPCs Queued per Server Jeffrey DeMent
1994-09-30 16:40 ` Muiz Motani
1994-10-04 3:02 ` Nathaniel Mishkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox