Hi, I’ve done some work intergrating call center software with ruby on
Specifically I’ve built a login page for our call center reps, about
every 3 seconds it performs an AJAX query to see if there’s any new
If there it is, it pop up’s a custom page.
The application runs for 100 users on mongrel rails, (single box) quite
It’s got enough spare capacity to run perhaps 3-500 users at the same
However I want to be able to scale this to around 2-5 thousand reps. (or
Clearly I’ll need to move to a clustered solution.
Here’s an optimization I’d like to make.
Rather then polling the database for each individual user every 3
I’d like to have rails it’s self poll more often, but keep an internal
queue of what needs to be sent out.
When the AJAX connection hits Rails, it checks an internal object,
rather then the database for new actitvity.
Or better yet, when there is new activity it somehow pushes it out the
User, (Avoid the users polling the database).
I suppose I’m looking for some sort of global session variable, that can
be split across a cluster.
I’m not really sure how to approach this.
Could anyone offer some hints on how to do this?
Worst case, I can always beef up the database cluster to an extreme,
that’d work, but it just doesn’t seem like the best solution.