LoginSignup
0
0

More than 1 year has passed since last update.

【Django】IIS のサーバータイムアウト時間の変更

Posted at

はじめに

Django フレームワークを用いて IIS サーバーへデプロイしました
その際に サーバータイムアウト の設定を IISマネージャーからどこを変えてもうんともすんとも効かなかったので、変更箇所を共有したいと思います
IIS タイムアウト時間はデフォルトで 110 秒となっています

※DjangoをIISへデプロイしたり環境の用意をする記事ではありません

下記の環境を想定しています

- Windows Server 2019
- IIS 10
- Python 3.9.7
- Django 3.2.10
- wfastcgi 3.0.0
- wwwroot 直下に venv にて python 仮想環境フォルダ(env)を作成

もくじ

  • applicationHost.config の変更

applicationHost.config の変更

下記ディレクトリにある applicationHost.config を変更します
C:\Windows\System32\inetsrv\Config\applicationHost.config
※任意でバックアップはとっておきましょう

ファイル内にあるタグ <fastCgi> を編集します
例では 180 秒に変更しております

【変更前】

<fastCgi>
    <application fullPath="C:\inetpub\wwwroot\env\Scripts\python.exe" arguments="C:\inetpub\wwwroot\env\lib\site-packages\wfastcgi.py" 
    signalBeforeTerminateSeconds="30" />
</fastCgi>

【変更後】

<fastCgi>
    <application fullPath="C:\inetpub\wwwroot\env\Scripts\python.exe" arguments="C:\inetpub\wwwroot\env\lib\site-packages\wfastcgi.py" 
    signalBeforeTerminateSeconds="30" activityTimeout="180" />
</fastCgi>

activityTimeout="180" を追記しました
あとはサーバーを再起動すればタイムアウト時間が 180 秒に変更されます

おわりに

IIS は基本的に asp.net に合わせた設定が多いらしく、Django との相性は…
タイムアウト伸ばすだけでしたが、情報がなかったので共有しておきます

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0