|
View:
New views
9 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 | Next > |
|
|
Re: RabbitMQ memory managementVery good point. I did ask that question in my previous email, but I don't think it has been answered yet.
On Fri, Sep 12, 2008 at 4:16 PM, tsuraan <tsuraan@...> wrote:
_______________________________________________ rabbitmq-discuss mailing list rabbitmq-discuss@... http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss |
|
|
Re: RabbitMQ memory managementBen Hood wrote: > No, you've understood it correctly. If you send enough non-persistent > messages, eventually the queues will fill up, the broker will crash > and you will lose all of the messages that you sent to that node. ATM I assume this condition can't happen by design if messages are published with immediate flag set to true, right? <field name = "immediate" type = "bit"> request immediate delivery <doc> This flag tells the server how to react if the message cannot be routed to a queue consumer immediately. If this flag is set, the server will return an undeliverable message with a Return method. If this flag is zero, the server will queue the message, but with no guarantee that it will ever be consumed. </doc> <doc name = "rule" test = "amq_basic_16"> The server SHOULD implement the immediate flag. </doc> </field> Does it mean a message is returned if it can't be immediately routed to a queue or a message is returned if it can't be immediately routed to a consumer? - Dmitriy _______________________________________________ rabbitmq-discuss mailing list rabbitmq-discuss@... http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss |
|
|
Re: RabbitMQ memory managementDmitriy,
Dmitriy Samovskiy wrote: > Ben Hood wrote: > >> No, you've understood it correctly. If you send enough non-persistent >> messages, eventually the queues will fill up, the broker will crash >> and you will lose all of the messages that you sent to that node. ATM > > I assume this condition can't happen by design if messages are > published with immediate flag set to true, right? Correct. > Does it mean a message is returned if it can't be immediately routed > to a queue or a message is returned if it can't be immediately routed > to a consumer? The latter. The former is done by the 'mandatory' flag. With immediate=true no queuing takes place. Matthias. _______________________________________________ rabbitmq-discuss mailing list rabbitmq-discuss@... http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss |
|
|
Re: RabbitMQ memory managementHi,
tsuraan wrote: > If RabbitMQ crashes because it's out of memory, I understand that it > should be able to start again without losing any data Only *durable* queues and exchanges, and *persistent* messages are recoverable, as per the spec. > Will the next message sent to it (before any messages are dequeued) > cause the queue to crash again? I assume that must be the case, since > nothing was lost when the program crashed. Messages aren't the only entities consuming memory. I would hope that RabbitMQ is able to recover the state (as defined above) after an OoM error, and take in a few more messages, but it's not something we have tested. It's possible that the startup sequence uses just that little bit more memory which would push the system over the edge. Generally, if there are worries about RabbitMQ running out of memory one should try catching that case well before it happens. It's not really advisable to run a system so close to the limits. Matthias. _______________________________________________ rabbitmq-discuss mailing list rabbitmq-discuss@... http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss |
|
|
Re: RabbitMQ memory managementHi all,
I have been following this discussion on the list. To recap: 1 - the overhead of storing a message in rabbitmq is very low meaning that the case 'broker has filled up, I need more nodes' is quite unusual and certainly manageable 2 - anyone who needs more queue memory can add more nodes to the broker cluster transparently 3 - durable/persistent messages are also stored on disk for recovery purposes If you have slower consumers than producers, then either: a) #queues will grow in size or: b) at least one queue will grow in size. Note that case (a) is solved by 2 above. Add more nodes. How often would you have to add more nodes? Due to 1, you can work this out based on your message size. For almost all use cases the consumers will have to lag producers by several days. Think about it. And don't forget you can add more consumers. Let's say that you cannot add more nodes and you cannot add more consumers. Assume also that rabbitmq is set up to persist messages to disk for recovery per point 3 above, but that due to your application you need copies of each message in memory. Finally assume you have only one queue, many fast producers, and one slow consumer. One example would be SMS. Even a small old server could store millions of SMS messages without any of them being consumed. So that is your scenario. [ the above is extreme but the problem use cases are variants of this ] In cases like this we would need to do one of the following: * provide a means to tell producers to back off, or alert an operator * or, implement a system that created more queues and nodes for you, if one queue became ginormous * implement either rolling buffers, or agents, that flushed/paged messages to pluggable stores or directly to disk * .. or (more extremely) implement rolling buffers that deleted old unconsumed messages completely when queue size maxed out, and notified consumers and operators as needed * some other more fancy flow control TBD * OR - recommend the application deigner thinks about why their queues are growing to very large size and if this can be prevented through application changes You'll appreciate that the first couple of fixes in this list are fairly simple to implement, with potential difficulties increasing as you go down the list ;-) Yet despite all this, in summary, it is reasonable for users to ask for a solution that is more 'self healing'. So - any takers? Comments, thoughts? alexis On Sat, Sep 13, 2008 at 5:00 AM, Matthias Radestock <matthias@...> wrote: > Hi, > > tsuraan wrote: >> If RabbitMQ crashes because it's out of memory, I understand that it >> should be able to start again without losing any data > > Only *durable* queues and exchanges, and *persistent* messages are > recoverable, as per the spec. > >> Will the next message sent to it (before any messages are dequeued) >> cause the queue to crash again? I assume that must be the case, since >> nothing was lost when the program crashed. > > Messages aren't the only entities consuming memory. I would hope that > RabbitMQ is able to recover the state (as defined above) after an OoM > error, and take in a few more messages, but it's not something we have > tested. It's possible that the startup sequence uses just that little > bit more memory which would push the system over the edge. > > Generally, if there are worries about RabbitMQ running out of memory one > should try catching that case well before it happens. It's not really > advisable to run a system so close to the limits. > > > Matthias. > > _______________________________________________ > rabbitmq-discuss mailing list > rabbitmq-discuss@... > http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss > _______________________________________________ rabbitmq-discuss mailing list rabbitmq-discuss@... http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss |
|
|
Re: RabbitMQ memory managementAlexis Richardson wrote: > * provide a means to tell producers to back off, or alert an operator The easiest solution I can think of is to 1) configure Erlang's memsup (http://www.erlang.org/doc/apps/os_mon/index.html) to trigger alarms when memory consumption gets tight. This can be done without any code change; in the rabbitmq-server startup script simply change the "-os_mon start_memsup false" to "true" and adjust the thresholds with additional options of the form "-memsup <param> <value>" When a threshold is reached, a message like this will appear in the rabbit.log: =INFO REPORT==== 13-Sep-2008::10:59:37 === alarm_handler: {set,{process_memory_high_watermark,<0.31.0>}} When the memory usage drops below the threshold again a similar message is logged. One can also set up SNMP monitoring, but that is more complicated. 2) get queues to drop messages when memory consumption is above the thresholds. This does require some coding, but not very much. We set up an alarm handler that informs all a node's queues when a "high memory" alarm is set/cleared. Queues record that information as part of their state. When a message is routed to a queue while the alarm is set, and the queue cannot immediately route the message to an auto-ack consumer - in other words, the message requires queueing - it discards the message. If that happens and either the mandatory or immediate flag were set, and the message could not be routed to any other queues / consumers, then the message is returned to the sender with basic.return. We can think of other actions to take instead of discarding messages, but the above is simple and neatly exploits the existing mandatory/immediate functionality. Matthias. _______________________________________________ rabbitmq-discuss mailing list rabbitmq-discuss@... http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss |
|
|
Re: RabbitMQ memory managementMatthias,
On Sat, Sep 13, 2008 at 11:28 AM, Matthias Radestock <matthias@...> wrote: > > Alexis Richardson wrote: > >> * provide a means to tell producers to back off, or alert an operator > > The easiest solution I can think of is to > > 1) configure Erlang's memsup > (http://www.erlang.org/doc/apps/os_mon/index.html) to trigger alarms > when memory consumption gets tight. > > This can be done without any code change; in the rabbitmq-server startup > script simply change the "-os_mon start_memsup false" to "true" and > adjust the thresholds with additional options of the form "-memsup > <param> <value>" > > When a threshold is reached, a message like this will appear in the > rabbit.log: > > =INFO REPORT==== 13-Sep-2008::10:59:37 === > alarm_handler: {set,{process_memory_high_watermark,<0.31.0>}} > > When the memory usage drops below the threshold again a similar message > is logged. > > One can also set up SNMP monitoring, but that is more complicated. > > > 2) get queues to drop messages when memory consumption is above the > thresholds. > > This does require some coding, but not very much. > > We set up an alarm handler that informs all a node's queues when a "high > memory" alarm is set/cleared. Queues record that information as part of > their state. > > When a message is routed to a queue while the alarm is set, and the > queue cannot immediately route the message to an auto-ack consumer - in > other words, the message requires queueing - it discards the message. If > that happens and either the mandatory or immediate flag were set, and > the message could not be routed to any other queues / consumers, then > the message is returned to the sender with basic.return. > > We can think of other actions to take instead of discarding messages, > but the above is simple and neatly exploits the existing > mandatory/immediate functionality. I think this is a good idea of how to use the mangement functionality that comes with OTP. This is one of the reasons why we are using OTP in the first place. Ben _______________________________________________ rabbitmq-discuss mailing list rabbitmq-discuss@... http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss |
|
|
Re: RabbitMQ memory managementAlexis,
On Sat, Sep 13, 2008 at 10:07 AM, Alexis Richardson <alexis.richardson@...> wrote: > Note that case (a) is solved by 2 above. Add more nodes. How often would you > have to add more nodes? Due to 1, you can work this out based on your message > size. For almost all use cases the consumers will have to lag > producers by several > days. Think about it. And don't forget you can add more consumers. Good point. The main reason why I asked Edwin about his realsitic expectations surrounding volumetrics was to find out what the breaking point was for a simple OTS Rabbit installation to do a *very* naive reality check. So in the absense of better knowledge, I just thought to myself that an SMS is roughly 160 bytes long (160 chars with an encoding that is something less than 8 bit/char plus some routing headers) and just created an infinite loop to publish them. A sinlge instance of Rabbit got overfed after publishing 2.5 million of these messages (on a simple pizzabox setup). So under the assumption that you may also use more than one logical queue (by way of natural application partitioning), you may be spreading the total system load over multiple queues that reside in memory on different nodes. In the degenerate case that you send 1 million messages per day to a single instance, you still have a day and a bit to find some way to drain the queues. Presumeably, if no SMS's were getting delivered to the downstream consumers over the course of a day, somebody would start to care about the fact that the system wasn't actually doing something. This person would still have a fair amount of time to find out what is going on and drain the queues before resource consumption becomes acute. Ben _______________________________________________ rabbitmq-discuss mailing list rabbitmq-discuss@... http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss |
|
|
Re: RabbitMQ memory managementHi Ben,
Actually, we have a bit of a different use case. Our company (my client, as it were) provides SMS aggregation services. Essentially, we provide a unified interface for SMS, MMS, USSD and other types of messages on behalf of our customers, who are content providers. The main value add is that they only have to deal with us and our interface, and not the interfaces of multiple cellular companies. Without disclosing confidential information, I can tell you that the way it works is as follows:
Best regards, Edwin Fine On Sun, Sep 14, 2008 at 7:05 AM, Ben Hood <0x6e6562@...> wrote: Alexis, _______________________________________________ rabbitmq-discuss mailing list rabbitmq-discuss@... http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss |
| < Prev | 1 - 2 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |