Railsのサイトは重いと思われていませんか? また、マシンパフォーマンスが必要だと思っていませんか? 必ずしもそうではないのです。 とは言ってもRailsで全てのコンテンツを毎回作成してはコストがかかってしまいます。 そこで今回は毎回動的にページを生成するのではなく、キャッシュを利用してRailsへの負荷を減らす事を考えます。 ★処理の流れが変わる Rails自身にもキャッシュ機能はあるのですが、今回紹介するのはApacheでキャッシュするmod_cacheというモジュールです。 現在フォアフロントで構築しているRuby on Railsの環境では、HTTP(S)のリクエストは Apache → mod_proxy,mod_proxy_balancer → mongre という流れで処理を行っています。 mod_cacheを利用する場合には Ap
勤めていた会社を辞めたのですが、バイトに誘われてしまい。 軽くOK出しちゃいましたw そっしたら、当初は聞いていなかったApacheのチューニングをするハメに!! んなのやったこと無いから!てか俺で良いんか!?やるよ?やっちゃいますよw てな感じでやってみました。 最初はモジュール追加するぐらいだろうと思ってたんですが、 これが手強かった。。。 今回はアクセス数の突発的な増加が良くあるサイトが対象なので、同時アクセス が高くても耐えられる形を望まれました。 で、基本はリクエストがあった場合にはPHPの処理が走るのですが、PHPでは無くて、キャッシュを返すようにして負荷を下げようという方針にしました。 (このPHPが曲者で凄い重いんですよ。。。色んなとこみてますんで) で、やった事 1)モジュール追加 apacheのモジュール参照先にmod_cache.soとmod_disk_cache.s
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く