Skip to content

Cloud Run 化#2

Open
kaiinui wants to merge 1 commit into
mainfrom
feature/cloud_run
Open

Cloud Run 化#2
kaiinui wants to merge 1 commit into
mainfrom
feature/cloud_run

Conversation

@kaiinui

@kaiinui kaiinui commented Dec 24, 2021

Copy link
Copy Markdown

(PULL_REQUEST_TEMPLATE なかったのでベタ書きします ><)

やったこと

  • 有志が Cloud Run 用に Dockerfile にしていたのをそのまま転用
  • ただし Cloud Run 化に伴い, datastore のキャッシュを消しました。
    • Cloud Run の Service Account に Datastore Read/Write 権限をつければいいだけなので簡単な気もしますが。Googlebotの挙動を考えるとキャッシュが必要ないようにも思えたので。
    • ここは明確に認識している破壊的な変更です。

検証

自分の project にデプロイして検証しました。

スクリーンショット 2021-12-24 16 56 21

curl https://rendertron-nwc75huctq-an.a.run.app/render/https://teller.jp/ で中身の入った HTML がとれることも確認済み。

Bench

dev/rendertron [main] > ab -n 100 https://rendertron-nwc75huctq-an.a.run.app/render/https://yahoo.co.jp/
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking rendertron-nwc75huctq-an.a.run.app (be patient).....done


Server Software:        Google
Server Hostname:        rendertron-nwc75huctq-an.a.run.app
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-ECDSA-CHACHA20-POLY1305,256,256
Server Temp Key:        ECDH X25519 253 bits
TLS Server Name:        rendertron-nwc75huctq-an.a.run.app

Document Path:          /render/https://yahoo.co.jp/
Document Length:        195435 bytes

Concurrency Level:      1
Time taken for tests:   339.436 seconds
Complete requests:      100
Failed requests:        99
   (Connect: 0, Receive: 0, Length: 99, Exceptions: 0)
Total transferred:      19521797 bytes
HTML transferred:       19479485 bytes
Requests per second:    0.29 [#/sec] (mean)
Time per request:       3394.358 [ms] (mean)
Time per request:       3394.358 [ms] (mean, across all concurrent requests)
Transfer rate:          56.16 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       57   63  13.4     61     187
Processing:  3087 3331 256.8   3276    5165
Waiting:     3066 3303 255.4   3238    5137
Total:       3148 3394 257.9   3335    5225

Percentage of the requests served within a certain time (ms)
  50%   3335
  66%   3388
  75%   3452
  80%   3479
  90%   3658
  95%   3793
  98%   4210
  99%   5225
 100%   5225 (longest request)

Related Issue

https://github.com/filmapp/teller-server/issues/3497#issuecomment-1000704937

@kaiinui
kaiinui requested a review from tomoemon December 24, 2021 07:58
@kaiinui

kaiinui commented Dec 24, 2021

Copy link
Copy Markdown
Author

効用としては、費用削減というより、Billing Instances の仕様を確かめたい (純粋に、TELLER の frontend instances にいくらかかっているのかがわかる) のが比重が大きいです。

前回の議論通り、Active Instances 8~10台 (20万くらい?) => 10xで減るかなぁという期待もあります。

@kaiinui

kaiinui commented Dec 24, 2021

Copy link
Copy Markdown
Author

TELLERだと、非同期フェッチが多くて結構レンダリングに時間かかりますね

dev/rendertron [main*] > ab -n 10 https://rendertron-nwc75huctq-an.a.run.app/render/https://teller.jp/ 
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking rendertron-nwc75huctq-an.a.run.app (be patient).....done


Server Software:        Google
Server Hostname:        rendertron-nwc75huctq-an.a.run.app
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-ECDSA-CHACHA20-POLY1305,256,256
Server Temp Key:        ECDH X25519 253 bits
TLS Server Name:        rendertron-nwc75huctq-an.a.run.app

Document Path:          /render/https://teller.jp/
Document Length:        232395 bytes

Concurrency Level:      1
Time taken for tests:   69.485 seconds
Complete requests:      10
Failed requests:        8
   (Connect: 0, Receive: 0, Length: 8, Exceptions: 0)
Total transferred:      2330479 bytes
HTML transferred:       2326239 bytes
Requests per second:    0.14 [#/sec] (mean)
Time per request:       6948.459 [ms] (mean)
Time per request:       6948.459 [ms] (mean, across all concurrent requests)
Transfer rate:          32.75 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       58   73  21.8     63     127
Processing:  5589 6875 1148.0   7147    8728
Waiting:     5561 6846 1148.7   7122    8699
Total:       5653 6948 1142.2   7242    8790

Percentage of the requests served within a certain time (ms)
  50%   7242
  66%   7622
  75%   7884
  80%   8206
  90%   8790
  95%   8790
  98%   8790
  99%   8790
 100%   8790 (longest request)

Comment thread config.json
"cacheMaxEntries": -1
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

意図的に消してるとのことなんですけど、ここが SEO 的にわりと微妙なところなので、最初は以前の仕様の通りの方が良いかなと考えています。

というのも、Googlebot が1サイトに対してクロールできる時間が限られているという前提(SEOチームの見解ではそういう認識だった気がします)で考えると、キャッシュがない状態では古いページであっても1ページをクロールするのに毎回10秒ずつかけることになり、他の新しいページをクロールする時間がなくなって、結果的にクロール対象となるページが少なくなる、という懸念があります。

実際、そういった理由で後からキャッシュを入れて、その後クロール対象になるページが増えていたはずです(ログ確認しておきます)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants