Permalink
Browse files

Settings tweaks

  • Loading branch information...
1 parent bc41132 commit 6795eb5ad13a7301e413603cecaae603ed27d8f7 @lmorchard lmorchard committed May 13, 2014
Showing with 8 additions and 6 deletions.
  1. +2 −1 lib/kumascript/macros.js
  2. +3 −2 lib/kumascript/server.js
  3. +3 −3 run.js
View
3 lib/kumascript/macros.js
@@ -51,7 +51,7 @@ var MacroProcessor = ks_utils.Class(EventEmitter, {
},
memcache: null,
// Max number of macro workers
- numWorkers: 16,
+ numWorkers: 4,
// Max number of concurrent macro processing jobs per request.
workerConcurrency: 4,
// Max number of jobs handled by a worker before exit
@@ -74,6 +74,7 @@ var MacroProcessor = ks_utils.Class(EventEmitter, {
max_processes: this.options.numWorkers,
max_jobs_per_process: this.options.workerMaxJobs,
retries: this.options.workerRetries,
+ timeout_working: this.options.workerTimeout,
options: {
autorequire: this.options.autorequire,
loader: this.options.loader,
View
5 lib/kumascript/server.js
@@ -57,7 +57,7 @@ var Server = ks_utils.Class({
// Max number of jobs handled by a worker before exit
workerMaxJobs: 64,
// Number of milliseconds to wait before considering a macro timed out
- workerTimeout: 1000 * 60 * 10,
+ workerTimeout: 1000 * 60,
// Number of times to retry a macro
workerRetries: 3
},
@@ -82,7 +82,7 @@ var Server = ks_utils.Class({
if (this.options.macro_processor) {
this.macro_processor = this.options.macro_processor;
} else {
- this.macro_processor = new ks_macros.MacroProcessor({
+ var mp_options = _.extend(_.clone(this.options), {
autorequire: this.options.autorequire,
memcache: this.options.memcache,
statsd: this.options.statsd,
@@ -99,6 +99,7 @@ var Server = ks_utils.Class({
}
}
});
+ this.macro_processor = new ks_macros.MacroProcessor(mp_options);
}
$this.macro_processor.startup(function () {
View
6 run.js
@@ -38,11 +38,11 @@ var DEFAULT_CONFIG = {
},
server: {
port: 9080,
- numWorkers: 16,
+ numWorkers: 4,
workerConcurrency: 4,
- workerTimeout: 1000 * 60 * 10,
+ workerTimeout: 1000 * 60,
workerMaxJobs: 8,
- workerRetries: 10,
+ workerRetries: 3,
document_url_template:
"https://developer.mozilla.org/en-US/docs/{path}?raw=1",
template_url_template:

0 comments on commit 6795eb5

Please sign in to comment.