Modifying the watch list of an active reserve-with-timeout

45 views
Skip to first unread message

payam.s

unread,
Feb 21, 2012, 7:11:36 PM2/21/12
to beansta...@googlegroups.com
I was wondering if there is an easy solution to modify the watch list while a reserve-with-timeout command is in place?
For example a process is watching tubeA, and does a reserve for 60 seconds. Sometime during that 60 seconds it wants to listen to tubeB as well as tubeA; can we modify the watch list for the already in place reserve to add tubeB in? If not, is there a way to cancel that reserve and initiate a new one to watch both tubes?

Thanks,
-Payam

Keith Rarick

unread,
Feb 21, 2012, 8:04:19 PM2/21/12
to beansta...@googlegroups.com
On Tue, Feb 21, 2012 at 4:11 PM, payam.s <paya...@gmail.com> wrote:
> I was wondering if there is an easy solution to modify the watch list while
> a reserve-with-timeout command is in place?
> ...

> If not, is there a way to cancel that reserve and initiate a new
> one to watch both tubes?

There's no way to do that in a single connection.
If you really want to do it, you can open a new
connection and close the old one.

kr

payam.s

unread,
Feb 21, 2012, 8:22:34 PM2/21/12
to beansta...@googlegroups.com
Thanks Keith,

I was actually looking at the code to see if there is a way to add that feature in easily, but looks like because the connection goes into STATE_WAIT state when receives the RESERVE command, I need to change how states are managed to get the functionality that I want... so that's not an option any more :)

Closing the old connection and re-opening it might get too expensive for us, as this situation is a common thing in our application. One other solution is to create a new connection for the new tube and reserve on that, but this way we'll hit the system's connection limit very fast. Do you know if there is any way to get around that limit?

-Payam

Keith Rarick

unread,
Feb 21, 2012, 9:15:33 PM2/21/12
to beansta...@googlegroups.com
On Tue, Feb 21, 2012 at 5:22 PM, payam.s <paya...@gmail.com> wrote:
> we'll hit the system's connection limit very fast. Do you know if there
> is any way to get around that limit?

Which system are you referring to, the client OS? The server OS?
What limit do you observe? A single beanstalkd should work ok
with 10-20k concurrent connections.

kr

payam.s

unread,
Feb 22, 2012, 12:05:32 PM2/22/12
to beansta...@googlegroups.com
I'm referring to the limit on the number of connections to one beanstalkd instance on a single port (65535). 

I know it's a long shot and you most probably can't handle more, but I wanted to make sure of it by asking even though I might look like a fool :-)

and thanks again for all the great work on beanstalk. We are using it for different parts of our system for completely different tasks, and we are all very happy with it's performance and simplicity.

-Payam

Keith Rarick

unread,
Feb 23, 2012, 2:06:59 AM2/23/12
to beansta...@googlegroups.com
On Wed, Feb 22, 2012 at 9:05 AM, payam.s <paya...@gmail.com> wrote:
> I'm referring to the limit on the number of connections to one beanstalkd
> instance on a single port (65535).

Just how many clients do you have talking to this
beanstalkd instance? o_O

kr

payam.s

unread,
Feb 23, 2012, 4:35:45 PM2/23/12
to beansta...@googlegroups.com
Haha, tons for this system (we use beanstalk for different things). 
The best case scenario for us would be to have one client per active user. But because of the limits on the number of connections we use one connection per process and watch for all the users that are active in that process. That is why in my original question I was asking if we can modify the watch list while a reserve is in place, as our users connect/disconnect we need to update the watch list accordingly but we can not do that while reserving.

-Payam
Reply all
Reply to author
Forward
0 new messages