Wiki

Clone wiki

superfcgi / Home

SuperFCGI

Usage: superfcgi [options]

Options:

  -h, --help            show this help message and exit
  -a APP, --app=APP     import string for wsgi app
  -s SOCKET, --socket=SOCKET
                        unix socket or ip:port
  -w WORKERS, --workers=WORKERS
                        number of superfcgi workers, default is 4
  -t THREADS, --threads=THREADS
                        number of threads inside each worker, default is 10
  -b BACKLOG, --backlog=BACKLOG
                        backlog size, default is 128
  -p PATH, --path=PATH  optional path should be added in sys.path
  -l logfile, --log=logfile  optional file which will recive all logging messages
  -d BOOL --daemonaze BOOL optional flag, which make current pocess a daemon
  --pidfile FILE used with "daemonize" option, keep pid of daemon process

Example:

$ superfcgi --workers 4 --threads 10 --app my_module.wsgi_app --socket 127.0.0.1:9999

will fork 4 times, import wsgi_app from my_module, run 10 threads in each process and listen to fastcgi connections on 127.0.0.1:9999

$ superfcgi --workers 4 --threads 10 --app my_module.wsgi_app --socket fcgi.sock --daemonize true --log fcgi.log --pidfile fcgi.pid

become a daemon and will fork 4 times, import wsgi_app from my_module, run 10 threads in each process and listen to fastcgi connections on fcgi.sock, all logging will be redirect to fcgi.log file

Django support

may fail on OSX with "symbol not found _environ". it's bug in fcgi (fcgi_stdio.c)

@@ -30,6 +30,10 @@
 #define DLLAPI  __declspec(dllexport)
 #endif
 
+#ifdef __APPLE__
+#define environ (*_NSGetEnviron())
+#endif
+
 #include "fcgiapp.h"
 #include "fcgios.h"
 #include "fcgimisc.h"

should help

Updated