Fossil SCM

Add the "max-loadavg" setting to the "setting" command. Add "setting" and "unset" to the "all" command so that max-loadavg can be quickly changed on all repos of a large server installation.

drh 2014-03-09 23:04 trunk
Commit 1847552c9239682f937d4905980d7c71ebd0fba8
2 files changed +17 +8
--- src/allrepo.c
+++ src/allrepo.c
@@ -65,10 +65,16 @@
6565
}else{
6666
blob_appendf(pExtra, " --%s \"\"", zArg);
6767
}
6868
}
6969
}
70
+static void collect_argv(Blob *pExtra, int iStart){
71
+ int i;
72
+ for(i=iStart; i<g.argc; i++){
73
+ blob_appendf(pExtra, " %s", g.argv[i]);
74
+ }
75
+}
7076
7177
7278
/*
7379
** COMMAND: all
7480
**
@@ -118,10 +124,15 @@
118124
** present, are passed along verbatim. The --force and
119125
** --randomize options are not supported.
120126
**
121127
** sync Run a "sync" on all repositories. Only the --verbose
122128
** option is supported.
129
+**
130
+** setting Run the "setting", "set", or "unset" commands on all
131
+** set repositories. These command are particularly useful in
132
+** unset conjunection with the "max-loadavg" setting which cannot
133
+** otherwise be set globally.
123134
**
124135
** Repositories are automatically added to the set of known repositories
125136
** when one of the following commands are run against the repository:
126137
** clone, info, pull, push, or sync. Even previously ignored repositories
127138
** are added back to the list of repositories by these commands.
@@ -201,10 +212,16 @@
201212
collect_argument(&extra, "vacuum",0);
202213
collect_argument(&extra, "deanalyze",0);
203214
collect_argument(&extra, "analyze",0);
204215
collect_argument(&extra, "wal",0);
205216
collect_argument(&extra, "stats",0);
217
+ }else if( strncmp(zCmd, "setting", n)==0 ){
218
+ zCmd = "setting -R";
219
+ collect_argv(&extra, 3);
220
+ }else if( strncmp(zCmd, "unset", n)==0 ){
221
+ zCmd = "unset -R";
222
+ collect_argv(&extra, 3);
206223
}else if( strncmp(zCmd, "sync", n)==0 ){
207224
zCmd = "sync -autourl -R";
208225
collect_argument(&extra, "verbose","v");
209226
}else if( strncmp(zCmd, "test-integrity", n)==0 ){
210227
collect_argument(&extra, "parse", 0);
211228
--- src/allrepo.c
+++ src/allrepo.c
@@ -65,10 +65,16 @@
65 }else{
66 blob_appendf(pExtra, " --%s \"\"", zArg);
67 }
68 }
69 }
 
 
 
 
 
 
70
71
72 /*
73 ** COMMAND: all
74 **
@@ -118,10 +124,15 @@
118 ** present, are passed along verbatim. The --force and
119 ** --randomize options are not supported.
120 **
121 ** sync Run a "sync" on all repositories. Only the --verbose
122 ** option is supported.
 
 
 
 
 
123 **
124 ** Repositories are automatically added to the set of known repositories
125 ** when one of the following commands are run against the repository:
126 ** clone, info, pull, push, or sync. Even previously ignored repositories
127 ** are added back to the list of repositories by these commands.
@@ -201,10 +212,16 @@
201 collect_argument(&extra, "vacuum",0);
202 collect_argument(&extra, "deanalyze",0);
203 collect_argument(&extra, "analyze",0);
204 collect_argument(&extra, "wal",0);
205 collect_argument(&extra, "stats",0);
 
 
 
 
 
 
206 }else if( strncmp(zCmd, "sync", n)==0 ){
207 zCmd = "sync -autourl -R";
208 collect_argument(&extra, "verbose","v");
209 }else if( strncmp(zCmd, "test-integrity", n)==0 ){
210 collect_argument(&extra, "parse", 0);
211
--- src/allrepo.c
+++ src/allrepo.c
@@ -65,10 +65,16 @@
65 }else{
66 blob_appendf(pExtra, " --%s \"\"", zArg);
67 }
68 }
69 }
70 static void collect_argv(Blob *pExtra, int iStart){
71 int i;
72 for(i=iStart; i<g.argc; i++){
73 blob_appendf(pExtra, " %s", g.argv[i]);
74 }
75 }
76
77
78 /*
79 ** COMMAND: all
80 **
@@ -118,10 +124,15 @@
124 ** present, are passed along verbatim. The --force and
125 ** --randomize options are not supported.
126 **
127 ** sync Run a "sync" on all repositories. Only the --verbose
128 ** option is supported.
129 **
130 ** setting Run the "setting", "set", or "unset" commands on all
131 ** set repositories. These command are particularly useful in
132 ** unset conjunection with the "max-loadavg" setting which cannot
133 ** otherwise be set globally.
134 **
135 ** Repositories are automatically added to the set of known repositories
136 ** when one of the following commands are run against the repository:
137 ** clone, info, pull, push, or sync. Even previously ignored repositories
138 ** are added back to the list of repositories by these commands.
@@ -201,10 +212,16 @@
212 collect_argument(&extra, "vacuum",0);
213 collect_argument(&extra, "deanalyze",0);
214 collect_argument(&extra, "analyze",0);
215 collect_argument(&extra, "wal",0);
216 collect_argument(&extra, "stats",0);
217 }else if( strncmp(zCmd, "setting", n)==0 ){
218 zCmd = "setting -R";
219 collect_argv(&extra, 3);
220 }else if( strncmp(zCmd, "unset", n)==0 ){
221 zCmd = "unset -R";
222 collect_argv(&extra, 3);
223 }else if( strncmp(zCmd, "sync", n)==0 ){
224 zCmd = "sync -autourl -R";
225 collect_argument(&extra, "verbose","v");
226 }else if( strncmp(zCmd, "test-integrity", n)==0 ){
227 collect_argument(&extra, "parse", 0);
228
+8
--- src/db.c
+++ src/db.c
@@ -2147,10 +2147,11 @@
21472147
{ "ignore-glob", 0, 40, 1, 0, "" },
21482148
{ "keep-glob", 0, 40, 1, 0, "" },
21492149
{ "localauth", 0, 0, 0, 0, "off" },
21502150
{ "main-branch", 0, 40, 0, 0, "trunk" },
21512151
{ "manifest", 0, 0, 1, 0, "off" },
2152
+ { "max-loadavg", 0, 25, 0, 0, "0.0" },
21522153
{ "max-upload", 0, 25, 0, 0, "250000" },
21532154
{ "mtime-changes", 0, 0, 0, 0, "on" },
21542155
{ "pgp-command", 0, 40, 0, 0, "gpg --clearsign -o " },
21552156
{ "proxy", 0, 32, 0, 0, "off" },
21562157
{ "relative-paths", 0, 0, 0, 0, "on" },
@@ -2296,10 +2297,17 @@
22962297
** main-branch The primary branch for the project. Default: trunk
22972298
**
22982299
** manifest If enabled, automatically create files "manifest" and
22992300
** (versionable) "manifest.uuid" in every checkout. The SQLite and
23002301
** Fossil repositories both require this. Default: off.
2302
+**
2303
+** max-loadavg Some CPU-intensive web pages (ex: /zip, /tarball, /blame)
2304
+** are disallowed if the system load average goes above this
2305
+** value. "0.0" means no limit. This only works on unix.
2306
+** Only local settings of this value make a difference since
2307
+** when running as a web-server, Fossil does not open the
2308
+** global configuration database.
23012309
**
23022310
** max-upload A limit on the size of uplink HTTP requests. The
23032311
** default is 250000 bytes.
23042312
**
23052313
** mtime-changes Use file modification times (mtimes) to detect when
23062314
--- src/db.c
+++ src/db.c
@@ -2147,10 +2147,11 @@
2147 { "ignore-glob", 0, 40, 1, 0, "" },
2148 { "keep-glob", 0, 40, 1, 0, "" },
2149 { "localauth", 0, 0, 0, 0, "off" },
2150 { "main-branch", 0, 40, 0, 0, "trunk" },
2151 { "manifest", 0, 0, 1, 0, "off" },
 
2152 { "max-upload", 0, 25, 0, 0, "250000" },
2153 { "mtime-changes", 0, 0, 0, 0, "on" },
2154 { "pgp-command", 0, 40, 0, 0, "gpg --clearsign -o " },
2155 { "proxy", 0, 32, 0, 0, "off" },
2156 { "relative-paths", 0, 0, 0, 0, "on" },
@@ -2296,10 +2297,17 @@
2296 ** main-branch The primary branch for the project. Default: trunk
2297 **
2298 ** manifest If enabled, automatically create files "manifest" and
2299 ** (versionable) "manifest.uuid" in every checkout. The SQLite and
2300 ** Fossil repositories both require this. Default: off.
 
 
 
 
 
 
 
2301 **
2302 ** max-upload A limit on the size of uplink HTTP requests. The
2303 ** default is 250000 bytes.
2304 **
2305 ** mtime-changes Use file modification times (mtimes) to detect when
2306
--- src/db.c
+++ src/db.c
@@ -2147,10 +2147,11 @@
2147 { "ignore-glob", 0, 40, 1, 0, "" },
2148 { "keep-glob", 0, 40, 1, 0, "" },
2149 { "localauth", 0, 0, 0, 0, "off" },
2150 { "main-branch", 0, 40, 0, 0, "trunk" },
2151 { "manifest", 0, 0, 1, 0, "off" },
2152 { "max-loadavg", 0, 25, 0, 0, "0.0" },
2153 { "max-upload", 0, 25, 0, 0, "250000" },
2154 { "mtime-changes", 0, 0, 0, 0, "on" },
2155 { "pgp-command", 0, 40, 0, 0, "gpg --clearsign -o " },
2156 { "proxy", 0, 32, 0, 0, "off" },
2157 { "relative-paths", 0, 0, 0, 0, "on" },
@@ -2296,10 +2297,17 @@
2297 ** main-branch The primary branch for the project. Default: trunk
2298 **
2299 ** manifest If enabled, automatically create files "manifest" and
2300 ** (versionable) "manifest.uuid" in every checkout. The SQLite and
2301 ** Fossil repositories both require this. Default: off.
2302 **
2303 ** max-loadavg Some CPU-intensive web pages (ex: /zip, /tarball, /blame)
2304 ** are disallowed if the system load average goes above this
2305 ** value. "0.0" means no limit. This only works on unix.
2306 ** Only local settings of this value make a difference since
2307 ** when running as a web-server, Fossil does not open the
2308 ** global configuration database.
2309 **
2310 ** max-upload A limit on the size of uplink HTTP requests. The
2311 ** default is 250000 bytes.
2312 **
2313 ** mtime-changes Use file modification times (mtimes) to detect when
2314

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button