マストドンサーバのストレージ容量を喰っているのは?

588

マストドンサーバの運営を始めて半年ほどになります。マストドンはかなり重いシステムですが、もとが高性能な Digital Ocean のVPSを使っているだけあって、メモリ2GBでも問題なく稼働できています。ただしストレージの容量が日に日に逼迫しており、しばらく見ないうちに50GBのうち82.4%も食い尽くされている状態になっていました。


 

もちろん、巷で推奨されている「連合先・フォロー先外部アカウントのメディアファイルを定期的に削除」は行っています。参考までに以下のようなコマンドです。mastodon アカウントになって、mastodonのインストールディレクトリで実行します。
 

RAILS_ENV=production bundle exec ./bin/tootctl media remove --days=3

 

しかし、これ本当にメディアファイルだけの問題? おかしくない? と容量チェックをしてみたところ……
 


 

{$mastodon_dir}/public/system/cache のうち、preview_cards がなんと12GBも喰っていました。調べてみると以下のコマンドで古い preview_cards も削除できるようです。

RAILS_ENV=production bundle exec ./bin/tootctl preview_cards remove --days=3

 


 

56.8%まで一気に減りました!
 

このコマンドもしっかり cron に仕込んでおくべきですね。
 

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny