resque

deploying redis to heroku unable to connect

荒凉一梦 提交于 2019-11-30 01:49:51
ive been trying to get resque to work with heroku. i can successfully get it to work in development mode, however when i try pushing to heroku i get Errno::ECONNREFUSED (Connection refused - Unable to connect to Redis on 127.0.0.1:6379): i then read and followed http://blog.redistogo.com/2010/07/26/resque-with-redis-to-go/ i put the configurations listed in the site but got the following error SocketError (getaddrinfo: nodename nor servname provided, or not known): i put in my initializers/resque.rb Resque.after_fork = Proc.new { ActiveRecord::Base.establish_connection } ENV["redis://redistogo

What is the proper way to setup and use php-resque?

不羁的心 提交于 2019-11-29 20:29:30
I am trying to use php-resque to queue and execute ffmpeg conversions on my server. I understand broadly how it should work, but I am having some trouble with the details and can not find any tutorials. Specifically, I don't understand where I should place my job classes, and how to give the classes to my workers and start my workers. The read me only says "Getting your application underway also includes telling the worker your job classes, by means of either an autoloader or including them." Hopefully someone can outline the overall structure of using php-resque. You can put your job classes

Does anyone run more than one resque worker in a Heroku Dyno?

自闭症网瘾萝莉.ら 提交于 2019-11-29 14:56:52
问题 Given that unicorn usually manages more than one Rails server process, and given that a Resque job runner probably consumes less resources than a Web request, it should be possible to run more than one resque worker on a single Heroku dyno. Is anyone doing this successfully so far? My thoughts are, that an easy way to do so would have the Procfile runs foreman, which then runs 2 (or more) instances of the actual worker (i.e. rake resque:work ) Or is rake resque:workers up to that task? Resque

Optimising concurrent ImageMagick Requests using redis/php-resque

拟墨画扇 提交于 2019-11-29 08:43:10
I am working on a site that uses ImageMagick to generate images. The site will get hundreds of request every minute and using ImageMagick to do this causes the site to crash. So we implemented Redis and Php-resque to do the ImageMagick generating in the background on a seperate server so that it doesn't crash our main one. The problem is that it's still taking a very long time to get images done. A user might expect to wait up to 2-3 minutes for an image request because the server is so busy processing these images. I am not sure what information to give you, but I'm more looking for advice. I

Rails: Exception in after_create stopping save

假如想象 提交于 2019-11-28 23:10:27
Simple question. I have a ActiveRecord model that I want to perform post processing on AFTER the record is saved. So in the model I have a queue_for_processing method that sticks a job onto my Resque queue. To make this execute after my record is successfully persisted I have written the following in my model: after_create :queue_for_processing Pretty simple. I had thought that everything was working as expected EXCEPT that last night my redis server went down and things went awry. My expectations were that the record would still be saved and I could process the job later manually. But the

Postgres error on Heroku with Resque

冷暖自知 提交于 2019-11-28 21:28:24
I don't know enough Postgres to understand the message. PG::Error: SSL error: decryption failed or bad record mac : SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"users"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum And here is the callstack got from the resque backend /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:1139:in `async_exec' /app/vendor/bundle/ruby/1.9

Gems/Services for autoscaling Heroku's dynos and workers

Deadly 提交于 2019-11-28 18:21:04
I want to know if there are any good solutions for autoscaling dynos AND workers on Heroku in a production environment (probably a different solution for each of those, as they are pretty unrelated). What are you/companies using, regarding this? I found lots of options, but none of them seem really mature for a production environment. There is Heroscale, which seem to introduce some latency as it does not run locally, and I also heard of some downtime. There are modifications of delayed_jobs, which have not been updated for a long time, and there are some issues with current bundlers. There is

What is the proper way to setup and use php-resque?

[亡魂溺海] 提交于 2019-11-28 16:31:21
问题 I am trying to use php-resque to queue and execute ffmpeg conversions on my server. I understand broadly how it should work, but I am having some trouble with the details and can not find any tutorials. Specifically, I don't understand where I should place my job classes, and how to give the classes to my workers and start my workers. The read me only says "Getting your application underway also includes telling the worker your job classes, by means of either an autoloader or including them."

delayed_jobs vs resque vs beanstalkd?

白昼怎懂夜的黑 提交于 2019-11-28 15:10:45
Here is my needs: Enqueue_in(10.hours, ... ) (DJ syntax is perfect.) Multiply workers, concurrently. (Resque or beanstalkd are good for this, but not DJ) Must handle push and pop of 100 jobs a second. (I will need to run a test to make sure, but I think DJ can't handle this many jobs) Resque and beanstalkd don't do the enqueue_in. There is a plugin (resque_scheduler) that does it, but I'm not sure of how stable it is. Our enviroment is on amazon, and they rolled out the beanstalkd for free for who has amazon instances, that is a plus for us, but I'm still not sure what is the best option here.

Resque, Devise and admin authentication

跟風遠走 提交于 2019-11-28 04:31:48
Using Resque and Devise, i have roles for User, like: User.first.role #=> admin User.last.role #=> regular I want to setup an authentication for Resque. So, inside config/routes.rb i have: namespace :admin do mount Resque::Server.new, :at => "/resque", :as => :resque end And, of course it's accessible for all logged in users. Is there any way to use a role from User.role? It should be accessible only by users with 'admin' role. Thanks a lot. Use a route constraint, in your routes.rb file: resque_constraint = lambda do |request| request.env['warden'].authenticate? and request.env['warden'].user