This account is not set to public on notestock.
This account is not set to public on notestock.
現状は下記のようなパラメータで、web=1 worker=0。Redisへのコネクションは14程度、webのswapは150MB程度。 https://mastodon.zunda.ninja/media/cu2VgrMzXQX3yxRISP8
パラメータを書き忘れたw
Puma
- DB_POOL: 5
- MAX_THREADS: 3
- WEB_CONCURRENCY: 1
Sidekiqはweb dynoで動かす
- RUN_WORKER: true
- SIDEKIQ_THREADS: 1
Rack-timeout
- WAIT_TIMEOUT: 90
- SERVICE_TIMEOUT: 90
$ heroku config:set WEB_CONCURRENCY=2 MAX_THREADS=2 DB_POOL=3 SIDEKIQ_THREADS=2 SERVICE_TIMEOUT=180 RUN_WORKER=false
$ heroku ps:scale worker=1
こうしてみました
Puma
- DB_POOL: 3
- MAX_THREADS: 2
- WEB_CONCURRENCY: 2
Sidekiqはworker dynoで動かす
- RUN_WORKER: false
- SIDEKIQ_THREADS: 2
Rack-timeout
- WAIT_TIMEOUT: 90
- SERVICE_TIMEOUT: 180
現状のProcfileはhttps://github.com/zunda/mastodon/blob/1f7499d3ae4006a86dbdf742b1f0071f7e75ff87/Procfile
web: [ "$RUN_STREAMING" != "true" ] && puma -C config/puma.rb & [ "$RUN_WORKER" == "true" ] && sidekiq -c ${SIDEKIQ_THREADS:-5} & [ "$RUN_STREAMING" == "true" ] && npm start & wait
worker: sidekiq -c ${SIDEKIQ_THREADS:-5}
release: if [ "$RUN_STREAMING" != "true" ]; then rake db:migrate; else echo Not migrating on this app; fi
Hobby dynoが1台から2台になったので1ヶ月放置すると$7/月費用が増します。まあバルスの時だけにしておく。
Redisのコネクション数は19に増えました。足し算できないけどそんなものかな?Postgresは下記。コネクション数が思ったより少ないね。
$ heroku pg:info
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 8/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 269.6 MB
Tables: 35
Rows: 600026/10000000 (In compliance) - refreshing
うん。ローカルなアカウントがアップロードしたメディアファイルはweb dynoで処理されててリモートからのトゥートにひっついてるメディアファイルはworker dynoで処理されてる (って前にも確かめたよな)
そうそう、rack-timeoutのservicetimeoutはリモートアカウントのタイムラインとってくるのにタイムアウトしちゃわないように2倍にしました。スレッド専有されるよりタイムアウトしてデータベース接続がリークしちゃう方を防ぎたい。
This account is not set to public on notestock.
web dynoはPuma 2プロセスx2スレッドで383 MB、worker dynoはSidekiq 2スレッドで218 MB程度のRAMを使ってます。
ふに
method=GET path=/api/v1/timelines/public format=*/* controller=Api::V1::Timelines::PublicController action=show status=200 duration=32347.37 view=3431.63 db=28147.25
スケール戻すよー
$ heroku config:set WEB_CONCURRENCY=1 MAX_THREADS=3 DB_POOL=5 SIDEKIQ_THREADS=1 RUN_WORKER=true
$ heroku ps:scale worker=0
SERVICE_TIMEOUT=180はこのままで。
コネクション数はスレッド数を減らした (Puma: 2x2→1x3、Sidekiq 1x2→1x1) 分くらい減りました。
$ heroku pg:info
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 5/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 269.8 MB
Tables: 35
Rows: 600025/10000000 (In compliance)
なんだか良さげな変更がありますねw
3b60832214fdd9d8b5fd01e9a177a6dde5259907
New error page graphic. Other error page improvements
Internal Server Errorのページを早く見たくてデプロイしようとしたらHerokuさんからInternal Server Errorもらっちゃいました。 (2回目は成功)
$ heroku pipelines:promote -a zundan-mastodon-experiment
Fetching app info... done
Fetching apps from zundan-mastodon... done
Starting promotion to production... done
Waiting for promotion to complete... !
▸ Internal server error.
\ますたーに/ \追随しますたー/
Merged tootsuite/mastodon at b32a1d575469aeb3d74da93d861b77df55715e1b.
これ!これ!これ見て!! 気に入った!! https://mastodon.zunda.ninja/500.html
I just love the new 500 page! https://mastodon.zunda.ninja/500.html
うちのルータもプロバイダもv6対応してるんだよな。家の中のサーバの安全を確保したらv6有効にできるんだよな。そこが大変なんだよな。
まんなか辺でスケールを元に戻しました。その後トラッフィクが増えてるのはいろいろトゥートしてたからだろうな。 https://mastodon.zunda.ninja/media/J3JXOgP29udRtcU6s-o
おー、404もアニメになってるw https://mastodon.zunda.ninja/404
Fail Mastodonも好きだったんだけどな、どこかに残ってないかなw
バルス試験用のMastodonインスタンスを複数作ってその中でやりとりさせるしかないのかな。S3付けなかったらそんなに手間じゃないかな
@hyuki0000 ナルホド! って思ったけどテレホーダイのころもう日本に居なかったっぽいです。なんてこった。
$ heroku pg:info
~ $ heroku pg:info -a zundan-mastodon=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 6/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 270.0 MB
Tables: 35
Rows: 600049/10000000 (In compliance) - refreshing
Puma 3スレッド、Sidekiq 1スレッド、Streaming 2スレッドくらいかな?
This account is not set to public on notestock.
インスタンス情報のキャッシュを更新してたのかな。ならしょうがない。
at=error code=H12 desc="Request timeout" method=GET path="/api/v1/instance" host=mastodon.zunda.ninja dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https
普通のリクエストなら1 req/secくらいは耐えられるっぽい(99パーセンタイルで接続待ち時間が45msec) https://mastodon.zunda.ninja/media/fJnj77cNWsO9PLns_Zs
@hyuki ちょっと調べてみたら攻撃かどうかはまだわかっていない感じでした。訂正しまっす。すみません。
https://haydenjames.io/io-tld-dns-issues-day-without-cloudflare/ によると、.io TLDの権威サーバのひとつが誤った回答をしていた時期があったとのことです。
This account is not set to public on notestock.
This account is not set to public on notestock.
This account is not set to public on notestock.
This account is not set to public on notestock.