I am using CouchDB/PouchDB as an off-line tile server for a Cordova mapping app. Initial replication of the CouchDB 215mb db on phone takes over two hours on local network. CouchDB to CouchDB replication takes 6 minutes on local network. Db includes 65000 documents with png attachments of 1-2KB.
function managePouchDB(networkState) {
// replicate tiles from local workstation
var remoteCouchdb_osm_bc = "http://192.168.12.5:5984/osm_bc_simple_z6-13_tiles";
var tiledb_rep_opts = {
// http://pouchdb.com/api.html#replication
live: true,
retry: true,
// batch size: tried 10 - 100; 10 works best for osm tiles replication w/ nginx
batch_size: 10, // default = 100
attachments: true
};
// replicate osm bc tiles on check
var pouchTilesDB_osm_bc_baselayer_replicate = pouchTilesDB_osm_bc_baselayer.replicate.from(remoteCouchdb_osm_bc, tiledb_rep_opts);
var pouchTilesDB_osm_bc_storedState = localStorage.getItem("pouchTilesDB_osm_bc_storedState");
if (pouchTilesDB_osm_bc_storedState === "true") {
pouchTilesDB_osm_bc_baselayer.replicate.from(remoteCouchdb_osm_bc, tiledb_rep_opts);
I have reduced batch size, which yields a reduction in replication time, but still only see ~ 2mb/min replication.
Online CouchDB tiles called directly display well. Using CouchDB V1.6.1, PouchDB V4.0.3
Where would the probable bottlenecks be? Solutions or ideas?