I'm experiencing trouble upgrading my rails 2.3.14 / ruby 1.8.7 app to 3.1.1/1.9.2 : I have some (ActiveRecord::StatementInvalid) "Mysql2::Error: MySQL server has gone away" errors happening sporadically. It's important to precise that I never had such issues with the 'mysql' gem on 2.3.14 and the exactly same db (so the bug shouldn't come from mysql (v5.5.10)). Example : $ rails c production Load
こんばんは。最近食べ過ぎ生活がたたって2kgの体重増加を果たしてしまいました。 今回のエントリではRailsである処理を非同期に処理させるためのgem、Resqueを使ってみたのでメモします。 簡単に言うと、リクエストを受けて、レスポンスを返すまでの間で、時間のかかる重たい処理をとりあえず「あとで」処理させるということをやります。 こうすることですぐに処理結果を返さなくていい処理を後で実行して、レスポンスをすぐに返すことが可能になります。 例えば、予約を受け付けて、確認のメールを送る処理などで使えそうですね。 今回はさらに一歩踏み込んで、この「あとで」処理する部分のプロセスをデーモン化してみます。 インストール&準備 Redisサーバの準備 ダウンロード wget 'http://redis.googlecode.com/files/redis-2.2.13.tar.gz' コンパイル t
このウェブサイトは販売用です! twiwt.org は、あなたがお探しの情報の全ての最新かつ最適なソースです。一般トピックからここから検索できる内容は、twiwt.orgが全てとなります。あなたがお探しの内容が見つかることを願っています!
Over at Limited Pressing, we’re using a wonderful background queue called Resque. Resque was built by Chris Wanstrath of Github fame and runs on top of Redis. It’s fantastic and I absolutely love it. If you haven’t had a chance to try it, go check it out. When setting up Resque in production, I ran into a few issues that weren’t extremely obvious to me. I ended up working through them in the end a
I set up Resque for our startup over the last few days, to put some log analysis stuff in the background. It was harder than I thought it should be, largely due to a lack of documentation for compatibility with common tools like Capistrano and daemon kickoff tools. Here’s how I did it. Step 1: Install Redis. This part’s easy on OS X: I already had Redis running for some other tasks on the server,
Railsアプリケーションの中で非同期処理(バッチ処理)を実現したいことがあります。例えば、こんな場合です。 ユーザーが「送信」ボタンを押したら数千通のメールを送る。 数千通のメールを送るにはかなり時間がかかるので、その処理は後回しにして、ユーザーにはすぐにレスポンスを返したいところです。 非同期処理を行うためのRubyライブラリとしてはBackgrounDRbやdelayed_jobなどが有名ですが、もう一つ有望な選択肢としてResqueというのがあることを最近知りました。 と言っても、私が知らなかっただけで、RubyGems.orgによれば11万回以上もダウンロードされている有名なライブラリです。昨年(2010年)1月に書かれた、あるブログ記事には詳しい評価が載っています。 以下、私の試用報告を書きます。なお、OSはUbuntu 10.04(LTS)、Railsのバージョンは3.0.5
Update 1: These instructions should work just fine for any Rack application mounted in Rails 3. Update 2: After talking to José Valim about this, it turns out that in the latest Device (1.1rc2 and up) you can also do this in the routes file, like this: Update 3: If you’re having problems with the Resque web interface static assets you’ll need to either copy or symlink them from the gem to your app
これとこれの続き。この後、もう少し調査して、Resqueを実際のシステムの一部で使い始めてみたのでその感想とメモ。 前回までのあらすじ Resqueはバックグラウンドでジョブの実行をするもので、かなりの大規模サイトでかつ更新系の処理が多そうなシステムであるGithubで開発され使われている。よくある使い方としては、「Web UIを軽く見せるため、処理の依頼だけを受け付け、実際の処理はバックグラウンドで実行」「バッチ処理などで、大量のJobをQueueに突っ込んでおいて、(複数の)workerで並列で効率よく処理」などがある。 不安なところ Resqueの大きな特徴は、QueueをRDBMSではなくRedis上に作るところにある。Redisは、Memcacheのようにシンプルに使え、すべてのデータはメモリ上に展開されるのでとても速く、データはディスク上にも永続化されるので、何かあったときにも
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く