0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

リバースプロキシで重いコンテンツを扱う

Posted at

はじめに

  • って愚かしいったらありゃしないって話。
  • 普通はCDNとかでキャッシュさせたりするが、しなかったときにどれぐらいの影響が出るか知らんかったので、軽くテストした。

構成

  • client(ab) --> nginx --> apache
  • それぞれが別のH/W上にある
  • apacheには2つのコンテンツを搭載
    • target.json - 1.4k
    • 5000x5000.png - 73k

結果(リバプロあり)

png json
Time taken for tests 46.559 seconds 6.794 seconds
Requests per second 214.78 [#/sec] (mean) 1471.94 [#/sec] (mean)
Time per request 1163.963 [ms] (mean) 169.844 [ms] (mean)
Transfer rate 15544.74 [Kbytes/sec] received 2278.34 [Kbytes/sec] received

結果(リバプロなし)

png json
Time taken for tests 23.685 seconds 3.520 seconds
Requests per second 422.21 [#/sec] (mean) 2840.85 [#/sec] (mean)
Time per request 592.128 [ms] (mean) 88.002 [ms] (mean)
Transfer rate 30573.23 [Kbytes/sec] received 4508.18 [Kbytes/sec] received

ちゃんとキャッシュしよう

  • リバプロって、サーバからのデータ転送を2回やってるわけなのだから、リソースを倍使ってるって思った方がいい。
  • そこに重いコンテンツを載せようもんなら、更にプロセスを握っちゃうのでスループットも上がらなくなる。
  • 何も良いことがない。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?