I am working on a project - sort of proxy - where lots of devices are sending me mesages via HTTP. (right now a total about 3 messages every sec but it is expected to go up to 100 mesages a sec) After some buffering I have to resend them to a bunch of other devices via HTTP.
I have to make sure - for each sending device separately - that I don't change the order of the message. (I might drop some of the messages if I don't have time to send all of them).
The way it is currently implemented is that I am getting the messages through Apache/mod_perl putting them in a memory table of mysql. In addition I have another child of the Apache that is running in a loop. Fetching all the messages from the memory table and trying to send them one by one. If it reaches its timeout I drop the message and forget about it.
The problem is that I am getting a lot more messages than what I can send out (sending out takes between 0.3-3 sec normally with a 5 sec timeout). Even if I am ocassionally dropping the surplus I always get a buffer built up quickly and the messages wait too much in the queue. For the application a delay of 20-30 sec in forwarding is too late already. Normally I should forward within 10 sec the most.
I need to change the system so that in normal circumstances I drop only messages that I could not send due to reaching the timeout. I should also set the timeout to 15 sec
So I have to have several processes that are emptying the buffer and sendig out messages. The question is how ? Should I generate more "sender" children of the Apache ? Is there some other daemon (written in perl) that would be recommended to use that would suit the task better than Apache ?
In reply to Apache or Daemon in Perl ? by szabgab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |