in reply to Apache or Daemon in Perl ?
Sounds like an ideal application of threads.
One or more receiver threads receive and enqueue the message + timestamp in memory. One or more sender threads, read the queue, and check the timestamp, drop any passed their sellby and forward them whereever.
You can overlap the network delays of both receiving and sending, and tailor the number of senders and recievers as the project evolve using command line parameters.
One process, with say 3 receivers and 6 senders and no middleman DB could probably saturate 1-mb bandwidth with maybe 15% cpu on a 2GHz machine.
If you have higher bandwaidth available, change 2 numbers and you match the requirements.
It's simple, flexible and very scalable.
|
|---|