Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Custom Scheduler in Akka
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
  4 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
 
Sébastien  
View profile  
 More options Jan 4 2010, 11:44 am
From: Sébastien <sebastien.pie...@gmail.com>
Date: Mon, 4 Jan 2010 08:44:38 -0800 (PST)
Local: Mon, Jan 4 2010 11:44 am
Subject: Custom Scheduler in Akka
Hello,

I've been looking at Akka today in the perspective of implementing a
custom scheduler for an Actor-base Web system. I found Scala scheduler
to be a little bit hairy, and looking at Akka's documentation, I was
impressed by its clarity and the features offered by Akka.

So my problem is as follows:

- I have Actors (type A) that process incoming HTTP requests
- I have Actors (type B) that log these requests in a Redis DB

Currently, using Scala Actors, the scheduler does not interleave
execution of A and B. So when you have a burst of requests, the type A
actors get all busy, and then type B actors get busy, killing the
response time for the next requests.

So instead of scheduling like this:

  A A A A A B B B B B

I would like to schedule like this:

  A B A B A B A B A B

Or even better, be able to decide at each step if it's better to
execute an A or a B.

Could anyone point me on how to do this with Akka ?

Thanks,

 -- Sébastien


 
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.
Sébastien Pierre  
View profile  
 More options Jan 5 2010, 8:57 am
From: Sébastien Pierre <sebastien.pie...@gmail.com>
Date: Tue, 5 Jan 2010 08:57:53 -0500
Local: Tues, Jan 5 2010 8:57 am
Subject: Custom Scheduler in Akka

Hello,

I've been looking at Akka today in the perspective of implementing a
custom scheduler for an Actor-based Web system. I found Scala scheduler
to be a little bit hairy, and looking at Akka's documentation, I was
impressed by its clarity and the richness of features.

So my problem is as follows:

- I have Actors (type A) that process incoming HTTP requests
- I have Actors (type B) that log these requests in a Redis DB

Currently, using Scala Actors, the scheduler does not fully interleave
execution of A and B. So when you have a burst of requests, the type A
actors get all busy, and then type B actors get busy, killing the
response time for the next requests.

So instead of scheduling like this:

 A A A A A B B B B B

I would like to schedule like this:

 A B A B A B A B A B

Or even better, be able to decide at each step if it's better to
execute an A or a B.

Could anyone point me on how to do this with Akka ?

Thanks,

 -- Sébastien


 
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.
Jonas Bonér  
View profile  
 More options Jan 5 2010, 3:21 pm
From: Jonas Bonér <jbo...@gmail.com>
Date: Tue, 5 Jan 2010 21:21:34 +0100
Local: Tues, Jan 5 2010 3:21 pm
Subject: Re: [akka-user] Custom Scheduler in Akka
Hi Sébastien.

Thanks for your interest in Akka.

I think it would be hard to enforce what you need with the
out-of-the-box event-based dispatcher (the default), since it runs on
a thread pool its impossible to control the actual OS thread
dispatching (which is done by the OS scheduler).

The thread-based dispatcher might give you more what you need. Try that.

One that will give you the exact interleaving is the single-thread
dispatcher in which each event is ordered and executed one by one on
the same thread. But this one has no scalability and is dangerous
since one actor can block all.

You can also implement your own dispatcher by implementing the
MessageDispatcher trait.

Hope it helps, Jonas.

2010/1/5 Sébastien Pierre <sebastien.pie...@gmail.com>:

--
Jonas Bonér

twitter: @jboner
blog:    http://jonasboner.com
work:   http://scalablesolutions.se
code:   http://github.com/jboner
code:   http://akkasource.org
also:    http://letitcrash.com


 
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.
Sergio Bossa  
View profile  
 More options Jan 5 2010, 3:39 pm
From: Sergio Bossa <sergio.bo...@gmail.com>
Date: Tue, 5 Jan 2010 21:39:41 +0100
Local: Tues, Jan 5 2010 3:39 pm
Subject: Re: [akka-user] Custom Scheduler in Akka
The reactor based dispatcher should indeed give the requested  
behavior, scheduling messages to waiting actors while "ignoring"  
messages to busy ones.

Cheers

Sergio Bossa
Sent by iPhone

Il giorno 05/gen/2010, alle ore 21.21, Jonas Bonér <jbo...@gmail.com>  
ha scritto:


 
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 »