Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Poller, Latency, and Synchronous Messaging
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
ara_vartanian  
View profile  
 More options May 19 2008, 6:36 pm
From: ara_vartanian <ara.vartan...@gmail.com>
Date: Mon, 19 May 2008 15:36:45 -0700 (PDT)
Local: Mon, May 19 2008 6:36 pm
Subject: Poller, Latency, and Synchronous Messaging
I was thinking about using Messaging to do a little offline
"synchronized" messaging, the pattern being that a controller method
fires of a message and then blocks waiting for another message in
reply.

One big problem here seems to be the latency on the poller. I can fire
off 100 short messages to ActiveMq, but the poller chugs through these
messages at a top rate of about 3/sec (I'm doing nothing but printing
the message to console, obviously, to test this).

Other connectors have a polling_interval, but the Stomp adapter does
not and does not seem to respond to one.

Is this the adapter, ActiveMQ, overhead on ActiveMessaging, latency on
the poller? Is there any way to improve the throughput without kicking
up tons of pollers?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Kuklewicz  
View profile  
 More options May 19 2008, 7:24 pm
From: "Andrew Kuklewicz" <kooks...@gmail.com>
Date: Mon, 19 May 2008 19:24:47 -0400
Local: Mon, May 19 2008 7:24 pm
Subject: Re: Poller, Latency, and Synchronous Messaging

On Mon, May 19, 2008 at 6:36 PM, ara_vartanian <ara.vartan...@gmail.com>
wrote:

> I was thinking about using Messaging to do a little offline
> "synchronized" messaging, the pattern being that a controller method
> fires of a message and then blocks waiting for another message in
> reply.

cool - I do some stuff like this, it's what the receive method on the
MessageSender module is for.

> One big problem here seems to be the latency on the poller. I can fire
> off 100 short messages to ActiveMq, but the poller chugs through these
> messages at a top rate of about 3/sec (I'm doing nothing but printing
> the message to console, obviously, to test this).

> Other connectors have a polling_interval, but the Stomp adapter does
> not and does not seem to respond to one.

> Is this the adapter, ActiveMQ, overhead on ActiveMessaging, latency on
> the poller? Is there any way to improve the throughput without kicking
> up tons of pollers?

That does seem slow to me; I'll run some tests.

Stomp does not poll per se; it has an open connection, and messages that
match your subscriptions get pushed to this by the broker, so you aren't
polling the broker - it knows what messages your connection should get, and
pushes them down that open connection.

The only interval is how often you check to see if our connection has
received io that is there in memory waiting, or of it is not, waiting for
some to arrive - and there is no sleep in that loop in the activemessaging
or stomp gem code, so there is nothing to tweak as far as an interval.

So that is different from amazon sqs for example, where there is no open
connection or subscriptions, and each time you're receiving, you are making
a new http request to the sqs service to see if there is anything in the
queue.

I think there are some things you can tweak that might be faster - I think
client ack mode might be slower, as the broker has to get your ack before it
sends another message to the connection, whereas in auto mode it can have
already pushed a new message to your connection while you are processing the
previous message.

Are you running these tests with activemessaging in development mode, or
with RAILS_ENV = production?
ActiveMessaging is supposed to reload processors and the rails env between
messages in dev mode (though I think this may have been broken by recent
rails changes), so I would check out running not in dev mode to see any
timing info.

Beyond that I think you get into activemq tuning.

And really, though you seem to want to resist this, the best way to speed
this up is to have more pollers running, and specifically using processor
groups so that you could have pollers equal to the number of mongrel
instances that are dedicated to your synchronous processor so mongrel
processes won't have to wait for one another.

-Andrew


--
Andrew Kuklewicz

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ara_vartanian  
View profile  
 More options May 19 2008, 10:10 pm
From: ara_vartanian <ara.vartan...@gmail.com>
Date: Mon, 19 May 2008 19:10:37 -0700 (PDT)
Local: Mon, May 19 2008 10:10 pm
Subject: Re: Poller, Latency, and Synchronous Messaging
Hate to ask a stupid question, but how on earth do I change the
environment from the poller script?

I can't use the start_consumers task, since I'm on a Windows box as of
the moment.

On May 19, 4:24 pm, "Andrew Kuklewicz" <kooks...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Kuklewicz  
View profile  
 More options May 19 2008, 10:55 pm
From: "Andrew Kuklewicz" <kooks...@gmail.com>
Date: Mon, 19 May 2008 22:55:16 -0400
Local: Mon, May 19 2008 10:55 pm
Subject: Re: Poller, Latency, and Synchronous Messaging

On Mon, May 19, 2008 at 10:10 PM, ara_vartanian <ara.vartan...@gmail.com>
wrote:

> Hate to ask a stupid question, but how on earth do I change the
> environment from the poller script?

Same way you set the env for rails - set RAILS_ENV=production.
You just need to set that env variable before you start the poller.

> I can't use the start_consumers task, since I'm on a Windows box as of
> the moment.

Not sure why the rake task wouldn't work (i.e. start_consumers) - it doesn't
rely on  the daemons gem, so actually, I would expect that to work better.

--
Andrew Kuklewicz

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ara_vartanian  
View profile  
 More options May 19 2008, 11:30 pm
From: ara_vartanian <ara.vartan...@gmail.com>
Date: Mon, 19 May 2008 20:30:42 -0700 (PDT)
Local: Mon, May 19 2008 11:30 pm
Subject: Re: Poller, Latency, and Synchronous Messaging
Andrew,

Thanks. That resolved everything. The performance problem was just the
reload I didn't realize was happening.

I actually didn't even know RAILS_ENV worked as an environmental
variable. I typically always set it as a command line switch.

On May 19, 7:55 pm, "Andrew Kuklewicz" <kooks...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »