サイトの読み込み時間が極端に遅い場合の解決方法

CSSの最適化、プラグインの削除、リダイレクトの排除など、読み込み速度を向上させるためにできることはすべて試してきましたが、どうやら主な原因は以下の2つだそうです:

mobile_4-randomcharacters-.css(normalize.css と Pikaday を含み、モバイル環境で1.5秒で読み込まれる)
および
/assets/ember_jquery-randomcharacter-.js(モバイル環境で3.6秒で読み込まれる)

読み込み時間が最も長いこれらのファイルについて、どう対処すればよいのか見当もつきません。

デスクトップでの読み込みはより速いものの、まだ十分ではありません。
サーバーは、アメリカの専門サーバーで、1 CPU、2 GB RAM、50 GB SSD、2 TB の帯域幅を備えています。
Unicorn ワーカーが2つ稼働していますが、CPU も RAM も過負荷ではなく、ユーザー数やプラグインもあまりありません。
何かアイデアはありますか?よろしくお願いします。

測定は https://developers.google.com/speed/pagespeed/insights/ を使用して行いました。

「いいね!」 1

Those are static assets, and to optimize delivery of those you should Enable a CDN for your Discourse

「いいね!」 4

thank you, PageSpeed Insights says the CPU time (not delivery time) specifically for the second asset was almost 4 seconds, will a CDN like fastly still help with that? I currently use cloudflare with caching, is there a tweak on cloudflare I should use or just add something like fastly on top?!

That is indeed a big asset that will take time to parse and evaluate. As Discourse is a “Single Page Application” that cost is all paid upfront when the user first arrive, and this is a trade-off of our the approach, which is focused on making all the subsequent interaction, typical of forum usage, lightweight.

There are plan for EmberJS to drop mandatory JQuery, which will reduce this payload a fair bit, but we are years away of making this transition in Discourse.

「いいね!」 2

thanks for the response, I think something must be off with my configuration, as i have never heard anyone else reporting those load times

Well, the pagespeed defaults force a Nexus 5X and a 3G connection, which even for Brazil (a third world country) is on the low end for today standards, so real world performance will depend on that.

「いいね!」 1

こんにちは、Hetzner サーバー(CPX21、3 vCPU、4GB RAM)に Discourse を新規インストールしました。このガイドを使用しています:discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub

サーバーのパフォーマンス統計上は実質的に負荷は表示されていないのに、URL の読み込みに非常に時間がかかります。シークレットウィンドウでログインしていない訪問者がアクセスしたところ、読み込みに 1.2 分を要しました。いくつかのコンポーネントはすでにキャッシュされていたにもかかわらずです。最も遅かったのは OpenSans の ttf フォントファイルで 1 分以上、その後いくつかの .js コンポーネントで 30〜45 秒かかりました。

キャッシュオプションを検討しますが、これらのコンポーネントを見るとすべてがキャッシュ可能だとは思えません。データ転送量は合計でわずか 730KB です。もし 3 つの vCPU がすべてフル稼働していたなら、より高速なサーバーへの移行も検討しますが、負荷がほとんどない状況では混乱しています。

何か他の処理を待ってから先に進んでいるものがあるのでしょうか?サーバー内でテストを実行して、データベースなどのコンポーネントの健全性を確認する方法はありますか?
Docker が処理を遅くしている可能性はありますか?

「いいね!」 1

私も同じ問題を抱えています。
Ubuntuにクリーンインストールし、2コア4GB RAM、Cloudflareキャッシュを使用しても、読み込みが非常に遅いです。

app.ymlの設定はデフォルトで、db_shared_buffers: "1024MB" UNICORN_WORKERS: 4となっています。

それでも読み込みが遅く、これは正常ではありません。これを修正するために調整すべき設定は何ですか?

HtopのSSはサーバーの問題ではないようです。

ミニプロファイラーの統計情報を共有する価値があるかもしれません

こちらも参照してください
Discourseのインストールがどんどん遅くなっています
.