Also a thought.

You will need to introduce a lag when you are determining if you need more or 
less delayed job workers.

Otherwise you will spin up too many DJs too quickly. And add/remove them very 
often. Incurring extra charges.

Smugmug spoke about this when they were talking about their on demand photo 
processors a few years back.

--Keenan


On Jan 20, 2011, at 6:06 PM, Pedro Belo <[email protected]> wrote:

> That was a good call, you definitely don't want to store variables in
> config vars. Save if for constants (passwords, urls, etc).
> 
> It seems like you might be getting an error due to different versions
> of RestClient, not sure though. What version are you using? What's the
> stack trace for the exception?
> 
> On a side note, if it helps you can call heroku workers passing
> relative values, like +3, -1, etc.
> 
> On Thu, Jan 20, 2011 at 12:00 PM, rubynoob <[email protected]> wrote:
>> Instead of storing the count of active workers as a heroku config
>> variable, I decided to create a table in our database to store the
>> value in.
>> So now I've got the problem narrowed down to the last line in the
>> method.  Here's the block of code I've now got:
>> 
>> add_heroku_worker
>>                heroku = Heroku::Client.new(ENV['HEROKU_USERNAME'],
>> ENV['HEROKU_PASSWORD'])
>>                myapp = heroku.config_vars(ENV['HEROKU_APP'])["HEROKU_APP"]
>>                worker_count = WorkerCount.find(1)  # now I'm storing the 
>> current
>> number of active workers in a table that will always only have one
>> record.
>>                workers = worker_count.workers
>>                qty = workers + 1
>>                worker_count.workers = qty
>>                worker_count.save
>>                heroku.set_workers(myapp, qty)
>> end
>> 
>> In the heroku console, this runs smoothly until I try the last line,
>> to which I get this error:  TypeError: can't convert
>> RestClient::Payload::UrlEncoded into String
>> 
>> This line is formatted the same as LostBoy's workless gem, the
>> autoscaling tree of delayed_job, and Heroku-Delayed-Job-Autoscale.  I
>> must be missing something obvious (typical newbie, huh?)   ;)
>> 
>> Thanks again for any help,
>> Jim
>> 
>> On Jan 20, 9:16 am, Peter Haza <[email protected]> wrote:
>>> I've done autoscaling of workers
>>> here:https://github.com/phaza/Heroku-Delayed-Job-Autoscale
>>> It's actually more like auto-shutdown of a single workers, but it works well
>>> in our environment.
>> 
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Heroku" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to 
>> [email protected].
>> For more options, visit this group at 
>> http://groups.google.com/group/heroku?hl=en.
>> 
>> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Heroku" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/heroku?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to