added --processes auto

This commit is contained in:
roberto@longshot
2011-02-26 20:28:26 +01:00
parent a10e67538a
commit 2c19a031c7
4 changed files with 29 additions and 48 deletions
+4 -9
View File
@@ -1,28 +1,23 @@
[uwsgi]
xml = true
ini = true
yaml = true
snmp = false
sctp = false
erlang = false
spooler = true
embedded = true
udp = false
udp = true
multicast = false
threading = true
sendfile = true
nagios = false
proxy = false
minterpreters = true
async = true
http = false
evdis = false
ldap = false
routing = false
stackless = false
ldap = true
debug = false
unbit = true
xml_implementation = libxml2
plugins =
bin_name = /opt/unbit/bin/uwsgi
plugin_dir = /opt/unbit/uwsgi_plugins
embedded_plugins = python
embedded_plugins =
-37
View File
@@ -44,8 +44,6 @@ void uwsgi_ldap_schema_dump_ldif() {
int i;
int counter = 30000;
int pythonpath_found = 0;
uwsgi_log("\n");
uwsgi_log("dn: cn=uwsgi,cn=schema,cn=config\n");
uwsgi_log("objectClass: olcSchemaConfig\n");
@@ -55,13 +53,6 @@ void uwsgi_ldap_schema_dump_ldif() {
if (!aopt->name)
break;
if (aopt->val == LONG_ARGS_PYTHONPATH) {
if (pythonpath_found) {
goto next;
}
pythonpath_found = 1;
}
if (aopt->flag) {
uwsgi_log("olcAttributeTypes: ( 1.3.6.1.4.1.35156.17.4.%d NAME 'uWSGI", counter);
counter++;
@@ -85,7 +76,6 @@ void uwsgi_ldap_schema_dump_ldif() {
else {
uwsgi_log("' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 )\n");
}
next:
lopt++;
}
@@ -95,18 +85,10 @@ next:
uwsgi_log("olcObjectClasses: ( 1.3.6.1.4.1.35156.17.3.1 NAME 'uWSGIConfig' SUP top AUXILIARY DESC 'uWSGI configuration' MAY ( ");
pythonpath_found = 0;
while( (aopt = lopt) ) {
if (!aopt->name)
break;
if (aopt->val == LONG_ARGS_PYTHONPATH) {
if (pythonpath_found) {
goto next2;
}
pythonpath_found = 1;
}
uwsgi_log("uWSGI");
for(i=0;i< (int)strlen(aopt->name);i++) {
@@ -119,7 +101,6 @@ next:
}
}
uwsgi_log(" $ ");
next2:
lopt++;
}
@@ -136,20 +117,12 @@ void uwsgi_ldap_schema_dump() {
lopt = uwsgi.long_options;
int i;
int counter = 30000;
int pythonpath_found = 0;
while( (aopt = lopt) ) {
if (!aopt->name)
break;
if (aopt->val == LONG_ARGS_PYTHONPATH) {
if (pythonpath_found) {
goto next;
}
pythonpath_found = 1;
}
if (aopt->flag) {
uwsgi_log("attributetype ( 1.3.6.1.4.1.35156.17.4.%d NAME 'uWSGI", counter);
counter++;
@@ -173,7 +146,6 @@ void uwsgi_ldap_schema_dump() {
else {
uwsgi_log("' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 )\n");
}
next:
lopt++;
}
@@ -183,18 +155,10 @@ next:
uwsgi_log("objectclass ( 1.3.6.1.4.1.35156.17.3.1 NAME 'uWSGIConfig' SUP top AUXILIARY DESC 'uWSGI configuration' MAY ( ");
pythonpath_found = 0;
while( (aopt = lopt) ) {
if (!aopt->name)
break;
if (aopt->val == LONG_ARGS_PYTHONPATH) {
if (pythonpath_found) {
goto next2;
}
pythonpath_found = 1;
}
uwsgi_log("uWSGI");
for(i=0;i< (int)strlen(aopt->name);i++) {
@@ -207,7 +171,6 @@ next:
}
}
uwsgi_log(" $ ");
next2:
lopt++;
}
+3 -1
View File
@@ -154,10 +154,10 @@ void master_loop(char **argv, char **environ) {
int udp_managed = 0;
int udp_fd = -1 ;
#ifdef UWSGI_MULTICAST
char *cluster_opt_buf = NULL;
int cluster_opt_size = 4;
#ifdef UWSGI_MULTICAST
char *cptrbuf;
uint16_t ustrlen;
struct uwsgi_header *uh;
@@ -561,6 +561,7 @@ void master_loop(char **argv, char **environ) {
continue;
}
#ifdef UWSGI_MULTICAST
if (interesting_fd == uwsgi.cluster_fd) {
if (uwsgi_get_dgram(uwsgi.cluster_fd, uwsgi.wsgi_requests[0])) {
@@ -596,6 +597,7 @@ void master_loop(char **argv, char **environ) {
}
continue;
}
#endif
#endif
+22 -1
View File
@@ -2126,7 +2126,28 @@ end:
uwsgi.vec_size = 4 + 1 + (4 * uwsgi.max_vars);
return 1;
case 'p':
uwsgi.numproc = atoi(optarg);
if (!strcmp(optarg, "auto")) {
struct rlimit rl;
if (getrlimit(RLIMIT_NPROC, &rl)) {
uwsgi_error("getrlimit()");
uwsgi.numproc = 1;
}
else {
if (rl.rlim_cur == RLIM_INFINITY || rl.rlim_cur > 64) {
uwsgi.numproc = (sysconf(_SC_NPROCESSORS_ONLN))*2;
}
else {
uwsgi.numproc = rl.rlim_cur;
if (uwsgi.numproc > 1) {
uwsgi.numproc--;
uwsgi.master_process = 1;
}
}
}
}
else {
uwsgi.numproc = atoi(optarg);
}
return 1;
case 'r':
uwsgi.shared->options[UWSGI_OPTION_REAPER] = 1;