Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/themes/simplicity2/lib/amp.php on line 38
php-fpmがメモリリークしてる?結局設定が落ち着かない件。 | freeSIM.tokyo
Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/themes/simplicity2/lib/scripts.php on line 131

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Functions::get_locale is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/class-module-view.php on line 54

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Functions::get_thumbnail is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/class-module-view.php on line 190

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Options::get is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/class-module-view.php on line 192

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::default_options is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-options.php on line 48

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::settings is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 188

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Functions::exists_push7 is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 129

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Functions::hex_to_rgb is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/class-module-view.php on line 193

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Options::get is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/class-module-view.php on line 61

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::default_options is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-options.php on line 48

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::settings is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 188

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Functions::exists_push7 is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 129

php-fpmがメモリリークしてる?結局設定が落ち着かない件。


Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/themes/simplicity2/lib/customizer.php on line 4923

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/themes/simplicity2/lib/customizer.php on line 4929

シェアする


Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Options::get is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/class-module-view.php on line 131

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::default_options is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-options.php on line 48

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::settings is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 188

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Functions::exists_push7 is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 129

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::sns_list is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/class-module-shortcode.php on line 218

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::default_options is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 206

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::settings is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 188

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Functions::exists_push7 is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 129

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Functions::get_current_url is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/class-module-shortcode.php on line 219

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::notification_list is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/class-module-shortcode.php on line 251

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::default_options is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 232

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::settings is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 188

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Functions::exists_push7 is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 129

Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Functions::exists_push7 is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 235

前回php-fpm周りの設定で「そんなにプロセスいらないよー」的な講釈を垂れてみましたが、その後全然設定が落ち着かず試行錯誤し続けていますw
php-fpmがメモリリークしてるのか、ちょっとしたことでLoad Averageが上がってサーバのパフォーマンスが落ちる、という状況に・・・。


Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/themes/simplicity2/lib/customizer.php on line 4923

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/themes/simplicity2/lib/customizer.php on line 4929

php-fpmの設定ですったもんだしています

前回記事はこれです。
実際これまではphp-fpmの設定はpm = staticで、pm.max_children = 7pm.max_requests = 1000で終わり、だったんですが・・・
ここ最近はプロセス数が上限に達したと思ったらそこから落ちなくなって、mysqlのqueryが遅くなる、という連鎖に陥っています。
muninのphp-fpmの月間グラフはこんな感じ。

オレンジがpm_.max_childrenの設定値、青が空きスロット、緑が稼働スロット。前半は安定しているのがお分かりいただけるかと。Wordpressでnginx+php-fpmだとphpのお仕事は

  • 管理画面の処理
  • 新規投稿やロングテールの検索結果から来たレア記事の再生成
  • 検索の処理

くらいのものなので結構暇なんです。一度でも見られた記事はnginx側でキャッシュされているのでしばらくの間(設定に依る)は生成することがありません。

ところが・・・グラフ後半から変にプロセス数が天井に届きだしてそのまま張り付きになっています。今度はmysqlのグラフ。同じくby monthです。

こちらは緑がSELECT、青がcache_hitsで縦が応答速度です。一時的におっそろしく応答速度が悪化しているのが分かると思います。先程のphp-fpmのグラフと重ねてみると一目瞭然。ピッタリ重なります。白っぽいハイライトがmysqlで、手前に見えるphp-fpmの緑と重なっています。

つまりphp-fpm側でプロセスが天井に達するとmysqlのパフォーマンスが下がる、ということですね。メモリを食っちゃってるんだと思います。そこからプロセスの上限を変えたりpm = staticをdynamicやondemandにしたりしてみましたが改善せず。というか幾つかおかしな状況まで付いてきています。

設定調整中のphp-fpmのおかしな挙動

とりあえず色々設定を試した試行錯誤の記録です。

プロセス上限の変更

通常 pm.max_children = 7だった設定を10とかに上げてみましたが、それでも上限に達するとそこから触りっぱなしになる状況は変わらず。

max_requestsの変更

pm.max_requestsは、指定した回数プロセスが処理を終えると再起動する、という「メモリリーク」対策として一般的なものですが、pm.max_requests = 1000の設定を500に変えても改善はしませんでした。

途中、pm = dynamicに指定しながら、max_children = 10、min_children = 10、みたいな「実質固定」も試してみましたが意味なし。とにかくプロセスが上限に達すると飽和する、みたいな状況は変わりません。

WordPressのプラグインの見直し

調べている中で、WordPressの特定バージョン(4.3だったかな?)や特定のプラグインでメモリを膨大に使うものがある、という情報もあったので、そちらも試してみましたが効果なし。

気になるのはこれがここ最近急に出だしたことです。php-fpmかmysqlのアップデートでなんかあった・・・?

現在の対応

とにかくレスポンスが悪いのは困るので、今は仕方なくcronでservice php-fpm restartで一定時間ごとに再起動しています。
ちょっと困ってますね・・・。

この記事が気に入ったら
いいね!お願いします


Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/themes/simplicity2/lib/customizer.php on line 4923

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/themes/simplicity2/lib/customizer.php on line 4929

シェアする

フォローする


Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/themes/simplicity2/lib/customizer.php on line 4923

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/themes/simplicity2/lib/customizer.php on line 4929

コメント

  1. […] php-fpmがメモリリークしてる?結局設定が落ち着かない件。 […]