Re: Most popular (view counts), performance and Varnish cache

2011-03-02 Thread Russell Quinn
Hey Oren,

Thanks for the comments. I think probing Google Analytics with a
DelayedJob is the way to go.

Thanks again,

Russell.

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



Most popular (view counts), performance and Varnish cache

2011-03-01 Thread Russell Quinn
Hey everyone,

I'm building a website that needs to list articles ranked by how
popular the are (i.e. page views.) Does anyone have any ideas of how
to implement this in an optimised way using Rails 3 on Heroku? The
article pages are going to be heavily cached by the Varnish layer too,
so I'm at odds to how do this.

Thanks,

Russell.

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



MySQL server has gone away Amazon RDS

2010-11-26 Thread Russell Quinn
I've occasionally getting MySQL server has gone away errors from my
app running on Heroku (with the Amazon RDS add-on.)

I'm guessing I need to adjust some packet size or timeout parameter.
Does anyone have reliable information on what I should do?

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.



Sendgrid questions

2010-10-29 Thread Russell Quinn
* What happens if I exceed my quota?
* How do we access the Sendgrid web interface from our Heroku account?

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



Deploy failing

2010-10-19 Thread Russell Quinn
I'm getting the following error from an app that I haven't pushed in a
few months. I updated to Rails 3.0.1 and tried to deploy and got the
following error. I tried going back to 3.0.0, but got the same error
again.

Any ideas?

Thanks,

Russell.

- Heroku receiving push
- Rails app detected
- Gemfile detected, running Bundler version 1.0.0
   Unresolved dependencies detected; Installing...
   /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/
tar_input.rb:49:in `initialize': not in gzip format
(Zlib::GzipFile::Error)
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/
tar_input.rb:49:in `new'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/
tar_input.rb:49:in `initialize'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/
tar_reader.rb:64:in `each'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/
tar_reader.rb:55:in `loop'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/
tar_reader.rb:55:in `each'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/
tar_input.rb:32:in `initialize'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/
tar_input.rb:17:in `new'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/
tar_input.rb:17:in `open'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package.rb:
58:in `open'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/format.rb:
63:in `from_io'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/format.rb:
51:in `from_file_by_path'
from /usr/ruby1.8.7/lib/ruby/1.8/open-uri.rb:32:in
`open_uri_original_open'
from /usr/ruby1.8.7/lib/ruby/1.8/open-uri.rb:32:in `open'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/format.rb:
50:in `from_file_by_path'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/source.rb:198:in `cached_specs'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/source.rb:196:in `each'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/source.rb:196:in `cached_specs'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/source.rb:195:in `each'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/source.rb:195:in `cached_specs'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/source.rb:157:in `fetch_specs'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/index.rb:7:in `build'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/source.rb:155:in `fetch_specs'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/source.rb:70:in `specs'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/lazy_specification.rb:48:in `__materialize__'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/spec_set.rb:83:in `materialize'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/spec_set.rb:81:in `map!'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/spec_set.rb:81:in `materialize'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/definition.rb:93:in `specs'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/definition.rb:88:in `resolve_remotely!'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/installer.rb:35:in `run'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/installer.rb:8:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/cli.rb:217:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/vendor/thor/task.rb:22:in `send'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/vendor/thor/task.rb:22:in `run'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/vendor/thor.rb:246:in `dispatch'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/
bundler/vendor/thor/base.rb:389:in `start'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/bin/
bundle:13
from /usr/ruby1.8.7/bin/bundle:19:in `load'
from /usr/ruby1.8.7/bin/bundle:19
   FAILED: http://docs.heroku.com/bundler
 ! Heroku push rejected, failed to install gems via Bundler

-- 
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: Repeated::Job cannot find Delayed::Job

2010-08-06 Thread Russell Quinn
I solved this. Apparently there is an issue with delayed_job loading.
See here:

http://groups.google.com/group/delayed_job/browse_thread/thread/19dc6207a455029d/e776959275325763?lnk=gstq=uninitialized+constant#e776959275325763

Note that putting the recommended 'Delayed::Worker.backend
= :active_record'in initializers/ doesn't work in this case as they
are run *after* the plug-ins are loaded. I just added it to the
repeated_job plugin's init.rb before it creates the job and everything
works now.

Russell.


On Aug 5, 6:09 pm, David Dollar da...@heroku.com wrote:
 Make sure the delayed_job plugin has been pushed to your app (that there is 
 no .git subdirectory inside it masking the files)

 You can try to clone your app from heroku into /tmp to see a pristine state 
 of what is in Heroku's repo.

 cd /tmp
 git clone g...@heroku.com:myapp.git

 On Aug 5, 2010, at 11:56 AM, Russell Quinn wrote:



  I'm trying to get these two things working together. Delayed::Job is
  installed, has the migrations and there's a background worker running,
  etc. However, Repeated::Job can't find it on start-up. I've tried
  explicitly setting the plugin load order in Rails (although they're
  alphabetically correct anyway,) but this doesn't help.

  Does anyone have any ideas? Here are my logs from straight after a
  slug launch. Both canary-1684341.log and dj-1891287.log complain about
  Repeated::Job (erroneously called Repeated::Cron in the error message
  from the plugin's init.rb) not finding Background::Job.

  Thanks,

  Russell.

  -

  == exceptional.log ==
  # Logfile created on Thu Aug 05 08:50:01 -0700 2010 by logger.rb
  [INFO] (init.rb:18) Thu Aug 05 15:50:01 UTC 2010 - Loading Exceptional
  for 2.3.8

  == newrelic_agent.log ==
  # Logfile created on Thu Aug 05 08:50:02 -0700 2010 by logger.rb
  [08/05/10 08:50:02 -0700 railgun64.30863 (8200)] INFO : Dispatcher:
  thin
  [08/05/10 08:50:02 -0700 railgun64.30863 (8200)] INFO : Application:
  X-XX
  [08/05/10 08:50:02 -0700 railgun64.30863 (8200)] INFO : New Relic RPM
  Agent 2.12.3 Initialized: pid = 8200
  [08/05/10 08:50:02 -0700 railgun64.30863 (8200)] INFO : Agent Log
  found in /disk1/home/slugs/232258_d8f7c76_6525/mnt/log/
  newrelic_agent.log

  == production.log ==
  # Logfile created on Thu Aug 05 08:50:01 -0700 2010
  == canary-1684341.log ==
  Exception encountered, Repeated::Cron not loaded
  uninitialized constant Delayed::Job
  ** [NewRelic] New Relic RPM Agent 2.12.3 Initialized: pid = 8200
  ** [NewRelic] Agent Log found in /disk1/home/slugs/232258_d8f7c76_6525/
  mnt/log/newrelic_agent.log
  Thin web server (v1.2.6 codename Crazy Delicious)
  Maximum connections set to 1024
  Listening on 0.0.0.0:3693, CTRL+C to stop

  == production.log ==
  # Logfile created on Thu Aug 05 08:50:11 -0700 2010
  == dj-1891287.log ==
  (in /disk1/home/slugs/232258_d8f7c76_6525/mnt)
  Exception encountered, Repeated::Cron not loaded
  uninitialized constant Delayed::Job

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



Repeated::Job cannot find Delayed::Job

2010-08-05 Thread Russell Quinn
I'm trying to get these two things working together. Delayed::Job is
installed, has the migrations and there's a background worker running,
etc. However, Repeated::Job can't find it on start-up. I've tried
explicitly setting the plugin load order in Rails (although they're
alphabetically correct anyway,) but this doesn't help.

Does anyone have any ideas? Here are my logs from straight after a
slug launch. Both canary-1684341.log and dj-1891287.log complain about
Repeated::Job (erroneously called Repeated::Cron in the error message
from the plugin's init.rb) not finding Background::Job.

Thanks,

Russell.

-

== exceptional.log ==
# Logfile created on Thu Aug 05 08:50:01 -0700 2010 by logger.rb
[INFO] (init.rb:18) Thu Aug 05 15:50:01 UTC 2010 - Loading Exceptional
for 2.3.8

== newrelic_agent.log ==
# Logfile created on Thu Aug 05 08:50:02 -0700 2010 by logger.rb
[08/05/10 08:50:02 -0700 railgun64.30863 (8200)] INFO : Dispatcher:
thin
[08/05/10 08:50:02 -0700 railgun64.30863 (8200)] INFO : Application:
X-XX
[08/05/10 08:50:02 -0700 railgun64.30863 (8200)] INFO : New Relic RPM
Agent 2.12.3 Initialized: pid = 8200
[08/05/10 08:50:02 -0700 railgun64.30863 (8200)] INFO : Agent Log
found in /disk1/home/slugs/232258_d8f7c76_6525/mnt/log/
newrelic_agent.log

== production.log ==
# Logfile created on Thu Aug 05 08:50:01 -0700 2010
== canary-1684341.log ==
Exception encountered, Repeated::Cron not loaded
uninitialized constant Delayed::Job
** [NewRelic] New Relic RPM Agent 2.12.3 Initialized: pid = 8200
** [NewRelic] Agent Log found in /disk1/home/slugs/232258_d8f7c76_6525/
mnt/log/newrelic_agent.log
 Thin web server (v1.2.6 codename Crazy Delicious)
 Maximum connections set to 1024
 Listening on 0.0.0.0:3693, CTRL+C to stop

== production.log ==
# Logfile created on Thu Aug 05 08:50:11 -0700 2010
== dj-1891287.log ==
(in /disk1/home/slugs/232258_d8f7c76_6525/mnt)
Exception encountered, Repeated::Cron not loaded
uninitialized constant Delayed::Job

-- 
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-28 Thread Russell Quinn
Thanks for the reply Morten. Repeated_job looks like just the ticket
and a very elegant and simple solution too.

One further question: I presume that this will require 1 worker to
function and that this will negate the need for the Cron add-on? Will
calling rake::cron every 15 minutes via this method hit any sort of
limiter designed to stop people circumnavigating the paid hourly Cron
add-on? In other words: how does the business side of this work? :)

Thanks again,

Russell.


On Jul 27, 10:41 pm, Morten Bagai mor...@heroku.com wrote:
 Hi Russell,

 One of our engineers made this fork of DJ that I believe does what you 
 want:http://github.com/ddollar/repeated_job. Let me know if there's anything 
 else we can help with. We're looking forward to having you on our platform.

 Best,

 Morten

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



Best solution to replace this cron job

2010-07-27 Thread Russell Quinn
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.



CAS + Castronaut + databases + heroku

2010-07-22 Thread Russell Quinn
I am trying to implement a single-sign-on setup with Castronaut (which
runs on Sinatra.)

What I want to do:

- Castronaut app (Sinatra) at: https://login.examle.com
- User management app (Rails) (user creation, forgotten passwords,
entry of global information such as addresses, etc.) at: 
https://accounts.example.com
- Various other web apps (most likely all Rails) that authenticate
with the Castronaut server and refer users to the user management
server for, um, user management tasks.

The problem:

- Castronaut (and any CAS server) needs two databases (one for the CAS-
specific stuff and another for the user records—although in theory
these could be the same physical database I believe.) The user records
one needs to be shared between both Castronaut *and* the user
management server.

My questions:

* How can I get Heroku to set up two databases in the Sinatra
castronaut.yml config file? (one for cas_database and one for
cas_adapter.)
* How can I share the cas_adapter database between two Heroku apps?
This is impossible with the default Heroku PostgreSQL database, right?
* Would a solution be to use the PostgreSQL database for the
cas_database and then an Amazon RDS for the cas_adapter? If so, how
could I configure Heroku to do this?

Alternatively:

Castronaut can be built into a gem and run. Would it be somehow
possible to have the Castronaut Sinatra gem and the user management
rails app running together in the same Heroku app? (the Sinatra gem
runs on a different port.) In that case I could use a single
PostgreSQL database for both cas_database and cas_adapater and both
the Sinatra gem and Rails app could access it, right?

Thanks in advance for any advice,

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.