icon

Running rate: $14/month out of my pocket. Let's see how far I can keep this.

icon

@zundan @t_trace 高いよっえ警告されてた某ヘ社で自腹なので早晩力尽きるかもですw

icon

Tusky seems to be easy to use :)

icon

@t_trace ぼっちインスタンス、今のところ、Herokuの無料Postgres、Redisでなんとか動いているようです。Dyno(サーバ)はいちばんちっちゃいの2つで、ドメインを除いて合計$14/月かかってます。フォロワ/フォロー数に応じてサーバへの負荷とPostgresの容量が増えてくるだろうな、と想像してます。あと、ファイル置き場としてS3を使ってます。こちらへのアクセスは僕の利用頻度で決まりそうなので無料枠内で続けられるんじゃないかと想像してます。

icon

増えてきた

$ heroku pg:info
=== DATABASE_URL
Plan: Hobby-dev
Status: Available
Connections: 11/20
PG Version: 9.6.1
Created: 2017-04-15 01:28 UTC
Data Size: 9.5 MB
Tables: 26
Rows: 94/10000 (In compliance)

icon

@t_trace 生AWSだとヘ社分のコストは浮くはずなので、ちょうどいい大きさのインスタンスがあれば安く済むかもです。※Postgresの障害対応などはヘ社にお任せいただければスケールメリットもあって自前で対応するよりだいぶ必要なリソースが少ないと思うのであまり手間をかけたくない場合はぜひご利用くださいw

2017-04-14 20:48:20 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-14 23:04:29 zundaの投稿 zundan@mastodon.zunda.ninja
icon

@usa バックグラウンド (Redis) で非同期に情報やりとりしてるような気がします(未確認)

icon

I wonder if `ostatus` was better than `mstodon` as the hostname. It's already little bit too late to change anyways :)

2017-04-15 08:48:47 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Still working healthy with hobby dynos and a Hobby-dev Heroku Postgres.

$ heroku pg:info
=== DATABASE_URL
Plan: Hobby-dev
Status: Available
Connections: 11/20
PG Version: 9.6.1
Created: 2017-04-15 01:28 UTC
Data Size: 9.9 MB
Tables: 26
Rows: 338/10000 (In compliance) https://mastodon.zunda.ninja/media/Qg1oIetDRfir9srTNXs

Attach image
icon

It's interesting to see added accounts on this instance with me remote-following accounts on other instances.

icon

ぼっちインスタンスはFederated timelineが静かなのがぼっち

icon

S3もみとかないとね

icon

@hyuki0000 https://mastodon.zunda.ninja/ をシングルユーザーモードで稼働させてみております

2017-04-16 04:26:45 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-16 13:01:58 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Current status of mastodon.zunda.ninja:

$ heroku pg:info
=== DATABASE_URL
Plan: Hobby-dev
Status: Available
Connections: 10/20
PG Version: 9.6.1
Created: 2017-04-15 01:28 UTC
Data Size: 10.7 MB
Tables: 26
Rows: 1189/10000 (In compliance)

Just light load on web and worker dynos.

icon

Trying again...

icon

Deploy to staging was successful on the second try :)

icon

And the production instance has been updated... and started to emit 500 errors:

$ heroku run rails db:migrate
$ heroku ps restart

2017-04-17 00:01:30 zundaの投稿 zundan@mastodon.zunda.ninja
icon

@sorah バックグラウンドで何か遅延してたのかもですねー

2017-04-17 07:00:01 zundaの投稿 zundan@mastodon.zunda.ninja
icon

@hyuki0000 メールがなくても下記でベリファイできますよ:

rails mastodon:confirm_email USER_EMAIL=<登録メールアドレス>

あと、下記で管理者に

rails mastodon:make_admin USERNAME=<登録ユーザー名>

https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Administration-gui

icon

HerokuでMastodonを動かすまでの最低限の手順をまとめてみました

https://github.com/zunda/mastodon/wiki/CreateInstanceOnHeroku

icon

Current status

$ heroku pg:info
=== DATABASE_URL
Plan: Hobby-dev
Status: Available
Connections: 11/20
PG Version: 9.6.1
Created: 2017-04-15 01:28 UTC
Data Size: 11.6 MB
Tables: 26
Rows: 2138/10000 (In compliance)

Web dyno started to show slower response time. Might this be from an elevated traffic? https://mastodon.zunda.ninja/media/RJep9ipUWZnjjWFrkaM

Attach image
icon

Seems I want to move to a Hobby-basic ($9/mo) Postgres later this week.

2017-04-17 11:25:08 zundaの投稿 zundan@mastodon.zunda.ninja
icon

@tdtds 最初に試したとき、たぶんHeroku側の問題で、Heroku Buttonが動かなかったんですよね…。後でまた試してみます。

icon

@hyuki0000 @tdtds Heroku Button使わないで作ったインスタンスはS3なしでもトゥートできてます。やっぱりHeroku Button試してみなくちゃな…

2017-04-17 16:00:11 zundaの投稿 zundan@mastodon.zunda.ninja
icon

もいっこインスタンスつくるか(そうじゃない)

icon

2017-04-18T02:14:29.920590+00:00 app[web.1]: [68902273-70ab-462c-9245-42c2bf9bc2e0] method=GET path=/.well-known/webfinger format=json controller=WellKnown::WebfingerController action=show status=500 error='NoMethodError: undefined method `to_webfinger_s' for nil:NilClass' duration=14.73 view=0.00 db=0.00

icon

I had to remove the @ prefix on my user name.

icon

@tdtds 運用する手間が増えてきたところでインスタンスは使い捨てにしてデータベースだけ持ってまわればかいけつ☆

icon

このインスタンスは月23ドルくらいになりそうな雰囲気。現在は月14ドル。Workerをスケジューラに逃したらすこし安くなるのかも。

2017-04-17 18:02:05 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-17 18:02:10 zundaの投稿 zundan@mastodon.zunda.ninja
icon

@tdtds 各クラウドに…w

icon

@tdtds めんどうになったら止めといて、動かしたくなったら最初からやり直せるのがミソなんですう

icon

@jacopen rails db:migrate で復活するかもです

2017-04-17 20:28:13 zundaの投稿 zundan@mastodon.zunda.ninja
icon

あ、はいw

icon

@jacopen じゃなくて rake db:migrate でした。お騒がせしました

2017-04-18 06:49:36 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-18 06:52:38 zundaの投稿 zundan@mastodon.zunda.ninja
icon

にゃーん

icon

Current status

$ heroku pg:info
=== DATABASE_URL
Plan: Hobby-dev
Status: Available
Connections: 11/20
PG Version: 9.6.1
Created: 2017-04-15 01:28 UTC
Data Size: 12.6 MB
Tables: 26
Rows: 3498/10000 (In compliance)

https://mastodon.zunda.ninja/media/6lFpO4ouc-B5va4IPrE

Attach image
icon

無料版Heroku Postgres、週末を前にいっぱいになりそう。

icon

S3も見とかないと

2017-04-18 08:25:43 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-18 15:04:54 zundaの投稿 zundan@mastodon.zunda.ninja
icon

インスタンスからインスタンスの状況をTootするようにしたい

icon

@hyuki デフォルトのアイコンはアプリのデプロイの時にrake assets:precompileが走ってdynoのファイルシステムに展開され、slugに書き込まれたのが見られます。んで、アプリの稼働中にアプリが取得したアイコンはS3がなければdynoのファイルシステムに追記される(と想像している)のですが、dynoが再起動された時にファイルシステムはslugの状態に戻っちゃいます。

icon

S3アドオン欲しいですよねえ…。あるいはmastodonをCloudinaryに対応させるか。

2017-04-18 15:51:43 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-18 15:51:51 zundaの投稿 zundan@mastodon.zunda.ninja
icon

フルスタックっていうと自宅にファイバー引くところから?

icon

やっぱり某ヘ社使うとフルスタックの底を浅くできてる感じがいいな

2017-04-18 15:59:48 zundaの投稿 zundan@mastodon.zunda.ninja
icon

@ikeji ウェハも作るかあw

2017-04-18 17:27:13 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Current status (もうすぐ半分や…

$ heroku pg:info
=== DATABASE_URL
Plan: Hobby-dev
Status: Available
Connections: 12/20
PG Version: 9.6.1
Created: 2017-04-15 01:28 UTC
Data Size: 13.1 MB
Tables: 26
Rows: 4104/10000 (In compliance)

2017-04-18 20:51:32 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Procfileのbundle execの有無でメモリ使用量にどれだけ差があるか確認してみたら全然差がありませんでした

bundle execのあるMastodonのweb dynoのRSSはアクセスが全くない状態で101.02 MB (1枚目)。

bundle execのないMastodonのweb dynoのRSSはアクセスが全くない状態で101.92 MB (2枚目)。

https://mastodon.zunda.ninja/media/287kI4Q1haXHsoQJqAk https://mastodon.zunda.ninja/media/PaW-93L8YAugyKhEsoQ

Attach image
Attach image
2017-04-18 23:57:20 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-18 23:59:06 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-19 07:45:36 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Current status - 半分超えましたし

$ heroku pg:info
=== DATABASE_URL
Plan: Hobby-dev
Status: Available
Connections: 12/20
PG Version: 9.6.1
Created: 2017-04-15 01:28 UTC
Data Size: 14.1 MB
Tables: 26
Rows: 5393/10000 (In compliance)

icon

HEROKU=trueならworker dynoを止められる説が浮上。やってみよう。

config/puma.rb:
:
on_worker_boot do
if ENV['HEROKU'] # Spawn the workers from Puma, to only use one dyno
@sidekiq_pid ||= spawn('bundle exec sidekiq -q default -q push -q pull -q mailers ')
end
:

web=1 worker=1ではRSSはwebは296MB、workerは223MB。CPU負荷はどちらも大したことはない。

icon

さあどうだ

$ heroku ps:scale worker=0
Scaling dynos... done, now running worker at 0:Hobby

icon

リモートにTootが届いてない感じ。

$ heroku ps:restart web.1

icon

だめぽ。

$ heroku ps:scale worker=1

icon

とどいた。config/puma.rbのコードは意図どおりに動いてないのねん。

icon

あーw 1.2になってspawnしなくなったんだ

2017-04-19 11:48:46 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Instance code has been updated to 59a7792 (1.2.2)

2017-04-19 13:48:53 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-19 14:04:36 zundaの投稿 zundan@mastodon.zunda.ninja
icon

データベースが溢れてきたら削除したくなるから!

icon

@hyuki0000 古い情報から消してくインスタンスつくれそうですねw。ちょっとstatusesテーブル覗いてみたらちゃんとcreated_atがありました。

icon

言語いろいろ検出されてた!

> select distinct(language) from statuses;
language
----------
pt
da
ar
fi
ru
de
fr
es
nl
en
hu
el
sv
no
fa
it
pl
ja
(18 rows)

2017-04-19 15:14:40 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Current status:

$ heroku pg:info
=== DATABASE_URL
Plan: Hobby-dev
Status: Available
Connections: 11/20
PG Version: 9.6.1
Created: 2017-04-15 01:28 UTC
Data Size: 14.4 MB
Tables: 26
Rows: 5789/10000 (In compliance)

icon

@ymmt Herokuでよければこんなんあります https://github.com/zunda/mastodon/wiki/UpgradeInstanceOnHeroku 手前味噌ですみませんが。

icon

増えてますよ?

heroku pg:info
=== DATABASE_URL
Plan: Hobby-dev
Status: Available
Connections: 11/20
PG Version: 9.6.1
Created: 2017-04-15 01:28 UTC
Data Size: 14.5 MB
Tables: 26
Rows: 6019/10000 (In compliance)

2017-04-19 16:26:01 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-19 17:02:04 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-19 19:45:35 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-19 20:13:15 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-19 20:20:26 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-19 23:56:11 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-19 23:57:28 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-19 23:57:49 zundaの投稿 zundan@mastodon.zunda.ninja
icon

テキストエリアの内容にいちいちGPG署名つけてポストしてくれるブラウザ拡張(字数)

icon

Current status - やばい

heroku pg:info
=== DATABASE_URL
Plan: Hobby-dev
Status: Available
Connections: 11/20
PG Version: 9.6.1
Created: 2017-04-15 01:28 UTC
Data Size: 16.1 MB
Tables: 26
Rows: 8193/10000 (In compliance, close to row limit)

icon

OK, I'll put this instance into maintenance mode in a couple of minutes to upgrade the database.

icon

This instance is now on a Heroku Postgres Hobby-basic :)

heroku pg:info
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
:
Created: 2017-04-20 18:31 UTC
Data Size: 13.8 MB
Tables: 26
Rows: 8210/10000000 (In compliance)
:
=== HEROKU_POSTGRESQL_COPPER_URL
Plan: Hobby-dev
:
Created: 2017-04-15 01:28 UTC
Data Size: 16.2 MB
Tables: 26
Rows: 8193/10000 (In compliance, close to row limit)

icon

S3に$0.01かかるよ、っていうアラートが来ましたよ。

icon

@t_trace 甘く見てました〜

icon

Current status

$ heroku pg:info DATABASE
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 11/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 15.0 MB
Tables: 26
Rows: 8236/10000000 (In compliance)

icon

Last 24 hours with the default puma process (2) and thread (5):

Web:
- Max total memory 321.1 MB
- Max response time: 255 ms median, 1,599 ms 95%
- Max throughput 21 requests/min
Worker:
- Max total memory 247.9 MB

Let's see if I can reduce total memory on the web dyno:

heroku config:set MAX_THREADS=3

icon

@t_trace なるほどなるほど

icon

@hyuki @t_trace HerokuはHobby dynoを2つとHobby-basicのPostgresで$23/月になりそうです。やっぱり高いですね…。(その分放っておけるんですけど。)Dynoを1つにできないかぼちぼち試してます。うまく行けば$7/月だけ安くなります。

2017-04-20 19:19:07 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-21 07:06:32 zundaの投稿 zundan@mastodon.zunda.ninja
icon

おっと

2017-04-21 07:14:46 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-21 07:14:47 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-21 07:38:17 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-21 07:39:01 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-21 07:39:34 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-21 07:39:35 zundaの投稿 zundan@mastodon.zunda.ninja
icon

@ms2sato 手元のぼっちインスタンスでは、pumaのスレッド数を5から3くらいに少なくしたほうがswapに突っ込んじゃうと可能性が低そうだなあと感じてます。もうすぐ確かめる!

icon

With decreased number of threads (3) on puma process (2):

Web:
- Max total memory: 286 MB
- Mat response time: 107 ms median, 735 ms 95%
- Max throughput: 15 request/min
Worker:
- Max total memory: 228 MB

Seems like I can combine two processes onto one dyno of 512 MB memory.

Plot is memory profile of the web dyno where puma threads are changed from 5 to 3 around 2017-04-21 01:00 UTC. https://mastodon.zunda.ninja/media/sTcqKyAhQbSKCz9fJ5E

Attach image
icon

https://github.com/zunda/mastodon/wiki/CreateInstanceOnHeroku に、rake mastodon:dailyをHeroku Schedulerに登録する手順を追加しました。

icon

OK. This instance is now running b1d4efc on https://github.com/zunda/mastodon/tree/zunda-ninja-on-heroku with

- heroku config:set MAX_THREADS=3
- heroku ps:scale web=1 worker=0

Let's see if the instance continue running healthy :)

Web site image
GitHub - zunda/mastodon at zunda-ninja-on-heroku
icon

Database status:

$ heroku pg:info DATABASE
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 7/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 17.4 MB
Tables: 26
Rows: 10903/10000000 (In compliance)

icon

@ms2sato ありがとうございます!

1 dynoにSidekiqを詰めようとするとpumaの2プロセス✕5スレッドでらメモリが512 MBから溢れそう、と書きたかったのでした。

こちらではアカウント1つのインスタンスが、puma 2プロセス✕3スレッドで6時間ほど稼働させてみてしてます。R14をもらうとしたらこれからかもですね…。

pumaとSidekiqを同居させるには、シェルからバックグラウンドに送る方法もありました: https://github.com/zunda/mastodon/blob/zunda-ninja-on-heroku/Procfile

Web site image
mastodon/Procfile at zunda-ninja-on-heroku · zunda/mastodon
2017-04-21 17:10:44 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-21 20:11:57 zundaの投稿 zundan@mastodon.zunda.ninja
icon

このインスタンス全然メール送ってこないのなんか変なのか…?

icon

@himamura mstdn.jpがそれ(というかきっかけの一つ)かも?

2017-04-21 21:37:02 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-21 21:38:04 zundaの投稿 zundan@mastodon.zunda.ninja
icon

にゃーん

2017-04-22 03:24:12 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Database status

$ heroku pg:info DATABASE
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 4/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 19.2 MB
Tables: 26
Rows: 13878/10000000 (In compliance)

icon

Memory use and response time on this 1-dyno instance. The dyno has been using swap but response time is not too bad. I'm grad that it has swap (Private dynos don't) https://mastodon.zunda.ninja/media/BwyZZel2WhzjrN8GiTc

Attach image
2017-04-22 16:52:49 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-22 17:21:28 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Database status

$ heroku pg:info DATABASE
=== 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: 20.1 MB
Tables: 26
Rows: 15356/10000000 (In compliance)

2017-04-22 22:12:56 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-22 23:53:39 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-22 23:55:46 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Dyno減らせた分、Stream APIに回してみようかな

2017-04-23 04:26:17 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-23 08:27:07 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Streaming?

icon

Steaming!

icon

@ms2sato プラットフォームがメンテナンスをした時にサーバを移動させる必要があったときに、DATABASE_URLとかREDIS_URLを変更しちゃうので、手作業でコピーしちゃうと接続できなくなっちゃうんですよね~。addons:attachしておけばプラットフォーム側で追随させてくれるので、あとはDynoの起動時にDyno内でバラすことになります。

2017-04-23 15:54:26 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Current database status:

$ heroku pg:info DATABASE
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 7/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 22.0 MB
Tables: 26
Rows: 17226/10000000 (In compliance)

icon

おお、TLが自動的に更新されてくの便利だな←

icon

通知も来るようになったようだ(ブロックw

2017-04-23 17:04:35 zundaの投稿 zundan@mastodon.zunda.ninja
icon

このインスタンスの台所事情をまとめました。現在$16/月ですが、アプリケーションログの容量があふれていることに対処する必要がありそうです

https://github.com/zunda/mastodon/wiki/CostConsiderationsOnHeroku

icon

あとS3が微妙に怖いw

icon

Kindleに入れといたPDF読むのつらいからマウントしてMacBookで読んでるw

icon

家サーバ、電気代が1W1月あたり$1くらいなのであんまり安く運用できない

icon

そういえばGitHubは自由なんだっけ…?

2017-04-23 23:56:46 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-24 00:11:53 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-24 06:39:51 zundaの投稿 zundan@mastodon.zunda.ninja
icon

コードいじりたいのう

icon

おだいじに?

icon

Current status on database:

$ heroku pg:info DATABASE=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 9/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 24.8 MB
Tables: 26
Rows: 20949/10000000 (In compliance)

icon

急に増えてないか?

2017-04-24 08:25:19 zundaの投稿 zundan@mastodon.zunda.ninja
icon

@mattn おっぱい

2017-04-24 15:53:26 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-24 15:53:29 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-24 15:54:20 zundaの投稿 zundan@mastodon.zunda.ninja
icon

R14もらうのImageMagickが動いてる時だった。それじゃしょうがない。

2017-04-24 17:14:54 zundaの投稿 zundan@mastodon.zunda.ninja
icon

およ。Raspberry Piのメモリ1GBあるん?なんとかなりそう…ここで512MBにはPostgreSQLを入れてないことに思い至る

2017-04-24 17:50:25 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-24 20:21:19 zundaの投稿 zundan@mastodon.zunda.ninja
icon

出張の飛行機予約するのに一番安いやつ選んだら高すぎるって言われて明日にしよう

icon

なるほど

2017-04-25 08:33:22 zundaの投稿 zundan@mastodon.zunda.ninja
icon

@hyuki Dyno 2台とHeroku Postgres Hobby-basicだと1カレンダー月あたり$7×2+$9なので5日間で$3.80くらいになりそうですねー

icon

Current database status:

$ heroku pg:info DATABASE
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 7/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 26.2 MB
Tables: 26
Rows: 22495/10000000 (In compliance)

icon

Deployed 33c46f7 from https://github.com/zunda/mastodon/tree/zunda-ninja-on-heroku . The [Procfile](https://github.com/zunda/mastodon/blob/33c46f7aec4a752270f6ad52758501cf17886951/Procfile) allows me to deploy same slug to the main app as well as the app responsible for streaming API with the following config vars:

Main app:

heroku config:set RUN_WEB=true
heroku config:set RUN_WORKER=true

App for streaming API:

heroku config:set RUN_STREAMING=true

Web site image
GitHub - zunda/mastodon at zunda-ninja-on-heroku
Web site image
mastodon/Procfile at 33c46f7aec4a752270f6ad52758501cf17886951 · zunda/mastodon
icon

and of course, no markdown here :P

icon

PGPはクリアサインでいいじゃない

icon

(何のはなしだっけ)

icon

リモートブランチを削除するよろこび

$ git push --delete origin zunda-ninja-streaming-on-heroku

icon

微妙にネットワークが切れている

2017-04-25 11:42:56 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-25 13:40:23 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-25 14:55:08 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-25 16:27:41 zundaの投稿 zundan@mastodon.zunda.ninja
icon

なかーま

icon

江副さんが出社するとぼっちインスタンスのタイムラインが止まるのでStreaming APIが動いてるのか気になる

icon

Database status on this instance:

$ heroku pg:info DATABASE
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 7/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 27.1 MB
Tables: 26
Rows: 23971/10000000 (In compliance)

icon

じゃないよ江添さんだよ。失礼しました

icon

:set spellした瞬間まっピンクになる端末

icon

source=REDIS_URL sample#num_connections_over_limit=0 message=Database connections over limit. Please upgrade your database plan.

Oops

icon

Lindowsなつかしす

2017-04-25 19:00:23 zundaの投稿 zundan@mastodon.zunda.ninja
icon

久しぶりにこういうの見た♪

Attach image
2017-04-25 19:43:16 zundaの投稿 zundan@mastodon.zunda.ninja
icon

もうすぐリリース?wktk って作業する時間あるんかいな

icon

ってどこで見たんだっけ…

icon

Finally, I'm going ahead to remove the account and factory reset my Nexus 5 I broke the other day. It was a good device (-人-)

Attach image
icon

Data on this instance:

$ heroku pg:info DATABASE
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 7/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 28.6 MB
Tables: 26
Rows: 26723/10000000 (In compliance)

icon

Puma and sidekiq are using slightly more memory than it should be using. Let's see what happens when moving from cedar-14 to heroku-16.

$ heroku stack:set heroku-16
Stack set. Next release will use heroku-16.
Run git push heroku master to create a new release https://mastodon.zunda.ninja/media/p8VR4hUvvRlfHHnz7VM

Attach image
icon

Well, promotion on the pipeline did not update the stacks.

2017-04-26 08:28:47 zundaの投稿 zundan@mastodon.zunda.ninja
icon

$ git push heroku zunda-ninja-on-heroku:master
$ heroku stack
=== Available Stacks
* heroku-16
cedar-14

Yup. Did the same thing for the app for streaming API :)

icon

$ sudo sync;sudo sync;sudo sync;sudo reboot
(-人-)

icon

Somewhere I learnt that `sync` does not need `sudo` to sync everything on the machine but I forgot where and I'm not sure if this is correct.

icon

It seems that Mastodon (puma+sidekiq) consumes less memory on Herku-16 (Ubuntu 16.04; switched at v47 in the plots) than on Cedar-14 (Ubuntu 14.04). https://mastodon.zunda.ninja/media/CRXvtvRGPJBAp_S5EA0

Attach image
2017-04-26 11:46:00 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-26 11:46:02 zundaの投稿 zundan@mastodon.zunda.ninja
icon

大きいインスタンス運用する経験してみたいけど時間もお金もないんだよね

2017-04-26 12:44:49 zundaの投稿 zundan@mastodon.zunda.ninja
icon

自分がログインしているインタンスのアカウントをリモートフォローするのに手間がかかる。

https://インスタンス/users/アカウント/remote_follow を閲覧して手続きを進める。

icon

@ykzts おおお! と思ったのですが、自インスタンスが対象のアカウントを知らない時には検索結果にあらわれないんですよね。

icon

@ykzts なんと。次の機会に試してみます。

2017-04-26 14:01:30 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-26 14:01:34 zundaの投稿 zundan@mastodon.zunda.ninja
icon

@ykzts 出てきました! 少しラグがあるようですね。リモートに問い合わせに行ってるんだろうな。

2017-04-26 15:22:10 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-26 15:22:12 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Data on this instance:

$ heroku pg:info DATABASE
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 7/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 29.0 MB
Tables: 26
Rows: 26900/10000000 (In compliance)

2017-04-26 16:13:16 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-26 16:18:08 zundaの投稿 zundan@mastodon.zunda.ninja
icon

他のインスタンスのメディアのURL書いても絵に展開されないのを発見 https://admins.mstdn.social/@zundan/541

icon

どんどん増えるMastodonアカウントだどん http://zunda.freeshell.org/contacts.html

icon

@kojira たぶん zundan@mastodon.zunda.ninja に送っていただけると把握できる可能性が一番たかいです。他はログインしてなかったりブラウザ開いてなかったりすることが多いです。

icon

@kojira ですねー。インスタンスからweb socketつないどく必要がありそうなので、クライアント側に実装する感じになりそうですね…とか思うとマルチインスタンスに使えるクライアントアプリにたどりついちゃいそう。

icon

Comparison of memory use between Heroku's Cedar-14 stack (Ubunt 14.04; left) and Heroku-16 stack (Ubuntu 16.04; right) on this instance with single account running Puma (2 workers with 3 threads) and Sidekiq. Decreases in swap use after a peak seem to be different between stacks. https://mastodon.zunda.ninja/media/9brhqRf0Sz8HbU75F6M

Attach image
icon

DockerでMastodon入れられる環境どっか、

icon

Kubernetesでも入れてみたい(おおげさ)

icon

AWS無料期間中にいろいろ遊んでみるべきなんだろうなあ

icon

Current status:

heroku pg:info DATABASE
=== 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: 29.7 MB
Tables: 26
Rows: 28009/10000000 (In compliance)

2017-04-26 20:45:46 zundaの投稿 zundan@mastodon.zunda.ninja
icon

にゃーん

icon

Ah, OK, I should retain DB_POOL at, say, 5:

ActiveRecord::ConnectionTimeoutError: could not obtain a connection from the pool within 5.000 seconds

$ git grep DB_POOL
config/database.yml: pool: <%= ENV["DB_POOL"] || ENV['MAX_THREADS'] || 5 %>
$ heroku config:set DB_POOL=5

2017-04-27 09:18:08 zundaの投稿 zundan@mastodon.zunda.ninja
Merged ebbbcfe, a release candidate for v1.3. Seems to be working on this instance?
icon

$ git pull upstream
$ git rebase upstream/master
$ git rev-parse master
ebbbcfef1c805efbf0c6b80e4e9f1d7bcddba2ba
$ git checkout zunda-ninja-on-heroku
$ git merge master
$ git push
$ git checkout master
$ git push

Merged ebbbcfe, a release candidate for v1.3. Seems to be working on this instance?
icon

and this instance is on 833ae4f in zunda-ninja-on-heroku branch.

icon

It seems that replying to a CW toot posted the original toot without the reply.

icon

how about replying to a normal toot?

2017-04-27 11:31:39 zundaの投稿 zundan@mastodon.zunda.ninja
icon

更新しようと思ったらHerokuさん… https://status.heroku.com/incidents/1141

2017-04-27 11:43:37 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Deployed the branch with a39e719b392f2a2de3415850ff04deeefd3e8742 from upstream/master merged.

icon

Current status:

$ heroku pg:info DATABASE
=== 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: 31.2 MB
Tables: 26
Rows: 30457/10000000 (In compliance)

icon

テレヒでニジヤのコマーシャルやってるのなんでだろな

2017-04-28 07:21:44 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-28 07:26:33 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-28 07:30:02 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-28 07:39:28 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-28 07:41:54 zundaの投稿 zundan@mastodon.zunda.ninja
icon

The spike in throughput as well as response time seems to correspond to a spike in requests to `/users/zundan.atom` from various IP addresses. Might there be a bot network or something? https://mastodon.zunda.ninja/media/Y0r0h__al0tPdKlXNEw

Attach image
icon

Database status:

$ heroku pg:info DATABASE
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 13/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 31.8 MB
Tables: 26
Rows: 31751/10000000 (In compliance)

2017-04-28 09:55:08 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-28 10:20:59 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Merged a823509 from upstream to the code this instance is running on. Let's see how it runs :)

2017-04-28 10:42:20 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-28 12:57:05 zundaの投稿 zundan@mastodon.zunda.ninja
icon

今日は東京まで189 ms。ちょっと遠くなった。

icon

$ heroku pg:info DATABASE
=== 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: 32.3 MB
Tables: 26
Rows: 31927/10000000 (In compliance)

2017-04-28 19:55:05 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-29 02:02:46 zundaの投稿 zundan@mastodon.zunda.ninja
icon

やっぱりそういうのあるんだ!(このインスタンスはPurが多いので非力

icon

$ git fetch upstream
$ git checkout zunda-ninja-on-heroku
$ git pull
$ git merge v1.3.2
$ git push

$ git checkout master
$ git pull
$ git rebase upstream/master
$ git push

icon

Updated this instance to v1.3.2.

Downtime was from 2017-04-29T21:46:36.936465+00:00 to 2017-04-29T21:47:03.708810+00:00.

icon

Database status.

$ heroku pg:info DATABASE
=== 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: 33.3 MB
Tables: 26
Rows: 34040/10000000 (In compliance)

2017-04-29 14:10:22 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-29 15:57:05 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-29 15:58:09 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-29 15:59:48 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-29 22:10:53 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-29 22:10:58 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-30 02:02:58 zundaの投稿 zundan@mastodon.zunda.ninja
icon

@noritsuna こっちはまだ4月ですよ?

2017-04-30 06:56:54 zundaの投稿 zundan@mastodon.zunda.ninja
icon

@noritsuna ヤバい!

2017-04-30 16:37:13 zundaの投稿 zundan@mastodon.zunda.ninja
icon

にゃーん

2017-04-30 19:49:36 zundaの投稿 zundan@mastodon.zunda.ninja
icon

反芻

icon

いいな、反芻

2017-04-30 19:53:01 zundaの投稿 zundan@mastodon.zunda.ninja
2017-04-30 19:57:29 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Database status:

$ heroku pg:info DATABASE
=== 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: 35.2 MB
Tables: 26
Rows: 35823/10000000 (In compliance)

icon

Redisのメトリクスには対応する変化は見られない

2017-04-30 21:01:22 zundaの投稿 zundan@mastodon.zunda.ninja
icon

値段じゃ勝負にならないなあ…

2017-04-30 23:08:13 zundaの投稿 zundan@mastodon.zunda.ninja