Simultaneous Polling [memcacheq]

3 views
Skip to first unread message

Ross

unread,
Aug 12, 2009, 5:05:44 AM8/12/09
to memcachedb
Hi,

I'm relatively new to Memcacheq and to distribute load between servers
we intended to run multiple
processes polling the same queue... we're just testing at the moment
and im finding that both of the
processes are picking up the same items (so in essence everything is
duplicated)

I was under the impression that when an application consumes an item
from the queue it is removed
instantly, and the other process should not be able to grab the same
item?

Any advice would be much appreciated :)

Ross

Steve Chu

unread,
Aug 12, 2009, 5:10:53 AM8/12/09
to memca...@googlegroups.com
In MQ, If Process A take away the message X, Process B can not get it
anymore. Check your enqueue routine, something wrong?
--
Best Regards,

Steve Chu
http://stvchu.org

Ross

unread,
Aug 12, 2009, 5:19:46 AM8/12/09
to memcachedb

On Aug 12, 10:10 am, Steve Chu <stv...@gmail.com> wrote:
> In MQ, If Process A take away the message X, Process B can not get it
> anymore. Check your enqueue routine, something wrong?

Hi,

Thanks for the quick response :)

It's definitely only queuing the message once (and it doesn't always
get processed twice, but often does)

All I can think of is that both process are polling the queue at
exactly the same time on occasion, but
I would have assumed there was some sort of mechanism in place to stop
the same message being picked up
twice...

I am right in thinking I don't need to do anything other than "get"
the last message from the queue (in
PHP I'm doing the following)

$value = $mq->get($queueName);

And the returned value should be removed instantly from the queue, is
this correct?

Ross

andrewy

unread,
Aug 25, 2009, 12:48:53 PM8/25/09
to memcachedb
I get exactly the same behavior, writing about 15 messages per second
and reading on two separate procs. i get duplicates being processed
now and them.

Andrew

Brian Hammond

unread,
Oct 19, 2009, 1:08:42 AM10/19/09
to memcachedb
This group is incredibly annoying to read. There are at least 10
threads like this one that just die.

What was the outcome of this?

Also, what's with all the group spam?

Brian
Reply all
Reply to author
Forward
0 new messages