On Thu, Oct 18, 2001 at 11:54:43AM -0500, Bob Maccione wrote: > This is probably a stupid question but from what I can tell based on the > docs, POE is a single threaded application. > > If this is wrong then can I get pointers to how to implement threading > within POE?
Artur posted a threading patch a while back. I haven't applied it yet. My experiments with ithreads in recent bleadperls have failed with coredumps, and I really want to understand them (and get some sample code going) before having to debug them. > What I need to do is see if POE can handle many many connections with lots > of txns (like 50-60 a second). This is assuming that the hardware is there > (in this case it's a sun E10k). On my Athlon-1GHz running freebsd, samples/thrash.perl got about 120 transactions per second in the first 10 seconds. The number probably would be higher if my sockets table didn't fill up with TIME_WAITs. If there's a good way to avoid TIME_WAIT (and all the documentation I've seen says "they're your friends!"), please let me know. thrash.perl, by the way, is a self-contained server and client pool. The server accepts connections, sends them a "daytime" message, and disconnects the client. The client pool makes sure there are five clients going at once. You can change this around line 187. Each client connects, receives the server's "daytime", and waits for the server to disconnect. So POE can create and destroy about 240 sockets per second (1 each for accept() and connect()) on a contemporary desktop system running a free operating system. It might go faster if TIME_WAIT can be worked around. Finally, you get thrash.perl with POE, so you can try it out on your target system. Good luck, and happy hacking! > My issues are of course POE bottlenecks (if it's a single threaded app) and > synchronization (if it's threaded). > > Basically I'm looking into using POE as a smart router, POE will listen to > a port and when a session connects it will assign from a session pool a link > to another application, then it will handle passing data from the incoming > session to the application and back again. I need to then go an handle > reconnect, etc but that will be easy compared to the loading issues I'm > facing. -- Rocco Caputo / [EMAIL PROTECTED] / poe.perl.org / poe.sourceforge.net
