It sounds like what's happening is that you're using up your single thread receiving a bunch of messages from your rabbitmq server and there is very little time spent on the event loop such that callbacks have a chance to execute.
I don't think it's unreasonable to ack your queue messages, especially if they're valuable enough to persist. Otherwise, something *can* go wrong in the transport and you will lose messages. And if losing messages isn't a problem, then why bother persisting? On Wed, Mar 7, 2012 at 4:28 PM, Dan Milon <[email protected]> wrote: > Hello everyone, > > I'm facing the following problem. I just have set up a rabbitmq queue, and > my node app is subscribed to that queue (via node-amqp). When a message > arrives, the app does an insert and a few updates on a mongodb (via > mongoose). Now the problem comes when there are say 10000 messages in the > queue (durable), and i fire up node. It is flooded by the messages and > although mongodb insertions are started, no callback is ever called. > Finally all messages are consumed, and after a while mongoose will throw a > timeout exception, or node will crash out of memory. During that time, > mongodb reports that it received only like 30 queries. > > A temporary solution to that problem, is using rabbitmq's ACKs. That > instructs the queue to not send another message, unless i ack the previous > one. Now if i use that technique, although i ack just after i call inserts > and updates (not in their callbacks), in the end things get throttled and > with a lot less performance the app is doing what it's supposed to do. > > Anyone knows why this is happening? How to fix/avoid it? > I'll give example code if needed. > > > Thank you, > Dan. > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-** > Posting-Guidelines<https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines> > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > nodejs+unsubscribe@**googlegroups.com<nodejs%[email protected]> > For more options, visit this group at > http://groups.google.com/**group/nodejs?hl=en?hl=en<http://groups.google.com/group/nodejs?hl=en?hl=en> > -- chrisrhoden -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
