画像サーバのリクエスト分散にnginxのロードバランサを検討しています。
CentOS 6.9
nginx 1.10
運用するサーバはVPSを検討しており、現在はconoha VPSの 2Gプランを使用しています。
SSLに対応する必要があるのでこのような設定で、一応稼働はできているようです。
/etc/nginx/conf.d/balancer.conf upstream backends { server img1.example.com:443; server img2.example.com:443; } server { server_tokens off; listen 80; listen 443; ssl on; server_name img.example.com; ssl_certificate /home/hoge/live/cert.pem; ssl_certificate_key /home/hoge/live/privkey.pem; location / { proxy_pass https://backends; } }
稼働させるとタイムアウトになったのでfile-maxの値を変更してみました。
# cat /proc/sys/fs/file-max 320000
それでもエラーがでますので、nginx.confで
worker_rlimit_nofile 204800;
worker_connections 4096;
を設定してみましたが、それでも処理が追いつかないようでした。
nginx/error.log 2017/07/02 12:40:15 [error] 17762#0: *18772 upstream timed out (110: Connection timed out) while reading upstream, client: [IP], server: [SERVER], request: "GET /test.gif HTTP/1.1", upstream:
/etc/nginx/nginx.conf user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; worker_rlimit_nofile 204800; # Load dynamic modules. See /usr/share/nginx/README.dynamic. include /usr/share/nginx/modules/ *.conf; events { worker_connections 4096; }
そもそもサーバのスペックが足りてないか、設定が悪いのか、もしくは両方かもしれませんが、
1000req/secを処理するにはどれぐらいのスペック用意して、
どのような設定をすればよいかご教示頂けませんでしょうか。よろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/07/02 07:59
2017/07/02 08:13
退会済みユーザー
2017/07/02 08:23
2017/07/02 08:42
退会済みユーザー
2017/07/02 08:58
2017/07/02 09:08
2017/07/03 10:20