Skip to content

Instantly share code, notes, and snippets.

@kjunichi
Last active August 29, 2015 14:17
Show Gist options
  • Save kjunichi/40d7c56697a7abea48ae to your computer and use it in GitHub Desktop.
Save kjunichi/40d7c56697a7abea48ae to your computer and use it in GitHub Desktop.

set_map_to_strage_cbで増える

静的コンテンツは良いが、 set_map_to_strage_cbでset_content_cbで コンテンツを返すと、たとえ、固定文字列でも400万回の処理で、16MB->579MB程度に増加する

微増はする模様

htdocs配下を指定するだけでも

10万回程度の処理でも微増はする模様

対策

  • mruby側で強制的にGCを実行する

  • trusterdを起動しているプロセスを再起動する

  • コールバック元がそのままなので、相当に賢くないと、難しそうな気がする。が、試すのはタダだから

  • 再起動

再起動するには

必要なコマンドライン引数を共有ライブラリ側で取得するには

ps -p 1010 -o args=

実行ファイルのパスの取得

kjunichi/mruby-getprocpath

Link

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