txxxxc / isucon11-qualify

0 stars 0 forks source link

nginx周りをええ感じにチューニングする #24

Open txxxxc opened 2 months ago

txxxxc commented 2 months ago

一旦デプロイのスクリプトをもっといい感じに書いてみたい

txxxxc commented 2 months ago

一旦かけました。 git pullして再起動周りを全部できました。

txxxxc commented 2 months ago

rate-limitかけてみましょう

txxxxc commented 2 months ago

てか、普通にローカルでbench回せるようにしたくないか???

txxxxc commented 2 months ago

てかその前にファイルディスクリプタ足りてなかった説があるので、それだけ確認します。

txxxxc commented 2 months ago

goのサーバーの方のfdは足りてました。 それ以外だと普通にnginxのworkerとかが足りてないというのはありそうです。

txxxxc commented 2 months ago

nginx -Tこれで設定見れるっぽいです。

txxxxc commented 2 months ago

ま? https://stackoverflow.com/questions/37591784/nginx-worker-rlimit-nofile

worker_rlimit_nofile = worker_connections * 2 file descriptors

いうて定かではないらしい

txxxxc commented 2 months ago

a client request body is buffered to a temporary file /var/lib/nginx/body

これなに?

txxxxc commented 2 months ago

なんか色々あるっぽい。まあファイルに書き込まれたらI/Oで時間かかりそうだからええ感じに改善したいね

txxxxc commented 2 months ago

nginxのmaster processは何をやってるんや

txxxxc commented 2 months ago

はい Nginxのアーキテクチャを理解する #nginx - Qiita

txxxxc commented 2 months ago

workerとかを管理してるやつってことね

txxxxc commented 2 months ago

てか、nginxのworkerも一つしか建ってないし、goのfdも問題なさそうやから何が悪いのかあまり分からんですね

txxxxc commented 2 months ago

本格的にインスタンスが弱弱だから説出てきた。もう一回topで確認してみましょう

txxxxc commented 2 months ago

一旦htop勉強してみるか https://github.com/takeshi-aihana/htop_explained/blob/master/README-ja.md

txxxxc commented 2 months ago

benchのときに100%なってるのはまずくないか?とかは思ってる

後普通に100%超えてそうではある

image
txxxxc commented 2 months ago

rate-limitがソリューション化怪しくなってきた

txxxxc commented 2 months ago

なんかcpu1個やし練習台としてあまり良くない気はしてきた