MC concurrency performance?
Dar Scott
dsc at swcp.com
Mon Sep 9 12:42:01 EDT 2002
On Sunday, September 8, 2002, at 02:58 AM, Alex Shaw wrote:
> I've just started playing with MC for doing a tcp server app. Few
> questions..
> 1. How well does MC handle multiple connections at once
> ('concurrency')?
The concurrency problems related to performance will not be in tcp
but rather in other I/O. With the tcp/ip callbacks you can make
relatively efficient scripts. The main thing to do is make sure no
handler is sitting around waiting for something, and especially not
for very long. (As you have probably realized, this normally means
you can't do all the work in the accept callback and maybe should
consider doing "none".)
As the "especially not for very long" phrase hints, you might want
to design your application to minimize time to respond in a dialog
even if it increases total compute and I/O time for a dialog.
If your service involves a dialog that must have state then
whatever method you use to make per-connection state (say,
changing many of those variables to arrays) may take a little
longer, but I think that this normally will be small compared to
I/O concerns.
You will also have to address connection limits and perhaps flood
attack problems. I think you should forget about efficiency under
these conditions; the main thing is to keep your app in a
reasonable state.
Dar Scott
More information about the metacard
mailing list