We have a setup where 3-6 iPads in a LAN need to be aware of changes in a set of documents. When our app is started, the following steps are performed:
- start a CBLListener
- start a NSNetServiceBrowser
- on receipt of a netServiceBrowser:didFindService a 'peer' object is created and resolved with resolveWithTimeout
- on netServiceDidResolveAddress a continuous push replication is started with the newly found peer.
- on receipt of netServiceBrowser:didRemoveService: replication is stopped with corresponding peer
- observe kCBLReplicationChangeNotification
- start a continuous push/pull replication with a remote CouchDB server (at Cloudant) (allows us to see what's happening. We do not want to depend on working internet so this replication is redundant)
This works fine but every few days the replication stops and we see replication errors "Request time out" and "500 Internal server error" in our logs. There is no relation with the workload or the number of ipads.
Is something wrong with the procedure described above ?
Are we maybe overloading the internal webserver and/or the replication task with up to 7 replications ?
How can we investigate this issue ?