Back to Directus

PM2

content/configuration/pm2.md

latest2.4 KB
Original Source

:partial{content="config-env-vars"}

For more information on what these options do, refer directly to the pm2 documentation.

VariableDescriptionDefault
PM2_INSTANCES<sup>[1]</sup>Number of app instance to be launched.1
PM2_EXEC_MODEOne of fork, cluster.'cluster'
PM2_MAX_MEMORY_RESTARTApp will be restarted if it exceeds the amount of memory specified.
PM2_MIN_UPTIMEMin uptime of the app to be considered started.
PM2_LISTEN_TIMEOUTTime in ms before forcing a reload if app not listening.
PM2_KILL_TIMEOUTTime in milliseconds before sending a final SIGKILL.
PM2_MAX_RESTARTSNumber of failed restarts before the process is killed.
PM2_RESTART_DELAYTime to wait before restarting a crashed app.0
PM2_AUTO_RESTARTAutomatically restart Directus if it crashes unexpectedly.false
PM2_LOG_ERROR_FILEError file path.$HOME/.pm2/logs/<app name>-error-<pid>.log
PM2_LOG_OUT_FILEOutput file path.$HOME/.pm2/logs/<app name>-out-<pid>.log

<sup>[1]</sup> Redis is required in case of multiple instances.

These environment variables only exist when you're using the official Docker Container, or are using the provided ecosystem.config.cjs file with pm2 directly.