[Backgroundrb-devel] Too many clients already
dan at revelationglobal.com
Wed Jun 25 17:33:51 EDT 2008
We are currently working on offloading some long running tasks to
backgroundrb, and we are using the thread_pool.defer method. Our
intent originally was to have one worker running, and have it process
requests as they came in in threads, so that we don't have a lot of
these workers running concurrently.
It seems in our testing that backgroundrb is not closing these worker
threads as they finish, and will eventually stop queueing new requests
with the message: FATAL: sorry, too many clients already.
Since we intend to open just one worker, and have it queue and process
requests as they come in inside the thread pool, how do we close these
threads once we are finished? Or am I misunderstanding how this model
should work, and we should be instantiating a new worker per request?
Here is the code we are using:
More information about the Backgroundrb-devel