Sorry, I forgot to provide some important details.  Someday I won't be
so noobish about all this stuff.  :)

I'm using Ruby 1.8.6 on Windows XP, Rails 2.3.2, heroku gem 1.15.1,
and delayed_job gem 2.0.5.

I would have tried ddollar's heroku-autoscale, but it's not ready for
production apps, and from what I've read, doesn't scale workers, only
dynos.  I tried lostboy's workless gem, but couldn't get it working
(sorry, it's been several days, and I can't remember why it didn't
work--I may try again).

Thanks.

Jim Costello

On Jan 18, 12:36 pm, rubynoob <[email protected]> wrote:
> I'm trying a different approach to autoscaling workers in my heroku
> app.
>
> I'm using a custom config variable in my heroku config I've labeled
> 'WORKER_COUNT', which represents how many workers are running
> currently.  I've also added HEROKU_USERNAME, HEROKU_PASSWORD, and
> HEROKU_APP to my heroku config.
>
> I added "require 'heroku'" at the beginning of my application
> controller, and a method to add a worker and increment 'WORKER_COUNT'
> by one...:
>
>         def add_heroku_worker
>                 heroku = Heroku::Client.new(ENV['HEROKU_USERNAME'],
> ENV['HEROKU_PASSWORD'])
>                 myapp = heroku(ENV['HEROKU_APP'])
>                 worker_count = heroku(ENV['WORKER_COUNT'])
>                 qty = worker_count + 1
>                 heroku.add_config_vars(myapp, {"WORKER_COUNT" => qty})
>                 heroku.set_workers(ENV['HEROKU_APP'], qty)
>         end
>
> ...and another method (called 'subtract_heroku_worker') to subtract a
> worker and deprecate 'WORKER_COUNT' by one.
>
> I call add_heroku_worker right after delaying a job...:
>
>         @job.delay.import(path)
>         add_heroku_worker
>
> ...and subtract_heroku_worker right after the job sucessfully
> completes.
>
> Problem is, nothing seems to be happening.  I get no errors, but no
> workers, either.  I suspect either my syntax is wrong, or I'm just
> going about this the wrong way.
>
> Can anybody help shed some light on this?

-- 
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