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