Just to document for now (no action needed):
- request for seed went over size
- gdal crashed with async map loading
- 16 thread pool is what I've been using
diff --git a/renderer.js b/renderer.js
index 73c8b02..279be48 100644
--- a/renderer.js
+++ b/renderer.js
@@ -5,7 +5,7 @@ var util = require('util');
var Pool = require('./pool');
// Increase number of threads to 1.5x the number of logical CPUs.
-var threads = require('os').cpus().length + 4;
+var threads = 16;//require('os').cpus().length + 4;
console.warn('Using %d threads', threads);
require('eio').setMinParallel(threads);
@@ -19,7 +19,7 @@ module.exports = function(args) {
var maps = new Pool(function() {
var map = new mapnik.Map(256, 256);
map.bufferSize = args.bufferSize;
- map.load(args.stylesheet, {
+ /*map.load(args.stylesheet, {
strict: false,
base: path.dirname(args.stylesheet)
}, function(err, map) {
@@ -29,14 +29,20 @@ module.exports = function(args) {
util.print('\rCreating map objects (' + created + '/' + args.concurrency + ')...');
maps.release(map);
});
+ */
+ map.loadSync(args.stylesheet);
+ map.zoomAll();
+ created++;
+ util.print('\rCreating map objects (' + created + '/' + args.concurrency + ')...');
+ maps.release(map);
}, args.concurrency);
return function(query, callback) {
query.width = +query.width || 256;
query.height = +query.height || 256;
- if (query.width < 1 || query.width > 2048 || query.height < 1 || query.height > 2048) {
+ /*if (query.width < 1 || query.width > 2048 || query.height < 1 || query.height > 2048) {
return callback(new Error('Invalid size: ' + query.width + '×' + query.height));
- }
+ }*/
var bbox = query.bbox ? query.bbox.split(',') : [];
if (bbox.length !== 4) return callback(new Error('Invalid bbox: ' + util.inspect(bbox)));