UWSGI-CORE(1)
๐ uwsgi-core(1) ๐
okay bestie, welcome to the uwsgi-core manual page (that's the manual name, and no we're not gonna pretend we're above introducing it). this is part 1 of 6, so buckle up, hydrate, and let's get into it ๐ซถ
โจ NAME โจ
uwsgi-core โ fast (pure C), self-healing, developer-friendly WSGI server
like. it's a WSGI server. it's pure C. it heals itself. it's friendly to developers. the whole package, no notes ๐
๐ธ SYNOPSIS ๐ธ
uwsgi-core [options...]
that's it. that's the whole invocation. you just throw options... at it and it goes โจ
๐ฆ DESCRIPTION ๐ฆ
so basically uWSGI has a lot of options, and this is where they all live. think of this section as the group chat where every flag gets its moment. let's go one by one, no skipping, we do not leave anyone on read ๐
๐ sockets, the main character energy ๐
-s,--socketโ bind to the specified UNIX/TCP socket using default protocol-s,--uwsgi-socketโ bind to the specified UNIX/TCP socket using uwsgi protocol--suwsgi-socketโ bind to the specified UNIX/TCP socket using uwsgi protocol over SSL--ssl-socketโ bind to the specified UNIX/TCP socket using uwsgi protocol over SSL--http-socketโ bind to the specified UNIX/TCP socket using HTTP protocol--http-socket-modifier1โ force the specified modifier1 when using HTTP protocol--http-socket-modifier2โ force the specified modifier2 when using HTTP protocol--http11-socketโ bind to the specified UNIX/TCP socket using HTTP 1.1 (Keep-Alive) protocol--https-socketโ bind to the specified UNIX/TCP socket using HTTPS protocol--https-socket-modifier1โ force the specified modifier1 when using HTTPS protocol--https-socket-modifier2โ force the specified modifier2 when using HTTPS protocol--fastcgi-socketโ bind to the specified UNIX/TCP socket using FastCGI protocol--fastcgi-nph-socketโ bind to the specified UNIX/TCP socket using FastCGI protocol (nph mode)--fastcgi-modifier1โ force the specified modifier1 when using FastCGI protocol--fastcgi-modifier2โ force the specified modifier2 when using FastCGI protocol--scgi-socketโ bind to the specified UNIX/TCP socket using SCGI protocol--scgi-nph-socketโ bind to the specified UNIX/TCP socket using SCGI protocol (nph mode)--scgi-modifier1โ force the specified modifier1 when using SCGI protocol--scgi-modifier2โ force the specified modifier2 when using SCGI protocol--raw-socketโ bind to the specified UNIX/TCP socket using RAW protocol--raw-modifier1โ force the specified modifier1 when using RAW protocol--raw-modifier2โ force the specified modifier2 when using RAW protocol--puwsgi-socketโ bind to the specified UNIX/TCP socket using persistent uwsgi protocol (puwsgi)--protocolโ force the specified protocol for default sockets--socket-protocolโ force the specified protocol for default sockets--shared-socketโ create a shared socket for advanced jailing or ipc--undeferred-shared-socketโ create a shared socket for advanced jailing or ipc (undeferred mode)
so many protocols bestie, it's giving versatility ๐ฅ
๐ workers & harakiri (yes that's really the name) ๐
-p,--processesโ spawn the specified number of workers/processes-p,--workersโ spawn the specified number of workers/processes--thunder-lockโ serializeaccept()usage (if possible)-t,--harakiriโ set harakiri timeout--harakiri-verboseโ enable verbose mode for harakiri--harakiri-graceful-timeoutโ interval between graceful harakiri attempt and a sigkill--harakiri-graceful-signalโ use this signal instead of sigterm for graceful harakiri attempts--harakiri-queue-thresholdโ only trigger harakiri if queue is greater than this threshold--harakiri-no-arhโ do not enable harakiri during after-request-hook--no-harakiri-arhโ do not enable harakiri during after-request-hook--no-harakiri-after-req-hookโ do not enable harakiri during after-request-hook--backtrace-depthโ set backtrace depth--mule-harakiriโ set harakiri timeout for mule tasks
"harakiri" is the timeout that takes a worker out back when it's acting up, and honestly? dramatic but fair ๐
๐ config loading & placeholders ๐
-x,--xmlconfigโ load config from xml file-x,--xmlโ load config from xml file--configโ load configuration using the pluggable system--fallback-configโ re-exec uwsgi with the specified config when exit code is 1--strictโ enable strict mode (placeholder cannot be used)--skip-zeroโ skip check of file descriptor 0--skip-atexitโ skip atexit hooks (ignored by the master)--skip-atexit-teardownโ skip atexit teardown (ignored by the master)-S,--setโ set a placeholder or an option--set-placeholderโ set a placeholder--set-phโ set a placeholder--getโ print the specified option value and exit--declare-optionโ declare a new uWSGI custom option--declare-option2โ declare a new uWSGI custom option (non-immediate)--resolveโ place the result of a dns query in the specified placeholder, sytax:placeholder=name(immediate option)
ngl the word "sytax" is right there in the original and we are preserving it exactly, character for character, because facts stay facts even when they're a lil typo ๐
๐ง opt logic, aka the if/for girlies ๐ง
--forโ (opt logic) for cycle--for-globโ (opt logic) for cycle (expand glob)--for-timesโ (opt logic) for cycle (expand the specified num to a list starting from 1)--for-readlineโ (opt logic) for cycle (expand the specified file to a list of lines)--endforโ (opt logic) end for cycle--end-forโ (opt logic) end for cycle--if-optโ (opt logic) check for option--if-not-optโ (opt logic) check for option--if-envโ (opt logic) check for environment variable--if-not-envโ (opt logic) check for environment variable--ifenvโ (opt logic) check for environment variable--if-reloadโ (opt logic) check for reload--if-not-reloadโ (opt logic) check for reload--if-hostnameโ (opt logic) check for hostname--if-not-hostnameโ (opt logic) check for hostname--if-hostname-matchโ (opt logic) try to match hostname against a regular expression--if-not-hostname-matchโ (opt logic) try to match hostname against a regular expression--if-existsโ (opt logic) check for file/directory existence--if-not-existsโ (opt logic) check for file/directory existence--ifexistsโ (opt logic) check for file/directory existence--if-pluginโ (opt logic) check for plugin--if-not-pluginโ (opt logic) check for plugin--ifpluginโ (opt logic) check for plugin--if-fileโ (opt logic) check for file existence--if-not-fileโ (opt logic) check for file existence--if-dirโ (opt logic) check for directory existence--if-not-dirโ (opt logic) check for directory existence--ifdirโ (opt logic) check for directory existence--if-directoryโ (opt logic) check for directory existence--endifโ (opt logic) end if--end-ifโ (opt logic) end if
the way you can write conditionals and loops inside your config file?? it's giving programming language but make it config โจ
๐ lists & write-error behaviour ๐
--blacklistโ set options blacklist context--end-blacklistโ clear options blacklist context--whitelistโ set options whitelist context--end-whitelistโ clear options whitelist context--ignore-sigpipeโ do not report (annoying) SIGPIPE--ignore-write-errorsโ do not report (annoying)write()/writev()errors--write-errors-toleranceโ set the maximum number of allowed write errors (default: no tolerance)--write-errors-exception-onlyโ only raise an exception on write errors giving control to the app itself--disable-write-exceptionโ disable exception generation onwrite()/writev()
the default here is no tolerance, so if you want any wiggle room at all you gotta set it yourself. she is strict ๐
๐ templating & includes ๐
--inheritโ use the specified file as config template--includeโ include the specified file as immediate configuration--inject-beforeโ inject a text file before the config file (advanced templating)--inject-afterโ inject a text file after the config file (advanced templating)
advanced templating bestie, we love a config that composes ๐ฆ
๐ daemonizing & instance control ๐
-d,--daemonizeโ daemonize uWSGI--daemonize2โ daemonize uWSGI after app loading--stopโ stop an instance--reloadโ reload an instance--pauseโ pause an instance--suspendโ suspend an instance--resumeโ resume an instance--connect-and-readโ connect to a socket and wait for data from it--extractโ fetch/dump any supported address to stdout
main character energy: she can stop, reload, pause, suspend and resume herself. obsessed ๐ญ
โญ sizes, buffers & socket tweaks โญ
-l,--listenโ set the socket listen queue size-v,--max-varsโ set the amount of internal iovec/vars structures--max-appsโ set the maximum number of per-worker applications-b,--buffer-sizeโ set internal buffer size-m,--memory-reportโ enable memory report--profilerโ enable the specified profiler-c,--cgi-modeโ force CGI-mode for plugins supporting it-a,--abstract-socketโ force UNIX socket in abstract mode (Linux only)-C,--chmod-socketโ chmod-socket-C,--chmodโ chmod-socket--chown-socketโ chown unix sockets--umaskโ set umask--freebindโ put socket in freebind mode--map-socketโ map sockets to specific workers
-a is Linux only, so don't come crying to her on macOS about abstract sockets ๐
๐งต process names & threading ๐งต
-T,--enable-threadsโ enable threads (stub option this is true by default)--no-threads-waitโ do not wait for threads cancellation on quit/reload--auto-procnameโ automatically set processes name to something meaningful--procname-prefixโ add a prefix to the process names--procname-prefix-spacedโ add a spaced prefix to the process names--procname-appendโ append a string to process names--procnameโ set process names--procname-masterโ set master process name-i,--single-interpreterโ do not use multiple interpreters (where available)--need-appโ exit if no app can be loaded-M,--masterโ enable master process--honour-stdinโ do not remap stdin to/dev/null
not me pointing out that -T|--enable-threads is a stub option and it's true by default ๐ girl, you don't even need to ask.
๐ the Emperor (yes, capital E) ๐
--emperorโ run the Emperor--emperor-proxy-socketโ force the vassal to became an Emperor proxy--emperor-wrapperโ set a binary wrapper for vassals--emperor-wrapper-overrideโ set a binary wrapper for vassals to try before the default one--emperor-wrapper-fallbackโ set a binary wrapper for vassals to try as a last resort--emperor-nofollowโ do not follow symlinks when checking for mtime--emperor-procnameโ set the Emperor process name--emperor-freqโ set the Emperor scan frequency (default 3 seconds)--emperor-required-heartbeatโ set the Emperor tolerance about heartbeats--emperor-curse-toleranceโ set the Emperor tolerance about cursed vassals
she has an Emperor, she has vassals, she has cursed vassals and a tolerance setting for them ๐ that's not a server, that's a whole monarchy.
and that's part 1, bestie โ the sockets, the workers, the opt logic, the Emperor, all of it. part 2 is coming, so don't go anywhere ๐
--emperor-pidfileโ bestie, this one writes the Emperor pid into the file you point at ๐๐--emperor-tyrantโ puts the Emperor in Tyrant mode, no cap ๐๐--emperor-tyrant-nofollowโ in Tyrant mode, do not follow symlinks when checking uid/gid ๐ซ๐--emperor-statsโ runs the Emperor stats server, it's giving observability ๐โจ--emperor-stats-serverโ runs the Emperor stats server, same vibe ๐โจ--early-emperorโ spawns the emperor as soon as possible, main character energy โฉ--emperor-broodlordโ runs the emperor in BroodLord mode ๐--emperor-throttleโ sets throttling level (in milliseconds) for bad behaving vassals โ default is1000๐ค--emperor-max-throttleโ sets max throttling level (in milliseconds) for bad behaving vassals โ default is3 minutes๐--emperor-magic-execโ prefixes vassals config files withexec://if they have the executable bit โจ--emperor-on-demand-extensionโ searches for a text file (vassal name + extension) containing the on demand socket name ๐--emperor-on-demand-extโ searches for a text file (vassal name + extension) containing the on demand socket name ๐--emperor-on-demand-directoryโ enables on demand mode binding to the unix socket in the specified directory named like the vassal +.socket๐งฆ--emperor-on-demand-dirโ enables on demand mode binding to the unix socket in the specified directory named like the vassal +.socket๐งฆ--emperor-on-demand-execโ uses the output of the specified command as on demand socket name (the vassal name is passed as the only argument) ๐ฏ--emperor-extra-extensionโ allows the specified extension in the Emperor (vassal will be called with--config) ๐ช--emperor-extra-extโ allows the specified extension in the Emperor (vassal will be called with--config) ๐ช--emperor-no-blacklistโ disables the Emperor blacklisting subsystem ๐ซ--emperor-use-cloneโ usesclone()instead offork(), passing the specifiedunshare()flags ๐งฌ--emperor-graceful-shutdownโ uses vassals graceful shutdown during ragnarok ๐ธ--emperor-capโ sets vassals capability ๐ก๏ธ--vassals-capโ sets vassals capability ๐ก๏ธ--vassal-capโ sets vassals capability ๐ก๏ธ--imperial-monitor-listโ lists enabled imperial monitors ๐--imperial-monitors-listโ lists enabled imperial monitors ๐--vassals-inheritโ adds config templates to vassals config (uses--inherit) ๐--vassals-includeโ includes config templates to vassals config (uses--includeinstead of--inherit) ๐--vassals-inherit-beforeโ adds config templates to vassals config (uses--inherit, parses before the vassal file) โช--vassals-include-beforeโ includes config templates to vassals config (uses--includeinstead of--inherit, parses before the vassal file) โฎ๏ธ--vassals-start-hookโ runs the specified command before each vassal starts ๐--vassals-stop-hookโ runs the specified command after vassal's death ๐ชฆ--vassal-sosโ asks emperor for reinforcement when overloaded ๐--vassal-sos-backlogโ asks emperor for SOS if backlog queue has more items than the value specified ๐--vassals-setโ automatically sets the specified option (via--set) for every vassal ๐๏ธ--vassal-setโ automatically sets the specified option (via--set) for every vassal ๐๏ธ--heartbeatโ announces healthiness to the emperor ๐--reload-mercyโ sets the maximum time (in seconds) we wait for workers and other processes to die during reload/shutdown โณ--worker-reload-mercyโ sets the maximum time (in seconds) a worker can take to reload/shutdown โ default is60โฑ๏ธ--mule-reload-mercyโ sets the maximum time (in seconds) a mule can take to reload/shutdown โ default is60๐ด--exit-on-reloadโ forces exit even if a reload is requested ๐ช--die-on-termโ exits instead of brutal reload onSIGTERMโ ๏ธ--force-gatewayโ forces the spawn of the first registered gateway without a master ๐ช-h|--helpโ shows this help ๐โ๏ธ-h|--usageโ shows this help ๐โ๏ธ--print-symโ prints content of the specified binary symbol ๐ฃ--print-symbolโ prints content of the specified binary symbol ๐ฃ-r|--reaperโ callswaitpid(-1,...)after each request to get rid of zombies ๐ง-R|--max-requestsโ reloads workers after the specified amount of managed requests ๐--max-requests-deltaโ adds(worker_id * delta)to themax_requestsvalue of each worker โ--min-worker-lifetimeโ number of seconds worker must run before being reloaded โ default is10โฒ๏ธ--max-worker-lifetimeโ reloads workers after the specified amount of seconds โ default is disabled ๐ซ--max-worker-lifetime-deltaโ adds(worker_id * delta)seconds to themax_worker_lifetimevalue of each worker โ-z|--socket-timeoutโ sets internal sockets timeout โฐ--no-fd-passingโ disables file descriptor passing ๐ซ๐--locksโ creates the specified number of shared locks ๐--lock-engineโ sets the lock engine ๐--ftokโ sets the ipcsem key viaftok()for avoiding duplicates ๐๏ธ--persistent-ipcsemโ does not remove ipcsem's on shutdown ๐งท-A|--sharedareaโ creates a raw shared memory area of specified pages (note: it supports keyval too) ๐ง--safe-fdโ does not close the specified file descriptor ๐--fd-safeโ does not close the specified file descriptor ๐--cacheโ creates a shared cache containing given elements ๐๏ธ--cache-blocksizeโ sets cache blocksize ๐ฆ--cache-storeโ enables persistent cache to disk ๐พ--cache-store-syncโ sets frequency of sync for persistent cache ๐--cache-no-expireโ disables auto sweep of expired items ๐งน๐ซ--cache-expire-freqโ sets the frequency of cache sweeper scans โ default3 seconds๐งฝ--cache-report-freed-itemsโ constantly reports the cache item freed by the sweeper (use only for debug) ๐--cache-udp-serverโ binds the cache udp server (used only for set/update/delete) to the specified socket ๐ก--cache-udp-nodeโ sends cache update/deletion to the specified cache udp server ๐ค--cache-syncโ copies the whole content of another uWSGI cache server on server startup ๐--cache-use-last-modifiedโ updateslast_modified_attimestamp on every cache item modification โ default is disabled ๐--add-cache-itemโ adds an item in the cache โ--load-file-in-cacheโ loads a static file in the cache ๐--load-file-in-cache-gzipโ loads a static file in the cache with gzip compression ๐๏ธ--cache2โ creates a new generation shared cache (keyval syntax) ๐--queueโ enables shared queue ๐ฅ--queue-blocksizeโ sets queue blocksize ๐งฑ--queue-storeโ enables persistent queue to disk ๐ฝ--queue-store-syncโ sets frequency of sync for persistent queue ๐-Q|--spoolerโ runs a spooler on the specified directory ๐งต--spooler-externalโ maps spoolers requests to a spooler directory managed by an external instance ๐--spooler-orderedโ tries to order the execution of spooler tasks ๐--spooler-chdirโchdir()s to specified directory before each spooler task ๐--spooler-processesโ sets the number of processes for spoolers ๐ง๐ณ--spooler-quietโ does not be verbose with spooler tasks ๐คซ--spooler-max-tasksโ sets the maximum number of tasks to run before recycling a spooler โป๏ธ--spooler-harakiriโ sets harakiri timeout for spooler tasks ๐ก๏ธ--spooler-frequencyโ sets spooler frequency ๐ถ--spooler-freqโ sets spooler frequency ๐ถ--muleโ adds a mule ๐ด--mulesโ adds the specified number of mules ๐ด๐ด--farmโ adds a mule farm ๐--mule-msg-sizeโ sets mule message buffer size ๐จ--signalโ sends a uwsgi signal to a server ๐ถ--signal-bufsizeโ sets buffer size for signal queue ๐ฆ--signals-bufsizeโ sets buffer size for signal queue ๐ฆ--signal-timerโ adds a timer (syntax:<signal> <seconds>) โฒ๏ธ--timerโ adds a timer (syntax:<signal> <seconds>) โฒ๏ธ--signal-rbtimerโ adds a redblack timer (syntax:<signal> <seconds>) ๐ณ--rbtimerโ adds a redblack timer (syntax:<signal> <seconds>) ๐ณ--rpc-maxโ maximum number of rpc slots โ default:64๐ฐ-L|--disable-loggingโ disables request logging ๐ค--flockโ locks the specified file before starting, exits if locked ๐--flock-waitโ locks the specified file before starting, waits if locked โณ--flock2โ locks the specified file after logging/daemon setup, exits if locked ๐--flock-wait2โ locks the specified file after logging/daemon setup, waits if locked โณ--pidfileโ creates pidfile (before privileges drop) ๐--pidfile2โ creates pidfile (after privileges drop) ๐--safe-pidfileโ creates safe pidfile (before privileges drop) ๐ก๏ธ๐--safe-pidfile2โ creates safe pidfile (after privileges drop) ๐ก๏ธ๐--chrootโchroot()s to the specified directory ๐--pivot-rootโpivot_root()s to the specified directories (new_rootandput_oldmust be separated with a space) ๐--pivot_rootโpivot_root()s to the specified directories (new_rootandput_oldmust be separated with a space) ๐--uidโsetuidto the specified user/uid ๐ค--gidโsetgidto the specified group/gid ๐ฅ--add-gidโ adds the specified group id to the process credentials โ--immediate-uidโsetuidto the specified user/uid IMMEDIATELY ๐จ--immediate-gidโsetgidto the specified group/gid IMMEDIATELY ๐จ--no-initgroupsโ disables additional groups set viainitgroups()๐ซ--capโ sets process capability ๐ฉ--unshareโunshare()s part of the processes and puts it in a new namespace ๐งฉ--unshare2โunshare()s part of the processes and puts it in a new namespace after rootfs change ๐งฉ--setns-socketโ exposes a unix socket returning namespace fds from/proc/self/ns๐--setns-socket-skipโ skips the specified entry when sending setns file descriptors โญ๏ธ--setns-skipโ skips the specified entry when sending setns file descriptors โญ๏ธ--setnsโ joins a namespace created by an external uWSGI instance ๐ค--setns-preopenโ opens/proc/self/nsas soon as possible and caches fds ๐๏ธ
okay so we're still deep in OPTIONS and this chunk is giving life-cycle cinematic universe: hooks, execs, mounts, waits, calls, and all the tuning knobs. no skipping, bestie, every single flag is getting its moment. ๐
--jailedโ mark the instance as jailed, which forces the execution ofpost_jailhooks. ๐--reforkโfork()again after privileges drop. useful for jailing systems. ๐ง--re-forkโfork()again after privileges drop. useful for jailing systems. ๐ง--refork-as-rootโfork()again before privileges drop. useful for jailing systems. ๐ง--re-fork-as-rootโfork()again before privileges drop. useful for jailing systems. ๐ง--refork-post-jailโfork()again after jailing. useful for jailing systems. ๐ง--re-fork-post-jailโfork()again after jailing. useful for jailing systems. ๐ง
and now the hooks โ every one of these is literally "run the specified hook" but at a different moment. the timing is the whole personality. ๐
--hook-asapโ run the specified hook as soon as possible. โก--hook-pre-jailโ run the specified hook before jailing. ๐--hook-post-jailโ run the specified hook after jailing. ๐--hook-in-jailโ run the specified hook in jail after initialization. ๐--hook-as-rootโ run the specified hook before privileges drop. ๐--hook-as-userโ run the specified hook after privileges drop. ๐ซถ--hook-as-user-atexitโ run the specified hook before app exit and reload. ๐ญ--hook-pre-appโ run the specified hook before app loading. ๐ฆ--hook-post-appโ run the specified hook after app loading. โจ--hook-post-forkโ run the specified hook after each fork. ๐ด--hook-acceptingโ run the specified hook after each worker enter the accepting phase. ๐ง--hook-accepting1โ run the specified hook after the first worker enters the accepting phase. ๐ฅ--hook-accepting-onceโ run the specified hook after each worker enter the accepting phase (once per-instance). ๐--hook-accepting1-onceโ run the specified hook after the first worker enters the accepting phase (once per instance). ๐ฅ--hook-master-startโ run the specified hook when the Master starts. ๐--hook-touchโ run the specified hook when the specified file is touched (syntax: <file> <action>). ๐--hook-emperor-startโ run the specified hook when the Emperor starts. ๐--hook-emperor-stopโ run the specified hook when the Emperor send a stop message. ๐--hook-emperor-reloadโ run the specified hook when the Emperor send a reload message. ๐--hook-emperor-lostโ run the specified hook when the Emperor connection is lost. ๐--hook-as-vassalโ run the specified hook beforeexec()ingthe vassal. ๐งณ--hook-as-emperorโ run the specified hook in the emperor after the vassal has been started. ๐--hook-as-muleโ run the specified hook in each mule. ๐ด--hook-as-gatewayโ run the specified hook in each gateway. ๐ช--after-request-hookโ run the specified function/symbol after each request. ๐ฏ--after-request-callโ run the specified function/symbol after each request. ๐ฏ
next up: exec flags. same timing energy, but instead of hooks you're running the specified command. ๐โโ๏ธ
--exec-asapโ run the specified command as soon as possible. โก--exec-pre-jailโ run the specified command before jailing. ๐--exec-post-jailโ run the specified command after jailing. ๐--exec-in-jailโ run the specified command in jail after initialization. ๐--exec-as-rootโ run the specified command before privileges drop. ๐--exec-as-userโ run the specified command after privileges drop. ๐ซถ--exec-as-user-atexitโ run the specified command before app exit and reload. ๐ญ--exec-pre-appโ run the specified command before app loading. ๐ฆ--exec-post-appโ run the specified command after app loading. โจ--exec-as-vassalโ run the specified command beforeexec()ingthe vassal. ๐งณ--exec-as-emperorโ run the specified command in the emperor after the vassal has been started. ๐
mount flags: mount filesystem at the stated moment. ๐๏ธ
--mount-asapโ mount filesystem as soon as possible. โก--mount-pre-jailโ mount filesystem before jailing. ๐--mount-post-jailโ mount filesystem after jailing. ๐--mount-in-jailโ mount filesystem in jail after initialization. ๐--mount-as-rootโ mount filesystem before privileges drop. ๐--mount-as-vassalโ mount filesystem beforeexec()ingthe vassal. ๐งณ--mount-as-emperorโ mount filesystem in the emperor after the vassal has been started. ๐
umount flags: unmount filesystem, same timing buffet. ๐๏ธ
--umount-asapโ unmount filesystem as soon as possible. โก--umount-pre-jailโ unmount filesystem before jailing. ๐--umount-post-jailโ unmount filesystem after jailing. ๐--umount-in-jailโ unmount filesystem in jail after initialization. ๐--umount-as-rootโ unmount filesystem before privileges drop. ๐--umount-as-vassalโ unmount filesystem beforeexec()ingthe vassal. ๐งณ--umount-as-emperorโ unmount filesystem in the emperor after the vassal has been started. ๐
wait-for-interface era: make root hooks wait for networking. ๐
--wait-for-interfaceโ wait for the specified network interface to come up before running root hooks. ๐ถ--wait-for-interface-timeoutโ set the timeout forwait-for-interface. โณ--wait-interfaceโ wait for the specified network interface to come up before running root hooks. ๐ถ--wait-interface-timeoutโ set the timeout forwait-for-interface. โณ--wait-for-ifaceโ wait for the specified network interface to come up before running root hooks. ๐ถ--wait-for-iface-timeoutโ set the timeout forwait-for-interface. โณ--wait-ifaceโ wait for the specified network interface to come up before running root hooks. ๐ถ--wait-iface-timeoutโ set the timeout forwait-for-interface. โณ--wait-for-fsโ wait for the specified filesystem item to appear before running root hooks. ๐--wait-for-fileโ wait for the specified file to appear before running root hooks. ๐--wait-for-dirโ wait for the specified directory to appear before running root hooks. ๐--wait-for-mountpointโ wait for the specified mountpoint to appear before running root hooks. ๐--wait-for-fs-timeoutโ set the timeout forwait-for-fs/file/dir. โณ--wait-for-socketโ wait for the specified socket to be ready before loading apps. ๐--wait-for-socket-timeoutโ set the timeout forwait-for-socket. โณ
call flags: call the specified function at the chosen moment. ๐
--call-asapโ call the specified function as soon as possible. โก--call-pre-jailโ call the specified function before jailing. ๐--call-post-jailโ call the specified function after jailing. ๐--call-in-jailโ call the specified function in jail after initialization. ๐--call-as-rootโ call the specified function before privileges drop. ๐--call-as-userโ call the specified function after privileges drop. ๐ซถ--call-as-user-atexitโ call the specified function before app exit and reload. ๐ญ--call-pre-appโ call the specified function before app loading. ๐ฆ--call-post-appโ call the specified function after app loading. โจ--call-as-vassalโ call the specifiedfunction()beforeexec()ingthe vassal. ๐งณ--call-as-vassal1โ call the specifiedfunction(char *)beforeexec()ingthe vassal. ๐งณ--call-as-vassal3โ call the specifiedfunction(char *, uid_t, gid_t)beforeexec()ingthe vassal. ๐งณ--call-as-emperorโ call the specifiedfunction()in the emperor after the vassal has been started. ๐--call-as-emperor1โ call the specifiedfunction(char *)in the emperor after the vassal has been started. ๐--call-as-emperor2โ call the specifiedfunction(char *, pid_t)in the emperor after the vassal has been started. ๐--call-as-emperor4โ call the specifiedfunction(char *, pid_t, uid_t, gid_t)in the emperor after the vassal has been started. ๐
config loading, bestie: pick your format. ๐
--iniโ load config from ini file. ๐-y|--yamlโ load config from yaml file. ๐งพ-y|--ymlโ load config from yaml file. ๐งพ-j|--jsonโ load config from json file. ๐งพ-j|--jsโ load config from json file. ๐งพ--weightโ weight of the instance (used by clustering/lb/subscriptions). โ๏ธ--auto-weightโ set weight of the instance automatically (used by clustering/lb/subscriptions). โ๏ธ--no-serverโ force no-server mode. ๐ซ--command-modeโ force command mode. ๐ฎ--no-defer-acceptโ disable deferred-accept on sockets. ๐ซ--tcp-nodelayโ enable TCP NODELAY on each request. โก--so-keepaliveโ enable TCP KEEPALIVEs. ๐--so-send-timeoutโ setSO_SNDTIMEO. โณ--socket-send-timeoutโ setSO_SNDTIMEO. โณ--so-write-timeoutโ setSO_SNDTIMEO. โณ--socket-write-timeoutโ setSO_SNDTIMEO. โณ--socket-sndbufโ setSO_SNDBUF. ๐ฆ--socket-rcvbufโ setSO_RCVBUF. ๐ฆ--shutdown-socketsโ force callingshutdown()in addition toclose()when sockets are destroyed. ๐--limit-asโ limit processes address space/vsz. ๐ง--limit-nprocโ limit the number of spawnable processes. ๐ข--reload-on-asโ reload if address space is higher than specified megabytes. ๐--reload-on-rssโ reload if rss memory is higher than specified megabytes. ๐--evil-reload-on-asโ force the master to reload a worker if its address space is higher than specified megabytes. ๐--evil-reload-on-rssโ force the master to reload a worker if its rss memory is higher than specified megabytes. ๐--mem-collector-freqโ set the memory collector frequency when evil reloads are in place. ๐งน--reload-on-fdโ reload if the specified file descriptor is ready. ๐--brutal-reload-on-fdโ brutal reload if the specified file descriptor is ready. ๐ฅ--ksmโ enable Linux KSM. ๐ง--pcre-jitโ enable pcre jit (if available). โก--never-swapโ lock all memory pages avoiding swapping. ๐--touch-reloadโ reload uWSGI if the specified file is modified/touched. ๐--touch-workers-reloadโ trigger reload of (only) workers if the specified file is modified/touched. ๐--touch-mules-reloadโ reload mules if the specified file is modified/touched. ๐--touch-spoolers-reloadโ reload spoolers if the specified file is modified/touched. ๐--touch-chain-reloadโ trigger chain reload if the specified file is modified/touched. ๐--touch-logrotateโ trigger logrotation if the specified file is modified/touched. ๐--touch-logreopenโ trigger log reopen if the specified file is modified/touched. ๐--touch-execโ run command when the specified file is modified/touched (syntax: file command). ๐--touch-signalโ ๐ watch a file and fire off a signal the second it gets modified/touched. Syntax goes likefile signal, bestie.--fs-reloadโ if the filesystem object you named gets modified, do a graceful reload. Chill vibes, no drama.--fs-brutal-reloadโ same energy but make it brutal reload when that filesystem object changes. No soft launch here.--fs-signalโ raise a uwsgi signal when the specified filesystem object is modified. Syntax:file signalโจ--check-mountpointโ if a filesystem becomes unreachable, destroy the instance. Sounds harsh but it's literally useful for reliable Fuse management ๐--mountpoint-checkโ same thing, different spelling: destroy the instance if a filesystem is no more reachable (useful for reliable Fuse management).--check-mountโ yep, also destroys the instance when a filesystem goes unreachable (useful for reliable Fuse management).--mount-checkโ the fourth twin ๐ซถ destroy the instance if a filesystem is no more reachable (useful for reliable Fuse management).--propagate-touchโ described as an over-engineering option for system with flaky signal management. They said it, not me ๐ญ--limit-postโ cap the request body. Put a limit on it, periodt.--no-orphansโ if the master dies, the workers get auto-killed too ๐ชฆ but heads up, this can be dangerous for availability.--prioโ set the priority of your processes/threads. Main character scheduling energy ๐--cpu-affinityโ pin things to specific CPUs, set your cpu affinity ๐--post-bufferingโ pick the size in bytes where stuff stops living in memory and gets buffered to disk instead.--post-buffering-bufsizeโ set the buffer size forread()when you're in post buffering mode.--body-read-warningโ set the amount of allowed memory allocation, in megabytes, for the request body before it starts printing a warning at you. Like a lil "bestieโฆ" alarm ๐จ--upload-progressโ turn on creation of.jsonfiles in the directory you specify, all while a file upload is happening ๐--no-default-appโ do not fallback to the default app. Boundaries โ--manage-script-nameโ automatically rewriteSCRIPT_NAMEandPATH_INFOfor you. Iconic behaviour.--ignore-script-nameโ ignoreSCRIPT_NAMEentirely. Not today.--catch-exceptionsโ report the exception as http output. > Discouraged! Use only for testing, fr fr.--reload-on-exceptionโ an exception gets raised, the worker gets reloaded. Fresh start, glow up ๐--reload-on-exception-typeโ reload a worker when a specific exception type is raised.--reload-on-exception-valueโ reload a worker when a specific exception value is raised.--reload-on-exception-reprโ reload a worker when a specific exception type+value combo (language-specific) is raised.--exception-handlerโ add an exception handler ๐ซถ--enable-metricsโ switch on the metrics subsystem โจ--metricโ add a custom metric of your very own.--metric-thresholdโ add a metric threshold/alarm ๐จ--metric-alarmโ add a metric threshold/alarm (same deal, different name).--alarm-metricโ and again: add a metric threshold/alarm.--metrics-dirโ export your metrics as text files into the directory you name.--metrics-dir-restoreโ restore the last value taken from the metrics dir. Glow-up from your past self ๐--metric-dirโ export metrics as text files to the specified directory (singular twin, same energy).--metric-dir-restoreโ restore last value taken from the metrics dir.--metrics-no-coresโ stop generating cores-related metrics. No cores, no problem.--udpโ run the udp server on the address you specify ๐ก--statsโ enable the stats server on the specified address.--stats-serverโ enable the stats server on the specified address (yes, again, it's the same option wearing a different name).--stats-httpโ prefix the stats server json output with http headers.--stats-minifiedโ minify the statistics json output. Shrink it, slay it.--stats-minโ minify statistics json output. Same glow, shorter name.--stats-pushโ push the stats json to whatever destination you name ๐--stats-pusher-default-freqโ set the default frequency of stats pushers.--stats-pushers-default-freqโ set the default frequency of stats pushers (plural edition).--stats-no-coresโ disable generation of cores-related stats.--stats-no-metricsโ do not include metrics in the stats output. Leave them out of the group chat ๐--multicastโ subscribe to the multicast group you specify ๐ป--multicast-ttlโ set the multicast ttl.--multicast-loopโ set multicast loop. Default is1.--master-fifoโ enable the master fifo ๐--notify-socketโ enable the notification socket ๐--subscription-notify-socketโ set the notification socket for subscriptions.--legionโ become a member of a legion. Like joining a squad but for uWSGI ๐--legion-mcastโ become a member of a legion, but this one's a shortcut for multicast.--legion-nodeโ add a node to a legion.--legion-freqโ set the frequency of legion packets.--legion-toleranceโ set the tolerance of the legion subsystem.--legion-death-on-lord-errorโ if one of the lord hooks fails, declare itself as a dead node for the specified amount of seconds ๐ dramatic but make it resilient.--legion-skew-toleranceโ set the clock skew tolerance of the legion subsystem. Default is60seconds.--legion-lordโ the action to call on Lord election ๐--legion-unlordโ the action to call on Lord dismiss.--legion-setupโ the action to call on legion setup.--legion-deathโ the action to call on legion death, aka shutdown of the instance ๐ชฆ--legion-joinโ the action to call on legion join (the first time quorum is reached).--legion-node-joinedโ the action to call when a new node joins the legion ๐ซถ--legion-node-leftโ the action to call when a node leaves the legion.--legion-quorumโ set the quorum of a legion.--legion-scrollโ set the scroll of a legion.--legion-scroll-max-sizeโ set the max size of the legion scroll buffer.--legion-scroll-list-max-sizeโ set the max size of the legion scroll list buffer.--subscriptions-sign-checkโ set the digest algorithm and certificate directory for the secured subscription system ๐--subscriptions-sign-check-toleranceโ set the maximum tolerance, in seconds, of clock skew for the secured subscription system.--subscriptions-sign-skip-uidโ skip the signature check for the specified uid when you're using unix sockets credentials.--subscriptions-credentials-checkโ add a directory to search for subscriptions key credentials.--subscriptions-use-credentialsโ enable management ofSCM_CREDENTIALSin subscriptions UNIX sockets.--subscription-algoโ set the load balancing algorithm for the subscription system โ๏ธ--subscription-dotsplitโ try to fallback to the next part (dot based) in the subscription key.--subscribe-toโ subscribe to the subscription server you specify.--stโ subscribe to the specified subscription server. Tiny name, big job.--subscribeโ subscribe to the specified subscription server (yes bestie, it's the same thing again).--subscribe2โ subscribe to the specified subscription server using advanced keyval syntax โจ--subscribe-freqโ send the subscription announce at the interval you specify.--subscription-toleranceโ set tolerance for subscription servers. Be patient with them ๐ซถ--unsubscribe-on-graceful-reloadโ force an unsubscribe request even during a graceful reload. No lingering subscriptions, periodt.--start-unsubscribedโ configure subscriptions but do not send them yet. Super useful with master fifo.--subscribe-with-modifier1โ force the specifiedmodifier1when subscribing.--snmpโ enable the embedded snmp server ๐--snmp-communityโ set the snmp community string.--ssl-verboseโ be verbose about SSL errors. Spill the tea on every handshake problem โ--ssl-verify-depthโ set the maximum certificate verification depth.--sniโ add an SNI-governed SSL context.--sni-dirโ check forcert/key/client_cafiles in the specified directory and create a sni/ssl context on demand ๐--sni-dir-ciphersโ set the ssl ciphers for thesni-diroption.--ssl-enable3โ > enable SSLv3. This one is insecure ๐จ you've been warned.--ssl-enable-sslv3โ > enable SSLv3 (insecure). Same warning, longer name.--ssl-enable-tlsv1โ > enable TLSv1. Also insecure. Proceed with caution, bestie.--ssl-optionโ set a raw ssl option, as a numeric value.--sni-regexpโ add an SNI-governed SSL context where the key is a regexp ๐ง--ssl-tmp-dirโ store ssl-related temp files in the directory you specify.--check-intervalโ set the interval, in seconds, of master checks.--forkbomb-delayโ when a forkbomb gets detected, sleep for the specified number of seconds ๐ด--binary-pathโ force the binary path.--privileged-binary-patchโ patch the uwsgi binary with a new command, and this happens before the privileges drop.--unprivileged-binary-patchโ patch the uwsgi binary with a new command, but this one runs after the privileges drop.--privileged-binary-patch-argโ patch the uwsgi binary with a new command and arguments, before privileges drop.--unprivileged-binary-patch-argโ patch the uwsgi binary with a new command and arguments, after privileges drop.--asyncโ enable async mode with the number of cores you specify โก--max-fdโ set the maximum number of file descriptors. > Requires root privileges ๐--logtoโ set the logfile or udp address.--logto2โ log to the specified file or udp address, but only after the privileges drop.--log-formatโ set an advanced format for request logging ๐--logformatโ set advanced format for request logging (the classic spelling).--logformat-strftimeโ applystrftimeto the logformat output.--log-format-strftimeโ applystrftimeto logformat output (dashed twin).--logfile-chownโchownyour logfiles.--logfile-chmodโchmodyour logfiles.--log-syslogโ log to syslog ๐ป--log-socketโ send logs to the socket you specify.--req-loggerโ set/append a request logger.--logger-reqโ set/append a request logger (same thing, flipped around).--loggerโ set/append a logger.--logger-listโ list the enabled loggers ๐--loggers-listโ list enabled loggers (plural, same list).--threaded-loggerโ offload log writing to a thread. Let the thread handle it ๐--log-encoderโ add an item in the log encoder chain.--log-req-encoderโ add an item in the log req encoder chain.--log-drainโ drain, meaning do not show, log lines matching the regexp you give ๐--log-filterโ show only the log lines matching the specified regexp.--log-routeโ log to the specified named logger if the regexp applied on the logline matches.--log-req-routeโ log requests to the specified named logger if the regexp applied on the logline matches.--use-abortโ callabort()on segfault/fpe. Could be useful for generating a core dump ๐--alarmโ create a new alarm. Syntax:<alarm> <plugin:args>
Okay so real talk bestie, we're deep in the option mines now and the alarm system is next up โ it's giving "uWSGI will text you when something goes wrong" energy and I'm obsessed. ๐ธ
--alarm-cheapโ use the main alarm thread instead of spinning up dedicated threads for curl-based alarms. Reuses the one thread, no new ones. Lowkey frugal queen ๐--alarm-freqโ tune the anti-loop alarm system (default3seconds)--alarm-fdโ raise the specified alarm when an fd is ready to read (by default it reads 1 byte, set8for eventfd)--alarm-segfaultโ raise the specified alarm when the segmentation fault handler is executed--segfault-alarmโ raise the specified alarm when the segmentation fault handler is executed (same thing, different font โจ)--alarm-backlogโ raise the specified alarm when the socket backlog queue is full--backlog-alarmโ raise the specified alarm when the socket backlog queue is full--lq-alarmโ raise the specified alarm when the socket backlog queue is full--alarm-lqโ raise the specified alarm when the socket backlog queue is full--alarm-listen-queueโ raise the specified alarm when the socket backlog queue is full--listen-queue-alarmโ raise the specified alarm when the socket backlog queue is full
Not me listing six whole flags that all do the exact same thing ๐ญ that's just how the listen-queue alarm rolls, bestie. Pick whichever spelling feels most like you, they're all going to the same place.
--log-alarmโ raise the specified alarm when a log line matches the specified regexp. Syntax:<alarm>[,alarm...] <regexp>--alarm-logโ raise the specified alarm when a log line matches the specified regexp. Syntax:<alarm>[,alarm...] <regexp>--not-log-alarmโ skip the specified alarm when a log line matches the specified regexp. Syntax:<alarm>[,alarm...] <regexp>--not-alarm-logโ skip the specified alarm when a log line matches the specified regexp. Syntax:<alarm>[,alarm...] <regexp>--alarm-listโ list enabled alarms ๐--alarms-listโ list enabled alarms (plural version, for the plural girlies)--alarm-msg-sizeโ set the max size of an alarm message (default8192)
Now we're onto logging, which is genuinely the main character of every debugging session, periodt. ๐
--log-masterโ delegate logging to the master process--log-master-bufsizeโ set the buffer size for the master logger. Bigger log messages will be truncated ๐--log-master-streamโ create the master logpipe asSOCK_STREAM--log-master-req-streamโ create the master requests logpipe asSOCK_STREAM--log-reopenโ reopen log after reload--log-truncateโ truncate log on startup--log-maxsizeโ set maximum logfile size--log-backupnameโ set logfile name after rotation--logdateโ prefix logs with date or astrftimestring--log-dateโ prefix logs with date or astrftimestring--log-prefixโ prefix logs with a string--log-zeroโ log responses without body--log-slowโ log requests slower than the specified number of milliseconds--log-4xxโ log requests with a 4xx response--log-5xxโ log requests with a 5xx response--log-bigโ log requests bigger than the specified size--log-sendfileโ log sendfile requests--log-ioerrorโ log requests with io errors--log-microsโ report response time in microseconds instead of milliseconds (tiny numbers, huge drama โจ)--log-x-forwarded-forโ use the ip fromX-Forwarded-Forheader instead ofREMOTE_ADDR
Privileges and directories, aka the "who am I and where am I standing" section ๐ฆ
--master-as-rootโ leave master process running as root--drop-after-initโ run privileges drop after plugin initialization, superseded bydrop-after-apps--drop-after-appsโ run privileges drop after apps loading, superseded bymaster-as-root--force-cwdโ force the initial working directory to the specified value--binshโ override/bin/sh(used by exec hooks, it always fallback to/bin/sh)--chdirโ chdir to specified directory before apps loading--chdir2โ chdir to specified directory after apps loading
Note the supersede chain, bestie โ--drop-after-initgets overridden bydrop-after-apps, anddrop-after-appsgets overridden bymaster-as-root. It's a whole succession drama. ๐
Worker spawning, lazy mode, and the cheaper family โ this is the load-management lore and honestly it ate ๐
--lazyโ set lazy mode (load apps in workers instead of master)--lazy-appsโ load apps in each worker instead of the master--cheapโ set cheap mode (spawn workers only after the first request)--cheaperโ set cheaper mode (adaptive process spawning)--cheaper-initialโ set the initial number of processes to spawn in cheaper mode--cheaper-algoโ choose to algorithm used for adaptive process spawning--cheaper-stepโ number of additional processes to spawn at each overload--cheaper-overloadโ increase workers after specified overload--cheaper-algo-listโ list enabled cheapers algorithms--cheaper-algos-listโ list enabled cheapers algorithms--cheaper-listโ list enabled cheapers algorithms--cheaper-rss-limit-softโ don't spawn new workers if total resident memory usage of all workers is higher than this limit--cheaper-rss-limit-hardโ if total workers resident memory usage is higher try to stop workers--idleโ set idle mode (put uWSGI in cheap mode after inactivity)--die-on-idleโ shutdown uWSGI when idle
Apps and mounting and threads, oh my ๐ง
--mountโ load application under mountpoint--worker-mountโ load application under mountpoint in the specified worker or after workers spawn--threadsโ run each worker in prethreaded mode with the specified number of threads--thread-stacksizeโ set threads stacksize--threads-stacksizeโ set threads stacksize--thread-stack-sizeโ set threads stacksize--threads-stack-sizeโ set threads stacksize
Four spellings of the thread stacksize flag. Four!! The way that uWSGI said "we'll accept literally any of these" and moved on ๐ Pick your fave, they're all valid.
--vhostโ enable virtualhosting mode (based onSERVER_NAMEvariable)--vhost-hostโ enable virtualhosting mode (based onHTTP_HOSTvariable)
Okay now the routing section, which is long and iconic and I need you to stay with me bestie, we're going the distance ๐
--routeโ add a route--route-hostโ add a route based onHostheader--route-uriโ add a route based onREQUEST_URI--route-qsโ add a route based onQUERY_STRING--route-remote-addrโ add a route based onREMOTE_ADDR--route-user-agentโ add a route based onHTTP_USER_AGENT--route-remote-userโ add a route based onREMOTE_USER--route-refererโ add a route based onHTTP_REFERER--route-labelโ add a routing label (for use with goto)--route-ifโ add a route based on condition--route-if-notโ add a route based on condition (negate version)--route-runโ always run the specified route action
Then the final routes, the ones that get the last word:
--final-routeโ add a final route--final-route-statusโ add a final route for the specified status--final-route-hostโ add a final route based onHostheader--final-route-uriโ add a final route based onREQUEST_URI--final-route-qsโ add a final route based onQUERY_STRING--final-route-remote-addrโ add a final route based onREMOTE_ADDR--final-route-user-agentโ add a final route based onHTTP_USER_AGENT--final-route-remote-userโ add a final route based onREMOTE_USER--final-route-refererโ add a final route based onHTTP_REFERER--final-route-labelโ add a final routing label (for use with goto)--final-route-ifโ add a final route based on condition--final-route-if-notโ add a final route based on condition (negate version)--final-route-runโ always run the specified final route action
Error routes next, for when things go sideways (and they will, no cap):
--error-routeโ add an error route--error-route-statusโ add an error route for the specified status--error-route-hostโ add an error route based onHostheader--error-route-uriโ add an error route based onREQUEST_URI--error-route-qsโ add an error route based onQUERY_STRING--error-route-remote-addrโ add an error route based onREMOTE_ADDR--error-route-user-agentโ add an error route based onHTTP_USER_AGENT--error-route-remote-userโ add an error route based onREMOTE_USER--error-route-refererโ add an error route based onHTTP_REFERER--error-route-labelโ add an error routing label (for use with goto)--error-route-ifโ add an error route based on condition--error-route-if-notโ add an error route based on condition (negate version)--error-route-runโ always run the specified error route action
And response routes, the ones that shape what the client actually gets back:
--response-routeโ add a response route--response-route-statusโ add a response route for the specified status--response-route-hostโ add a response route based onHostheader--response-route-uriโ add a response route based onREQUEST_URI--response-route-qsโ add a response route based onQUERY_STRING--response-route-remote-addrโ add a response route based onREMOTE_ADDR--response-route-user-agentโ add a response route based onHTTP_USER_AGENT--response-route-remote-userโ add a response route based onREMOTE_USER--response-route-refererโ add a response route based onHTTP_REFERER--response-route-labelโ add a response routing label (for use with goto)--response-route-ifโ add a response route based on condition--response-route-if-notโ add a response route based on condition (negate version)--response-route-runโ always run the specified response route action
See the pattern? Every routing family comes in the same shape: plain,-status,-host,-uri,-qs,-remote-addr,-user-agent,-remote-user,-referer,-label,-if,-if-not,-run. Once you clock the pattern you can basically speedrun the whole list ๐ฅ
--router-listโ list enabled routers--routers-listโ list enabled routers--error-page-403โ add an error page (html) for managed 403 response--error-page-404โ add an error page (html) for managed 404 response--error-page-500โ add an error page (html) for managed 500 response
Websockets and chunked input, the โจstreamingโจ era:
--websockets-ping-freqโ set the frequency (in seconds) of websockets automatic ping packets--websocket-ping-freqโ set the frequency (in seconds) of websockets automatic ping packets--websockets-pong-toleranceโ set the tolerance (in seconds) of websockets ping/pong subsystem--websocket-pong-toleranceโ set the tolerance (in seconds) of websockets ping/pong subsystem--websockets-max-sizeโ set the max allowed size of websocket messages (in Kbytes, default1024)--websocket-max-sizeโ set the max allowed size of websocket messages (in Kbytes, default1024)--chunked-input-limitโ set the max size of a chunked input part (default1MB, in bytes)--chunked-input-timeoutโ set default timeout for chunked input
And finally, the clocks ๐ฐ๏ธ โ yes, clock sources, because time is a construct and uWSGI still wants to know which one you're using:
--clockโ set a clock source--clock-listโ list enabled clocks
Bestie, if you've made it this far you are genuinely built different ๐ We are not done yet though โ more is coming, so don't go anywhere.
--clocks-listโ list enabled clocks. show me the clocks bestie โฐโจ--add-headerโ automatically add HTTP headers to response. it just slides them in there ๐--rem-headerโ automatically remove specified HTTP header from the response. bye bye header ๐ซถ--del-headerโ automatically remove specified HTTP header from the response. same remove-the-header energy, different name fr fr--collect-headerโ store the specified response header in a request var (syntax:header var). save that header for later ๐ฅ--response-header-collectโ store the specified response header in a request var (syntax:header var). twin flame behavior ๐--pull-headerโ store the specified response header in a request var and remove it from the response (syntax:header var). snatch it, stash it, and yeet it from the response ๐งฒ--check-staticโ check for static files in the specified directory. static file vibe check ๐--check-static-docrootโ check for static files in the requestedDOCUMENT_ROOT. it looks where the request says ๐--static-checkโ check for static files in the specified directory. same static check, living its truth ๐ซ--static-mapโ map mountpoint to static directory (or file). map it, slay it ๐บ๏ธ--static-map2โ likestatic-mapbut completely appending the requested resource to the docroot. extra append energy โจ--static-skip-extโ skip specified extension from staticfile checks. not today, extension ๐ โโ๏ธ--static-indexโ search for specified file if a directory is requested. directory requested? go find the index bestie ๐--static-safeโ skip security checks if the file is under the specified path. trusted path, no security check needed ๐--static-cache-pathsโ put resolved paths in the uWSGI cache for the specified amount of seconds. cache those paths for N seconds โณ--static-cache-paths-nameโ use the specified cache for static paths. name that cache ๐ท๏ธ--mimefileโ set mime types file path (default/etc/mime.types). mime file location, default is iconic ๐--mime-fileโ set mime types file path (default/etc/mime.types). same but with a hyphen, periodt ๐--static-expires-typeโ set theExpiresheader based on content type. expire by content type โฐ--static-expires-type-mtimeโ set theExpiresheader based on content type and file mtime. content type + mtime = expiration math ๐งฎ--static-expiresโ set theExpiresheader based on filename regexp. filename regexp decidesExpires๐ฅ--static-expires-mtimeโ set theExpiresheader based on filename regexp and file mtime. filename regexp + mtime, combo meal ๐--static-expires-uriโ set theExpiresheader based onREQUEST_URIregexp.REQUEST_URIregexp forExpires๐--static-expires-uri-mtimeโ set theExpiresheader based onREQUEST_URIregexp and file mtime.REQUEST_URIregexp + mtime, yes maโam ๐ซก--static-expires-path-infoโ set theExpiresheader based onPATH_INFOregexp.PATH_INFOregexp forExpires๐ฃ๏ธ--static-expires-path-info-mtimeโ set theExpiresheader based onPATH_INFOregexp and file mtime.PATH_INFOregexp + mtime, the full package ๐ฆ--static-gzipโ if the supplied regexp matches the static file translation it will search for a gzip version. regexp match? go find the gzip twin ๐๏ธ--static-gzip-allโ check for a gzip version of all requested static files. every static file gets a gzip check, all of them ๐ฏ--static-gzip-dirโ check for a gzip version of all requested static files in the specified dir/prefix. gzip check in that dir/prefix ๐--static-gzip-prefixโ check for a gzip version of all requested static files in the specified dir/prefix. same as--static-gzip-dir, just named prefix ๐ซ--static-gzip-extโ check for a gzip version of all requested static files with the specified ext/suffix. gzip check with that ext/suffix ๐--static-gzip-suffixโ check for a gzip version of all requested static files with the specified ext/suffix. ext/suffix twin, same vibe ๐ช--honour-rangeโ enable support for the HTTPRangeheader. range requests? honoured, bestie ๐ฏ--offload-threadsโ set the number of offload threads to spawn (per-worker, default0). offload threads, per-worker, default0๐งต--offload-threadโ set the number of offload threads to spawn (per-worker, default0). singular name, same setting, no cap ๐งถ--file-serve-modeโ set static file serving mode. pick your file serving mode ๐๏ธ--fileserve-modeโ set static file serving mode. same mode, no hyphen needed ๐--disable-sendfileโ disablesendfile()and rely on boringread()/write(). goodbyesendfile(), hello old-schoolread()/write()๐ด--check-cacheโ check for response data in the specified cache (empty for default cache). look in that cache, empty means default ๐ต๏ธโโ๏ธ--close-on-execโ set close-on-exec on connection sockets (could be required for spawning processes in requests). connection sockets get close-on-exec, maybe needed for spawning in requests ๐ช--close-on-exec2โ set close-on-exec on server sockets (could be required for spawning processes in requests). server sockets this time, same maybe-needed energy ๐ฅ๏ธ--modeโ set uWSGI custom mode. custom mode activated ๐--envโ set environment variable. env var, set it ๐ฑ--envdirโ load a daemontools compatible envdir. daemontools-compatible envdir loading ๐--early-envdirโ load a daemontools compatible envdir ASAP. same but ASAP, no waiting โก--unenvโ unset environment variable. unset that env var, bye ๐--vacuumโ try to remove all of the generated file/sockets. try to clean up generated files/sockets ๐งน--file-writeโ write the specified content to the specified file (syntax:file=value) before privileges drop. writefile=valuebefore privileges drop โ๏ธ--cgroupโ put the processes in the specified cgroup. cgroup placement, slay ๐งบ--cgroup-optโ set value in specified cgroup option. set that cgroup option value ๐๏ธ--cgroup-dir-modeโ set permission for cgroup directory (default is700). cgroup dir permission, default700๐--namespaceโ run in a new namespace under the specified rootfs. new namespace under that rootfs ๐--namespace-keep-mountโ keep the specified mountpoint in your namespace. keep that mountpoint in your namespace ๐๏ธ--nsโ run in a new namespace under the specified rootfs. short king--ns, same namespace energy ๐--namespace-netโ add network namespace. add a network namespace ๐--ns-netโ add network namespace. network namespace, short name edition ๐ก--enable-proxy-protocolโ enablePROXY1protocol support (only for http parsers).PROXY1support, but only for http parsers ๐งผ--reuse-portโ enableREUSE_PORTflag on socket (BSD only).REUSE_PORTon socket, BSD only ๐ก--tcp-fast-openโ enableTCP_FASTOPENflag on TCP sockets with the specified qlen value.TCP_FASTOPENwith that qlen value ๐--tcp-fastopenโ enableTCP_FASTOPENflag on TCP sockets with the specified qlen value. no hyphen, same fast open vibe ๐จ--tcp-fast-open-clientโ usesendto(..., MSG_FASTOPEN, ...)instead ofconnect()if supported. client side usessendto(..., MSG_FASTOPEN, ...)instead ofconnect()when supported ๐งฒ--tcp-fastopen-clientโ usesendto(..., MSG_FASTOPEN, ...)instead ofconnect()if supported. same thing, hyphenless name ๐ช--zergโ attach to a zerg server. zerg rush, attach ๐--zerg-fallbackโ fallback to normal sockets if the zerg server is not available. no zerg server? fallback to normal sockets ๐--zerg-serverโ enable the zerg server on the specified UNIX socket. zerg server on that UNIX socket ๐--cronโ add a cron task. cron task added โฐ--cron2โ add a cron task (key=val syntax). cron task withkey=valsyntax ๐--unique-cronโ add a unique cron task. unique cron task, one of a kind ๐--cron-harakiriโ set the maximum time (in seconds) we wait for cron command to complete. cron harakiri timeout in seconds โณ--legion-cronโ add a cron task runnable only when the instance is a lord of the specified legion. legion cron, only for the lord of that legion ๐--cron-legionโ add a cron task runnable only when the instance is a lord of the specified legion. same legion lord cron, different name ๐ฐ--unique-legion-cronโ add a unique cron task runnable only when the instance is a lord of the specified legion. unique + legion + cron, triple threat ๐--unique-cron-legionโ add a unique cron task runnable only when the instance is a lord of the specified legion. same as above, name flipped ๐--loopโ select the uWSGI loop engine. pick your loop engine ๐--loop-listโ list enabled loop engines. show me the loop engines ๐--loops-listโ list enabled loop engines. pluralloops, same list ๐ช--worker-execโ run the specified command as worker. worker runs that command ๐--worker-exec2โ run the specified command as worker (afterpost_forkhook). same but afterpost_forkhook ๐ช--attach-daemonโ attach a command/daemon to the master process (the command has to not go in background). attach daemon to master, command has to not go in background ๐งท--attach-control-daemonโ attach a command/daemon to the master process (the command has to not go in background), when the daemon dies, the master dies too. if daemon dies, master dies too ๐--smart-attach-daemonโ attach a command/daemon to the master process managed by a pidfile (the command has to daemonize). smart attach with pidfile, command has to daemonize ๐ง--smart-attach-daemon2โ attach a command/daemon to the master process managed by a pidfile (the command has to NOT daemonize). pidfile managed, but command has to NOT daemonize ๐ซ--legion-attach-daemonโ same as--attach-daemonbut daemon runs only on legion lord node. legion lord only daemon ๐--legion-smart-attach-daemonโ same as--smart-attach-daemonbut daemon runs only on legion lord node. smart + legion lord only ๐ง ๐--legion-smart-attach-daemon2โ same as--smart-attach-daemon2but daemon runs only on legion lord node. smart2 + legion lord only ๐ง ๐2--daemons-honour-stdinโ do not change the stdin of external daemons to/dev/null. leave external daemon stdin alone, donโt send it to/dev/null๐--attach-daemon2โ attach-daemon keyval variant (supports smart modes too). keyval attach-daemon, smart modes supported too ๐๏ธ--pluginsโ load uWSGI plugins. load those plugins ๐งฉ--pluginโ load uWSGI plugins. singular plugin, same loading ๐งฉ--need-pluginsโ load uWSGI plugins (exit on error). need plugins, exit on error ๐ช--need-pluginโ load uWSGI plugins (exit on error). singular need plugin, exit on error ๐ช--plugins-dirโ add a directory to uWSGI plugin search path. add plugin search path dir ๐--plugin-dirโ add a directory to uWSGI plugin search path. singular plugin dir, same path ๐--plugins-listโ list enabled plugins. list plugins ๐--plugin-listโ list enabled plugins. singular plugin list, same list ๐--autoloadโ try to automatically load plugins when unknown options are found. unknown option? try autoloading plugins ๐ค--dlopenโ blindly load a shared library. blindly load that shared library ๐--allowed-modifiersโ comma separated list of allowed modifiers. allowed modifiers, comma separated ๐งพ--remap-modifierโ remap request modifier from one id to another. remap modifier id to another ๐--dump-optionsโ dump the full list of available options. dump all the options ๐ฆ--show-configโ show the current config reformatted as ini. show config asini๐--binary-append-dataโ return the content of a resource to stdout for appending to a uwsgi binary (fordata://usage). stdout content for appending to uwsgi binary, fordata://usage ๐งฌ--printโ simple print. simple print ๐จ๏ธ--iprintโ simple print (immediate version). simple print but immediate โก--exitโ forceexit()of the instance. forceexit()on the instance ๐ช--cflagsโ report uWSGICFLAGS(useful for building external plugins). reportCFLAGS, useful for external plugins ๐ง--dot-hโ dump theuwsgi.hused for building the core (useful for building external plugins). dumpuwsgi.h, useful for external plugins ๐--config-pyโ dump theuwsgiconfig.pyused for building the core (useful for building external plugins). dumpuwsgiconfig.py, useful for external plugins ๐--build-pluginโ build a uWSGI plugin for the current binary. build a plugin for current binary ๐จ--versionโ print uWSGI version. print version ๐ท๏ธ--response-headers-limitโ set response header maximum size (default:64k). response header max size, default64k๐
and thatโs the whole options buffet, bestie ๐ this page was from uwsgi-core 2.0.31-debian, dated January 2026, and itโs UWSGI-CORE(1) โ periodt. โจ๐ซถ
๐ฆ where this page comes from
- ubuntu resolute: uwsgi-core 2.0.31-2 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms