Date Modified Tags python / uwsgi

運営してるサービスがえらい重かったので、調べてみた。 使用しているアプリはnginx, uwsgi, django

Apacheにかわるwebサーバ: uWSGIパフォーマンスチューニング - Qiita

を見るとuwsgitopを使ってuwsgiのパフォーマンスを調べることが出来るらしいので、導入してみた。

インストール

$ pip install uwsgitop

これだけ

uwsgiの設定

uwsgi.iniにuwsgitop用の設定をした。今回はこの2行を追加した

stats = /tmp/projectname.stats.sock
memory-report = true

んで、uwsgiを再起動

uwsgitopを起動

$ uwsgitop /tmp/projectname.stats.sock

起動するとこんな感じになった

uwsgi-x.x.x - Fri Sep 16 22:24:17 2016 - req: 11366 - RPS: 1 - lq: 0 - tx: 409.
0Mde: www10363uf - cwd: /path/to/project - uid: 1000 - gid: 1000 -
 WID    %       PID     REQ     RPS     EXC     SIG     STATUS  AVG     RSS
 1      20.0    31414   2277    0       0       0       idle    2516ms  83.0M
202.0M  71.0M   1       0       7157645 12:32:03

あ・・・プロセス1個しか立ち上がってない・・・