resque

Rails Resque workers fail with PGError: server closed the connection unexpectedly

99封情书 提交于 2019-11-28 04:24:29
I have site running rails application and resque workers running in production mode, on Ubuntu 9.10, Rails 2.3.4, ruby-ee 2010.01, PostgreSQL 8.4.2 Workers constantly raised errors: PGError: server closed the connection unexpectedly. My best guess is that master resque process establishes connection to db (e.g. authlogic does that when use User.acts_as_authentic), while loading rails app classes, and that connection becomes corrupted in fork()ed process (on exit?), so next forked children get kind of broken global ActiveRecord::Base.connection I could reproduce very similar behaviour with this

Best Ruby on Rails Architecture for Image Heavy App

一笑奈何 提交于 2019-11-28 03:36:45
I'm building an application that allows for large amounts of photo uploads at once, and wanted to know what the best setup would be to tackle this. This is what I am using so far: Jquery File Upload: allows users to drag and drop images CarrierWave: Processes images and resizes them with ImageMagick Amazon S3: CarrierWave uploads images to Amazon S3 through Fog Heroku: for hosting I'd like to allow users to be able to drag and drop a large amount of images onto a page, and then navigate to other pages while the upload is going on in the background. I'd also like pictures to appear as they

How to deploy resque workers in production?

僤鯓⒐⒋嵵緔 提交于 2019-11-28 02:55:46
The GitHub guys recently released their background processing app which uses Redis: http://github.com/defunkt/resque http://github.com/blog/542-introducing-resque I have it working locally, but I'm struggling to get it working in production. Has anyone got a: Capistrano recipe to deploy workers (control number of workers, restarting them, etc) Deployed workers to separate machine(s) from where the main app is running, what settings were needed here? gotten redis to survive a reboot on the server (I tried putting it in cron but no luck) how did you work resque-web (their excellent monitoring

How do I clear stuck/stale Resque workers?

≡放荡痞女 提交于 2019-11-28 02:36:54
As you can see from the attached image, I've got a couple of workers that seem to be stuck. Those processes shouldn't take longer than a couple of seconds. I'm not sure why they won't clear or how to manually remove them. I'm on Heroku using Resque with Redis-to-Go and HireFire to automatically scale workers. None of these solutions worked for me, I would still see this in redis-web: 0 out of 10 Workers Working Finally, this worked for me to clear all the workers: Resque.workers.each {|w| w.unregister_worker} In your console: queue_name = "process_numbers" Resque.redis.del "queue:#{queue_name}

Optimising concurrent ImageMagick Requests using redis/php-resque

早过忘川 提交于 2019-11-28 01:54:18
问题 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

Node.js workers/background processes

不羁的心 提交于 2019-11-27 17:15:41
How can I create and use background jobs in node.js? I've come across two libs (node-resque and node-worker) but would like to know if there's something more used. Alfred I did some research on this and I would do it like this. Setup beanstalkd Install beanstalkd . Another message queue, BUT this one supports DELAYED PUTS . If you compile from source it is going to be a little harder because it depends on libevent (like memcached). But then again, I don't think you have to compile it from source, because there are a lot of binary packages available. For example on Ubuntu you can install

Postgres error on Heroku with Resque

耗尽温柔 提交于 2019-11-27 13:54:12
问题 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

Resque vs Sidekiq? [closed]

和自甴很熟 提交于 2019-11-27 10:09:09
I am currently using Resque for my background process but recently I heard a lot of huff-buff about sidekiq . Could anybody compare/differentiate? In particular I would like to know is there a way to monitor programmatically whether a job is completed in sidekiq Resque: Pros: does not require thread safety (works with pretty much any gem out there); has no interpreter preference (you can use any ruby); Resque currently supports MRI 2.3.0 or later loads of plugins. Cons runs a process per worker (uses more memory); does not retry jobs (out of the box, anyway). Sidekiq: Pros runs thread per

delayed_jobs vs resque vs beanstalkd?

元气小坏坏 提交于 2019-11-27 09:04:10
问题 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

Resque, Devise and admin authentication

你说的曾经没有我的故事 提交于 2019-11-27 05:22:13
问题 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. 回答1: Use a route constraint, in your routes.rb file