Bug 694149 - Tweak sync intervals to reduce server load. r=rnewman,atoll
authorPhilipp von Weitershausen <philipp@weitershausen.de>
Wed, 12 Oct 2011 19:30:48 -0700
changeset 79709 9a34387605eae0ada07567343b9ce45c7a4bba1a
parent 79708 2c9b36620889ee79db0547b7c4f6ab576ad66138
child 79710 cc0be790f8c658ef937981689ec71f066fec3f35
push id506
push userclegnitto@mozilla.com
push dateWed, 09 Nov 2011 02:03:18 +0000
treeherdermozilla-aurora@63587fc7bb93 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman, atoll
bugs694149
milestone10.0a1
Bug 694149 - Tweak sync intervals to reduce server load. r=rnewman,atoll
services/sync/services-sync.js
services/sync/tests/unit/test_syncscheduler.js
--- a/services/sync/services-sync.js
+++ b/services/sync/services-sync.js
@@ -4,20 +4,20 @@ pref("services.sync.miscURL", "misc/");
 pref("services.sync.termsURL", "https://services.mozilla.com/tos/");
 pref("services.sync.privacyURL", "https://services.mozilla.com/privacy-policy/");
 pref("services.sync.statusURL", "https://services.mozilla.com/status/");
 pref("services.sync.syncKeyHelpURL", "https://services.mozilla.com/help/synckey");
 
 pref("services.sync.lastversion", "firstrun");
 pref("services.sync.sendVersionInfo", true);
 
-pref("services.sync.scheduler.singleDeviceInterval", 3600);  // 1 hour
+pref("services.sync.scheduler.singleDeviceInterval", 86400); // 1 day
 pref("services.sync.scheduler.idleInterval",         3600);  // 1 hour
-pref("services.sync.scheduler.activeInterval",       300);   // 5 minutes
-pref("services.sync.scheduler.immediateInterval",    60);    // 1 minute
+pref("services.sync.scheduler.activeInterval",       600);   // 10 minutes
+pref("services.sync.scheduler.immediateInterval",    90);    // 1.5 minutes
 pref("services.sync.scheduler.idleTime",             300);   // 5 minutes
 
 pref("services.sync.errorhandler.networkFailureReportTimeout", 604800); // 1 week
 
 pref("services.sync.engine.bookmarks", true);
 pref("services.sync.engine.history", true);
 pref("services.sync.engine.passwords", true);
 pref("services.sync.engine.prefs", true);
--- a/services/sync/tests/unit/test_syncscheduler.js
+++ b/services/sync/tests/unit/test_syncscheduler.js
@@ -252,18 +252,19 @@ add_test(function test_scheduleNextSync_
 
   SyncScheduler.syncTimer.clear();
   Service.startOver();
   run_next_test();
 });
 
 add_test(function test_scheduleNextSync_backoff() {
  _("scheduleNextSync() will honour backoff in all scheduling requests.");
-  Status.backoffInterval = 7337000;
-  do_check_true(Status.backoffInterval > SyncScheduler.syncInterval);
+  // Let's take a backoff interval that's bigger than the default sync interval.
+  const BACKOFF = 7337;
+  Status.backoffInterval = SyncScheduler.syncInterval + BACKOFF;
 
   _("Test setting sync interval when nextSync == 0");
   SyncScheduler.nextSync = 0;
   SyncScheduler.scheduleNextSync();
 
   // nextSync - Date.now() might be smaller than expectedInterval
   // since some time has passed since we called scheduleNextSync().
   do_check_true(SyncScheduler.nextSync - Date.now()
@@ -577,17 +578,18 @@ add_test(function test_back_triggersSync
   SyncScheduler.observe(null, "back", Svc.Prefs.get("scheduler.idleTime"));
 });
 
 add_test(function test_back_triggersSync_observesBackoff() {
   // Confirm defaults.
   do_check_false(SyncScheduler.idle);
 
   // Set up: Set backoff, define 2 clients and put the system in idle.
-  Status.backoffInterval = 7337000;
+  const BACKOFF = 7337;
+  Status.backoffInterval = SyncScheduler.idleInterval + BACKOFF;
   SyncScheduler.numClients = 2;
   SyncScheduler.observe(null, "idle", Svc.Prefs.get("scheduler.idleTime"));
   do_check_eq(SyncScheduler.idle, true);
 
   function onLoginStart() {
     do_throw("Shouldn't have kicked off a sync!");
   }
   Svc.Obs.add("weave:service:login:start", onLoginStart);