-
Notifications
You must be signed in to change notification settings - Fork 67
iOS - Replicator on background thread and Couchbase lock-up on boot #78
Comments
Hello, 50 documents is not a lot. Basically the http calls are asynchrone so they should not locked your application. I can figure out two issues that my explain above behavior:
hope it helps |
Thanks for your reply @Crapulax The application doesn't do anything with the received data until requested (im aware of the browser limitations too). Each doc is very small also. Since I made this issue, my biggest problem seems to be that the database needs a few minutes to "start up" on boot where during that time, the Couchbase Lite thread maxes out at 100%. No requests can be made to it during that time and because of this, my application either locks up completely or sits there waiting for a response and I cant report progress because requests to _active_tasks wont respond! Is there any way to enable some form of logging so I can track what is going on in Couchbase Lite? Also, going back to my original question - is there any way to have the replicator run on a different thread? When my database has no data, the replicator maxes out the Couchbase thread which again stops the application from accepting any further requests. |
If you are on Android you can check the device monitor or logcat for the Java logs. You will see logs from the DB there and might figure out what is going on. How many documents do you have on the mobile once it is initalised? I recall seeing in above logs huge computations on views when we had hundred thousands docs. And to answer your question on background thread, I do not know :) |
Just under 500k documents with update seq of 1378660 and it's on iOS. Thanks for your help so far. Have you ever had any projects with a similar level of documents to mine? |
Hello, I was seeing this loading time issue with your amount of documents. If you cannot found the way to get the couchbase lite logs you can do this.
I just also recall a regression on couchbase lite phonegp we have faced on IOS in 1.2.0 which was solved with 1.2.1 making couchbase lite looping for ever time to time. I am unable to retreive the issue description. If you use 1.2.0 check with 1.2.1 it worths it... All the best, |
@Crapulax - Update on my progress. I managed to turn on Couchbase Logging (using this https://github.com/couchbase/couchbase-lite-ios/wiki/Logging). The replication (from an empty database) starts off okay in the background. _active_tasks will not respond to any requests, but my main application is still usable. But as it continues to eat more and more RAM, the application will eventually "freeze" whilst still replicating data. Eventually it either runs out of memory and crashes (2m documents, 2.8m update seq, 5.9GB) or completes and releases memory (100k documents, 800k update seq, 4.1GB) but swells to 1GB RAM usage during the process. Three questions:
|
Hello Spark, This seems to be huge numbers for a a mobile/Ipad. As a general way to see things you can work into two directions: Hope it helps, |
I've got an iOS App which requires periodic replication to update data on client (couchbase-lite) from server (a remote couchdb instance). The database is about 2GB and each "update" includes about 50 revisions/new documents.
However, every time I send a POST using the REST API to the replicator, it completely locks up couchbase and I am unable to query anything else from it (For example, trying to GET /_active_tasks will not return anything for at least a couple of minutes).
Am I right in assuming that the replicator does not run on a separate thread to the main "manager"? If not, what kind of task would be required to do this. My objective c knowledge is basic but can understand and follow most "advanced" topics.
Excuse me if my terminology is a bit of. Not new to Couch but certainly new to doing it on mobile!
Thanks in advance
The text was updated successfully, but these errors were encountered: