Hi speed java, consume memcached (as queue), please help!

44 views
Skip to first unread message

LockeVN

unread,
Oct 2, 2008, 12:04:22 AM10/2/08
to memcached
Hi all,

My case is:

I implemented an simple queue by memcached. PHP website(s) push a lot
of message to the queue. I need a high speed program (bot) run
continuouslly, pop the queue, delivery message to several MySQL
databases on several DBServers. "Bot processing" takes a lot of time
than" queue poping", so I think bot should be multi-thread app. All
running on Linux Ubuntu machines.

Please give me some advices:
- A bot need to be good at multi-thread, talk with memcached, talk
with MySQL. So should I write bot by C or Java? (I can not use erlang,
because we're lack of developer and does not have ClientAPI with
memcached)
- What C library or Java package should I use for this purpose?
because I C has 2 libs, Java has 2 packages on memcached homepage,
which is thread safe version to use?

Thanks for your advice, a lot.

Josef Finsel

unread,
Oct 2, 2008, 7:58:41 AM10/2/08
to memc...@googlegroups.com
I'm just curious, why are you using memcached for a queue rather than a real queue program? How do you handle the loss of items from memcached?
--
"If you see a whole thing - it seems that it's always beautiful. Planets, lives... But up close a world's all dirt and rocks. And day to day, life's a hard job, you get tired, you lose the pattern."
Ursula K. Le Guin

Dustin

unread,
Oct 2, 2008, 1:00:43 PM10/2/08
to memcached

On Oct 1, 9:04 pm, LockeVN <lock...@gmail.com> wrote:
> Hi all,

> [...] queue [...]

Memcached is not a queue. It's a mistake to try to use it as one.
I'd recommend beanstalkd or gearman.

> Please give me some advices:
>  - A bot need to be good at multi-thread, talk with memcached, talk
> with MySQL. So should I write bot by C or Java? (I can not use erlang,
> because we're lack of developer and does not have ClientAPI with
> memcached)

Why do you feel you need threads? I don't think it's possible to
choose C or Java without knowing a lot more about the desired
functionality of your application. If it's just a language choice, I
wouldn't start with either.

>  - What C library or Java package should I use for this purpose?
> because I C has 2 libs, Java  has 2 packages on memcached homepage,
> which is thread safe version to use?

I don't think there are any that aren't thread safe. I think my
java library is awesome (spymemcached) of course, because I wrote it
to be exactly what I wanted. :)
Reply all
Reply to author
Forward
0 new messages