|
@@ -44,7 +44,11 @@
|
44
|
44
|
|
45
|
45
|
/**@defgroup ret_status Function & process return status
|
46
|
46
|
*/
|
|
47
|
+/**@ingroup ret_status */
|
|
48
|
+#define EXIT_PYERR 4
|
|
49
|
+/**@ingroup ret_status */
|
47
|
50
|
#define PYFCGI_TIMEOUT 8
|
|
51
|
+/**@ingroup ret_status */
|
48
|
52
|
#define PYFCGI_ERR 16
|
49
|
53
|
/**@ingroup ret_status */
|
50
|
54
|
#define PYFCGI_WORKER_FAIL 32
|
|
@@ -53,11 +57,9 @@
|
53
|
57
|
/**@ingroup ret_status */
|
54
|
58
|
#define PYFCGI_FATAL 128
|
55
|
59
|
|
56
|
|
-#define EXIT_PYERR 42
|
57
|
|
-
|
58
|
60
|
#define PYFCGI_NAME "spawn-fcgi [OPTIONS] -- pyfcgi"
|
59
|
61
|
|
60
|
|
-#define PYFCGI_SHORT_OPT "Ce:E:Aw:W:m:L:SvVh"
|
|
62
|
+#define PYFCGI_SHORT_OPT "Ce:E:Aw:W:m:ft:L:SvVh"
|
61
|
63
|
|
62
|
64
|
#define PYFCGI_LONG_OPT { \
|
63
|
65
|
{"config", required_argument, 0, 'C'},\
|
|
@@ -67,6 +69,8 @@
|
67
|
69
|
{"min-worker", required_argument, 0, 'w'},\
|
68
|
70
|
{"max-worker", required_argument, 0, 'W'},\
|
69
|
71
|
{"max-request", required_argument, 0, 'm'},\
|
|
72
|
+ {"fast-spawn", no_argument, 0, 'f'},\
|
|
73
|
+ {"timeout", required_argument, 0, 't'},\
|
70
|
74
|
{"log", required_argument, 0, 'L'},\
|
71
|
75
|
{"syslog", no_argument, 0, 'S'},\
|
72
|
76
|
{"pid-file", required_argument, 0, 'P'},\
|
|
@@ -84,6 +88,8 @@
|
84
|
88
|
{"Minimum worker in the pool", "INT"},\
|
85
|
89
|
{"Maximum worker in the pool", "INT"},\
|
86
|
90
|
{"Request count after wich the worker is restarted (if 0 never restart)", "INT"},\
|
|
91
|
+ {"If not given there is at least 1s between 2 child creation, else childs may be spawned in small burst", NULL},\
|
|
92
|
+ {"Request timeout (before worker restarts)", "SECONDS"},\
|
87
|
93
|
{"Add a logfile using syntax : 'LOGFILE[;FILT][;FMT]'", "LOGGER_SPEC"},\
|
88
|
94
|
{"Use syslog for logging", NULL},\
|
89
|
95
|
{"Create a PID file", "FILENAME"},\
|
|
@@ -181,15 +187,26 @@ struct pyfcgi_conf_s
|
181
|
187
|
* @ingroup conf_glob */
|
182
|
188
|
int max_reqs;
|
183
|
189
|
|
|
190
|
+ //Pool handling conf
|
|
191
|
+ /**@brief Idle timeout : starts GC workers after Xs idle */
|
|
192
|
+ time_t worker_gc_timeout;
|
|
193
|
+ /**@brief Fast spawn : if 1 spawn more childs faster
|
|
194
|
+ *
|
|
195
|
+ * When not activated there is at least 1s between 2 child creation,
|
|
196
|
+ * else child are created in small burst ( ~2 childs burst)
|
|
197
|
+ */
|
|
198
|
+ short worker_fast_spawn;
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+ //watchdogs config
|
184
|
202
|
/**@brief Worker timeout in seconds (if 0 no timeout)*/
|
185
|
203
|
time_t worker_timeout;
|
186
|
|
-
|
187
|
204
|
/**@brief Pool timeout in seconds (if 0 no timeout)*/
|
188
|
205
|
time_t pool_timeout;
|
189
|
206
|
|
|
207
|
+ // logger config
|
190
|
208
|
/**@brief 0 is silent 1 means logs to stderr */
|
191
|
209
|
short verbosity;
|
192
|
|
-
|
193
|
210
|
/**@brief Logger configuration
|
194
|
211
|
* @ingroupe conf_glob */
|
195
|
212
|
pyfcgi_conf_logger_t logs;
|
|
@@ -233,4 +250,10 @@ int pyfcgi_wd_stop();
|
233
|
250
|
/**@brief Watchdog default signal handler */
|
234
|
251
|
void pyfcgi_wd_default_sighandler(int signum);
|
235
|
252
|
|
|
253
|
+/**@brief Return a string representing a status
|
|
254
|
+ * @param int status
|
|
255
|
+ * @return a char* that should be freed
|
|
256
|
+ */
|
|
257
|
+char *status2str(int);
|
|
258
|
+
|
236
|
259
|
#endif
|