Re: Resque workers are on strike (but they do in console)

2010-10-04 Thread James Bracy
Clément,

Looks like something is up with the DJ's but I can't really tell.

It works when you run the rake task on heroku, but not the workers?

My AIM / gTalk is waratuman. Probably easier to debug if you get a
hold of me that way. I'll also be on Heroku IRC in a sec.

- James

On Mon, Oct 4, 2010 at 11:05 AM, Clément  wrote:
> Hi all,
> I'm using Resque workers on Heroku with Rails 2.3.9, Ruby 1.9.2.
> I followed this nice guide : 
> http://blog.redistogo.com/2010/07/26/resque-with-redis-to-go/
> All works great localy.
>
> However, I have a stange problem when deploying on Heroku :
>
> If I do
> $ heroku rake jobs:work --trace --app my-app
> And all works as expected with Resque.
> $ heroku ps --app my-app
> UPID     Slug          Command                     State       Since
> ---    --  --
> -
> 2458746  7940b53_99b0  rake jobs:work --trace      up          1m
> ago
> 1676789  0c1293b_0e00  cron                        idle        8h
> ago
> 1485310  7940b53_99b0  dyno                        up          12m
> ago
>
>
> But when I turn one or more workers with
> $ heroku workers 2 --app my-app
> Nothing happens, even if I restart my app.
>
> I've got no crash in the log file, and
> $ heroku ps --app my-app
> nicely tells me :
> UPID     Slug          Command                     State       Since
> ---    --  --
> -
> 2458625  7940b53_99b0  dj                          idle        8m
> ago
> 2458624  7940b53_99b0  dj                          idle        8m
> ago
> 1676789  0c1293b_0e00  cron                        idle        8h
> ago
> 1485310  7940b53_99b0  dyno                        up          7m ago
>
> I can simultaneously run remote rake & worker, in this case I got
> $ heroku ps --app my-app
> UPID     Slug          Command                     State       Since
> ---    --  --
> -
> 2458770  7940b53_99b0  dj                          idle        5s
> ago
> 2458769  7940b53_99b0  dj                          idle        6s
> ago
> 2458746  7940b53_99b0  rake jobs:work --trace      up          1m
> ago
> 1676789  0c1293b_0e00  cron                        idle        8h
> ago
> 1485310  7940b53_99b0  dyno                        up          12m
> ago
>
> Any idea ?
> Thanks !
> Clément
>

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



Re: Cron + Delayed Job

2010-08-11 Thread James Bracy
This is one way to implement it:
http://blog.darkhax.com/2010/07/30/auto-scale-your-resque-workers-on-heroku

On Tue, Aug 10, 2010 at 11:28 AM, Arpan  wrote:
> Is it possible to use a Cron Job to start a worker, run a series of
> jobs and then shut down the worker?
>
> Basically I am going to have a few jobs that need to run once a day. I
> need to update a large number of records from a supplier on a daily or
> weekly basis.
>
> The job will take a couple hours, but I don't want to have a worker
> running all day as they will be idle the 80% of the time.
>
> Should I just use a cron job on the main dyno. Is there a time limit
> for a cron job and will this slow the main server? I could run it at
> 2AM, when the site is mostly idle.
>
> Or is there a way to start a worker, run the jobs and shut down the
> worker once the jobs are done from cron?
>
> What is the best way to implement this?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Heroku" group.
> To post to this group, send email to her...@googlegroups.com.
> To unsubscribe from this group, send email to 
> heroku+unsubscr...@googlegroups.com.
> 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 her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Custom Error Pages

2010-08-06 Thread James Bracy
+1, especially for the backlog to deep.

On Fri, Aug 6, 2010 at 4:54 AM, Idris  wrote:
> +1 for this feature.  If we could just upload static HTML pages for
> the different possible heroku errors, that would be great.  It's
> unacceptable for a Heroku branded error to come up no matter what the
> error is.
>
> On Aug 6, 6:41 am, Tomaž Žlender  wrote:
>> +1 for this feature.
>>
>> On Jul 27, 6:20 am, daniel hoey  wrote:
>>
>>
>>
>> > Is there anyway to use our own error pages instead of the Heroku
>> > ones?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Heroku" group.
> To post to this group, send email to her...@googlegroups.com.
> To unsubscribe from this group, send email to 
> heroku+unsubscr...@googlegroups.com.
> 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 her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Best solution to replace this cron job

2010-07-27 Thread James Bracy
I recommend using Resque w/ Resque Scheduler for this.

One of the major benefits is the web front end that Resque already has.

If your background tasks aren't going to happen very often then DJ
would be fine.

On Heroku I would just add an hourly cron that would put the jobs into
the DJ queue for the following hour.

- James

On Tue, Jul 27, 2010 at 9:15 AM, Russell Quinn  wrote:
> I'm migrating an iPhone app backend server from Brightbox to Heroku.
> One thing the app does is perform a rake task every 15 minutes to
> check for various things including sending Push Notifications in
> batches.
>
> I understand that this rake task should probably be run in a Delayed
> Job task, but how do I put one new Delayed Job task in the queue every
> 15 minutes? i.e. There is no user task performed to trigger the
> creation of new jobs, rather they need to be created every 15 minutes.
>
> Thanks,
>
> Russell.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Heroku" group.
> To post to this group, send email to her...@googlegroups.com.
> To unsubscribe from this group, send email to 
> heroku+unsubscr...@googlegroups.com.
> 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 her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Getting the client IP address through heroku/rack?

2010-07-06 Thread James Bracy
I believe you are being routed through Amazon's Elastic Load Balancer.
Its not actually Heroku, its Amazon keeping the IP from you. If you
switch to IP for SSL you can get the IP Address of the user making the
request.

- James

On Tue, Jul 6, 2010 at 5:14 AM, Maximilian Mack  wrote:
> I need to pick up that problem another time.
>
> We have the problem that we need to "guess" the Time Zone of the User. One 
> way is to get the time zone offset from the browser.
> Another is to use a ip2timezone service. But how can i use them without 
> knowing the ip address?
>
> Although i have the answer from the support, can someone explain me why it 
> does not work to redirect the real IP Address to the Rails App with hostname 
> based ssl? What's the difference to normal (without ssl) usage?
>
> Greetings Max
>
>
> Am 30.06.2010 um 05:16 schrieb chris:
>
>> Ah, so Hostname SSL is the problem. That sucks. Thanks for the info
>> Max.
>>
>> I guess the only solution would be some kind of JSONP or iframe hosted
>> on Heroku(or whereever) w/o Hostname SSL, spitting out the REAL_IP.
>>
>> On Jun 29, 5:05 pm, Maximilian Mack  wrote:
>>> I have the same issue. I guess it was since i added hostname-based ssl. 
>>> Before that it worked.
>>>
>>> Look at this conversation with the support:
>>>
>>> -
>>> Hi Heroku,
>>> somewhere in the mailing list i got the hint that in the request headers 
>>> the ip from the visitor can be found as "HTTP_X_REAL_IP".
>>> That worked until i added hostname based SSL support.
>>>
>>> After adding the ssl support i can not get the real ip from the visitor. I 
>>> always get internal ip's like 10.X.X.X.
>>>
>>> Any way to find out the real ip?
>>>
>>> Greetings Max
>>>
>>> -
>>> Unfortunately Amazon does not forward the original IP through EBS, which 
>>> leads to original IP not being available.
>>>
>>> Hope this helps,
>>> David
>>>
>>> -
>>> Even if i use ssl only on some of my webpages?!?
>>> -
>>> Yes, because your domain is CNAMEd to the Amazon EBS which drop the 
>>> originating IP information unfortunately.
>>>
>>> Hope this helps,
>>> David
>>>
>>> -
>>>
>>> Am 29.06.2010 um 22:54 schrieb chris:
>>>
>>>
>>>
 When I puts env (say, in a rack middleware), I get the following
 fields related to IP addresses:
>>>
 "HTTP_X_REAL_IP"=>"10.245.134.175",
 "HTTP_X_FORWARDED_FOR"=>"10.245.134.175,10.195.207.240",
 "REMOTE_ADDR"=>"10.194.119.63"
>>>
 Those are all private ips (10.xxx).
>>>
 How are y'all getting the client IP? What am I missing?
>>>
 Thanks!
>>>
 --
 You received this message because you are subscribed to the Google Groups 
 "Heroku" group.
 To post to this group, send email to her...@googlegroups.com.
 To unsubscribe from this group, send email to 
 heroku+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://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 her...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> heroku+unsubscr...@googlegroups.com.
>> 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 her...@googlegroups.com.
> To unsubscribe from this group, send email to 
> heroku+unsubscr...@googlegroups.com.
> 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 her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: About merb

2008-08-28 Thread James Bracy
working with merb would be great!
James

On Thu, Aug 28, 2008 at 8:12 PM, Baptiste Decroix <
[EMAIL PROTECTED]> wrote:

>
> Yes it would be great to be able to try other frameworks.
>
>
> 2008/8/28 j4s0n <[EMAIL PROTECTED]>:
> >
> > Sinatra would be great :)
> >
> > On Aug 29, 7:19 am, Noah Thorp <[EMAIL PROTECTED]> wrote:
> >> Yes. But I personally would put scalability and stability for Rails
> >> Apps higher in the queue (as it seems you are doing).
> >>
> >> On Aug 28, 2008, at 1:04 PM, Adam Wiggins wrote:
> >>
> >>
> >>
> >> > Small apps will always be free, and medium apps will be affordable to
> >> > individuals and small companies.  So don't worry on that front.
> >>
> >> > As to running Merb or other frameworks besides Rails, you can't do it
> >> > today, but it is something we've considered.  Quick straw poll: who
> >> > else is interested in being able to run Merb, or some other Ruby
> >> > framework, on Heroku?
> >>
> >> > Adam
> >>
> >>
> > >
> >
>
>
>
> --
> Baptiste
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com
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
-~--~~~~--~~--~--~---