Re: Logging Question

2012-12-10 Thread Travis Reeder
Just confirmed this works. 

On Monday, December 5, 2011 11:36:06 AM UTC-8, Dave wrote:

 Thank Neil... appreciated.. will try and little trick...


 On Dec 5, 2:16 pm, Neil Middleton neil.middle...@gmail.com wrote:
  I had an issue with Sinatra on Heroku not outputting it's own output to 
 the Heroku log file even though the Heroku router etc was logging just 
 fine.  By sticking:
 
  $stdout.sync = true
 
  at the top of the application file, everything started working as 
 expected.  Apparently it's some kind of STDOUT buffering problem and the 
 Ruby MRI.
 
  Neil
 
 
 
 
 
 
 
  On Monday, 5 December 2011 at 19:11, Dave wrote:
   Hi,
 
   I am using the heroku command logs -t in a terminal window and
   watching the logs scroll by...
 
   Often I am seeing that my carefully placed puts got here type
   commands are just plain missing from the logs... if I refresh my
   browser to re-issue a certain route in Sinatra I might see all the
   output I want, but othertimes, it is just plain missing.
 
   Does the log stream just skip entries at random or is there a better
   way to ensure I see ALL my entries?
 
   Just curious...
 
   --
   You received this message because you are subscribed to the Google 
 Groups Heroku group.
   To post to this group, send email to 
   her...@googlegroups.comjavascript:(mailto:
 her...@googlegroups.com javascript:).
   To unsubscribe from this group, send email to 
 heroku+un...@googlegroups.com javascript: (mailto:
 heroku+un...@googlegroups.com javascript:).
   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 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_US?hl=en


Re: Resque vs Appoxy SimpleWorker

2011-08-29 Thread Travis Reeder
Hi Stephen,

You could definitely get increased throughput using SimpleWorker as you 
would instantly be going from one server to hundreds to run your jobs. 
(disclosure: I created SimpleWorker).  If you decide to do it, there is one 
suggestion that will make it work a lot faster/better for your scenario 
where you have a bunch of small jobs: batch up the work into fewer jobs. For 
instance, instead of queuing up one email per job, queue up 50 emails per 
job (pass an array of 50 emails to the worker). So instead of queuing up 
20,000 jobs, you'd queue up 400 jobs with 50 emails each. There are a couple 
of reasons for this:

1) It will take longer to queue up all your jobs since you're sending them 
to a remote service (unlike Resque) so it's recommended to batch them up. 
Queuing up 400 jobs takes a fraction of the time compared to queuing up 
20,000.
2) There is setup/teardown time involved on SimpleWorker, so if you're jobs 
only take a couple seconds to run, like sending an email probably does, 
you'll want to batch them up. If you don't, more time will be spent on the 
setup/teardown than actually doing the work. But if you do 50 or 100 in a 
single job, the setup/teardown will be negligible. 

I hope that helps! Feel free to email me directly if you have any other 
questions or want some help getting started. 
 
Regards,
Travis

-- 
You received this message because you are subscribed to the Google Groups 
Heroku group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/heroku/-/XUVNRZUEnbMJ.
To post to this group, send email to heroku@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.



Could an admin add a subject prefix to this list, like [heroku]

2011-05-11 Thread Travis Reeder
So we can know what list it is without having to open the email.

Cheers.

-- 
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 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Could an admin add a subject prefix to this list, like [heroku]

2011-05-11 Thread Travis Reeder
I get the filter thing can work, but how about not making everyone on the
list create a filter when one person can do it once for the entire list. I
don't think the reasons you present are very compelling reasons to not do
it. Subject line noise is most welcome when it tells me what list it's from
(like your labels) and how does it prevent you from identifying old messages
visually?

Not meaning to start a big discussion here, just seems like an odd response
to a request for something so common.

On Wed, May 11, 2011 at 3:20 PM, Richard Conroy richard.con...@gmail.comwrote:

 There is usually good reason why lists don't prefix. Line noise on the
 subject line being one of them, also the availability of advanced e-mail
 clients that can do powerful filtering.

 For instance, in GMail, which both of you use, I can set a filter to label
 all my Heroku posts.

 Hence, subject prefixing becomes redundant, and also very irritating when
 you are trying to identify old messages visually.

 regards,
 Richard


 On Wed, May 11, 2011 at 11:07 PM, Miles Smith wed...@gmail.com wrote:

 I second this.
 On May 11, 2011 10:54 AM, Travis Reeder tree...@gmail.com wrote:
  So we can know what list it is without having to open the email.
 
  Cheers.
 
  --
  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
 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 heroku@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.




 --
 http://richardconroy.blogspot.com | http://twitter.com/RichardConroy

  --
 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
 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 heroku@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: Run a cron job only on Monday

2011-03-31 Thread Travis Reeder
Hi Doug,

You might want to try www.simpleworker.com for this, you can just schedule
your job to run every monday at 7am.

eg:

class CallbackWorker  SimpleWorker::Base

  def run
  HTTParty.get('http://myapp.heroku.com/messages/send_report')
  end
end

Then schedule it with:

worker = CallbackWorker.new
worker.schedule(:start_at=Time.now.monday.change(:hour=7),
:run_every=7*24*3600)

That's it.

Travis
(disclaimer: I am with SimpleWorker)

On Thu, Mar 31, 2011 at 10:14 AM, Doug Naegele dougnaeg...@gmail.comwrote:

 Thanks Chris.

 Sorry, it didn't work.

 Here's my code:

  if Time.now.thursday?
 puts Send report
uri = URI.parse('http://myapp.heroku.com/messages/send_report')
Net::HTTP.get(uri)
 puts  Report put is done.
  end

 Here's the error output (after I ran heroku rake cron --trace)

 ** Invoke cron (first_time)
 ** Invoke environment (first_time)
 ** Execute environment
 ** Execute cron
 rake aborted!
 undefined method `thursday?' for Thu Mar 31 10:06:51 -0700 2011:Time
 /app/lib/tasks/cron.rake:28


 (if Time.now.thursday? is line 28)

 -

 the following also throws an error:

 if Time.now == thursday
 .
 .
 .
 .

 (output below)
 rake aborted!
 undefined local variable or method `thursday' for main:Object

 

 this also throws an error:

 if Time.now.day == thursday
 .
 .
 .
 .
 (output below)
 rake aborted!
 undefined local variable or method `thursday' for main:Object



 On Mar 31, 12:32 pm, Chris Hanks christopher.m.ha...@gmail.com
 wrote:
  Try: Time.now.monday?
 
  On Mar 31, 8:16 am, Doug Naegele dougnaeg...@gmail.com wrote:
 
 
 
   Can someone help me configure Heroku Cron to only run on a certain
   day?
 
   So, imagine I send an email report every Monday morning.  How do I
   write the syntax for that?
 
   Something like this:
 
   This one works:
 
 if Time.now.hour == 7  ##Sends report @7am, PST.
   puts Send report
   uri = URI.parse('http://myapp.heroku.com/messages/send_report')
   Net::HTTP.get(uri)
   puts  Report is done.
 end
 
   This one does not work:
 
 if Time.now == Monday  ##Sends report at the daily Heroku cron run,
   but only on Monday.
   puts Send report
   uri = URI.parse('http://myapp.heroku.com/messages/send_report')
   Net::HTTP.get(uri)
   puts  Report is done.
 end
 
   thanks in advance

 --
 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
 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 heroku@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: request.remote_ip

2011-03-14 Thread Travis Reeder
Check out the headers, you may find X-Forwarded-For or X-Forwarded-Proto
which will be the IP you want.

On Mon, Mar 14, 2011 at 1:42 PM, Carson Gross carsongr...@gmail.com wrote:

 Hello,

 I'm trying to get at the remote ip address for requests, and I'm using
 the standard

  request.remote_ip

 method, but it appears that this is returning the same few IP's for
 all our users.  My guess is that this is the heroku load balancer at
 work, but that's just a shot in the dark.

 Any suggestions or pointers?

 Cheers,
 Carson

 --
 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
 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 heroku@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: Autoscaling of dynos/workers from within app

2011-03-02 Thread Travis Reeder
Hi Miles,

Don't mean to shamelessly plug our product here, but you're use case is so
fitting for it.  You might want to consider trying the SimpleWorker Add-on
so you don't need to scale up your worker threads or anything like that, you
just queue up jobs and they'll get run in parallel.

Regards,
Travis Reeder

On Tue, Mar 1, 2011 at 1:51 AM, Miles S. wed...@gmail.com wrote:

 I'm trying to auto scale my workers and I am using resque instead of
 DJ. I've tried using the heroku gem, however, when I use any account
 besides the master account, I get an RestClient::UnprocessableEntity:
 Unprocessable Entity error.

 From my testing it appears that collaborators are not able to modify
 the number of running workers/dynos.

 I don't want to use my master account, as this project is shared
 amongst developers, and I don't really want my master account and
 password being committed to Git for everyone to see.

 I've also tried finding information on how to use the heroku rest API
 directly, but have come up with nothing.

 Is there any way to do what I'm trying to do?

 --
 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
 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 heroku@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: Appoxy SimpleWorker

2011-02-28 Thread Travis Reeder
Hi there,

I am with Appoxy, the creators of SimpleWorker, and you should be able to 
run any kind of job you want. Obviously some jobs need more horsepower so we 
have plans with bigger servers too. Feel free to contact me directly and 
I'll see what I can do to make it work for you.

Regards,
Travis Reeder

-- 
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 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.