1

I'm working on a couchapp that may have large documents added to it. For example, I'm testing with a 446MB video. User A can request to replicate with user B who may have large files like this. The replication is then initiated from an ajax call.

I have a few of questions:

  • In general, am I going about this the right way?
  • Should timeout = connection_timeout?
  • Does timeout relate to each document that needs to be synced or the entire replication?
  • Does connection_timeout relate to each document that needs to be synced or the entire replication?
  • Does retries_per_request mean that I have a total of (connection_timeout X retries_per_request) for the entire replication? What if that exceeds timeout?
  • If I am stuck with a max time for the replication as a whole, how do I allow replication of many large documents?

Here's my code:

 $.ajax({
            url: "/_replicate",
            timeout : 6000000,
            type: "POST",

            data: JSON.stringify({"source": repFrom, "target": secureHome, 
                "userCtx": {"name": homeUser, "roles":["_admin", homeUser]}, 
                "continuous":continuousRep,
                "connection_timeout": 6000000,
                "retries_per_request": 20,
                "http_connections": 30}),
            contentType:"application/json",
            error: function(){
                alert(libLang.noSyncOnline); 
                $.mobile.hidePageLoadingMsg();
            },
            success: function(message){
                if(message){
                    alert(libLang.synced);
                    $.mobile.hidePageLoadingMsg();
                };
            }
        });
Brad Rhoads
  • 1,828
  • 3
  • 29
  • 52
  • Unfortunately right now many of these questions might need a trip through the source code or to be answered by Filipe Manana or other implementers if they're not answered by https://gist.github.com/832610. I do recognize some of the parameters as being global config parameters as well, perhaps you can find some informative comments in default/local.ini. (Really eager for the docs to get re-released so we'll have an official and central place to record stuff like this.) – natevw Nov 15 '12 at 00:18

0 Answers0