MC concurrency performance?

Yennie at aol.com Yennie at aol.com
Sun Sep 8 17:04:01 EDT 2002


1. How well does MC handle multiple connections at once ('concurrency')?

There are a few issues here. First off, Metacard basically handles one 
connection at a time; however, there are several ways to work with this. 
First, when reading/writing to sockets, you can use asynchronous calls which 
will allow other connections to come in. The pitfall here is that while a 
handler is executing, no others will. So its possible to have more than one 
connection get in, but they are basically processed one at a time if they are 
calculation-intensive. If most of the work *is* the data transer, you'll be 
able to handle a few connections at a time, maybe even many.

If you truly want "multiple connections", you can run multiple processes. 
This is really only sane if you are using one of the UNIX engines (or Darwin 
under MacOS). With such an engine, you can spawn many processes running on 
separate ports which will behave nicely in serving many requests. This is a 
memory hog with non-UNIX builds (i.e. GUI apps). If you search the archives, 
I posted some code using "open process" under the Darwin engine for this in 
the last month.


> 2. Better of using shared or multiple ports?

Myself, I haven't found a way to have multiple processes share the same port. 
It is most likely possible if you can work at a lower level (i.e. embedded 
MetaCard); but scripted socket support won't let you listen on the same port 
twice. So, if you want one port you are probably stuck with one process. 
Unless you are using multiple processes, I don't see much advantage to 
multiple ports- although it could have marginal benefits. I think the 
possible confusion added would be more than its worth.

HTH,
Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.runrev.com/pipermail/metacard/attachments/20020908/57019480/attachment.htm


More information about the metacard mailing list