[rabbitmq-discuss] problem with new persiter with 1000 topics/queues

alex chen chen650 at yahoo.com
Wed Aug 25 05:37:06 BST 2010

> Using  the C client is fine. What's missing from what you sent us so far is:

> - the  producer code

this could be the amqp_producer.c in rabbitmq-c/examples.  simply modify the 
code to accept the topic name and message size from command line.

> - how exactly you are invoking the producer and consumer ("1000  
>amqp_consumers" - but with what args?, etc)

i use 3 bash shell scripts (bind.sh, producer.sh, consumer.sh):

# bind.sh
for i in {1..1000}
   amqp_bind $topic $queue  &

# producer.sh
for i in {1..1000}
   let message_size=20*1024   # 20KB 
   amqp_producer $topic $message_size  &

# consumer.sh, bind 1000 topics to 1000 queues
for i in {1..1000}
   amqp_consumer $topic $queue  &

the test steps are:
1) run bind.sh
2) run producer.sh
3) run the following command the monitor the total size of messages stored:
$ watch --interval 5 "du -hs $rabbitmq_server_dir/rabbit/$message_store_dir"

4) after the output from 3) reaches 200 GB, stop the producers by running:
$ pkill amqp_producer

5) run consumer.sh

after step 5), running "top" command will show the beam process would use about 
10 GB of memory.

> - what exactly it is you are  looking at / measuring - e.g. you mentioned 
>something about 200GB of message  data, how is that figure calculated?

see the step 3) above.  another way is using "rabbitmqctl list_queues" to get 
the total message counts.  however, i found rabbitmqctl always return errors 
when the broker is busy (e.g. during step 5), so using "du -hs" is a good 

our recent test shows that if you run producer.sh and consumer.sh at the same 
time (without 200 GB messages backed up), the broker process would also use 
large amount of mem (around 6 GB).  this way you can reproduce the high mem 
usage problem without waiting long time for the 200 GB messages backed up.

please feel free to let me know if you need further info.



More information about the rabbitmq-discuss mailing list