          return 1; /* already used our millisecond for this loop... */
      }
      /* Expires */
-@@ -1323,6 +1340,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
+@@ -1323,6 +1340,11 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
  
      run_with_period(1000) {
          slotsmgrt_cleanup();
 +        slotsmgrtAsyncCleanup();
++    }
++
++    run_with_period(100) {
++        slotsmgrtLazyReleaseCleanup();
      }
  
      /* Cleanup expired MIGRATE cached sockets. */
-@@ -1577,6 +1595,12 @@ void initServerConfig(void) {
+@@ -1577,6 +1599,12 @@ void initServerConfig(void) {
      server.loading_process_events_interval_bytes = (1024*1024*2);
  
      server.slotsmgrt_cached_sockfds = dictCreate(&migrateCacheDictType, NULL);

+    return 0;
+}
+
+void
+slotsmgrtLazyReleaseCommand(client *c) {
+    if (c->argc != 1 && c->argc != 2) {
+        addReplyError(c, "wrong number of arguments for SLOTSMGRT-LAZY-RELEASE");
+        return;
+    }
+    long long step = 1;
+    if (c->argc != 1) {
+        if (getLongLongFromObject(c->argv[1], &step) != C_OK ||
+                !(step >= 0 && step <= INT_MAX)) {
+            addReplyErrorFormat(c, "invalid value of step (%s)",
+                    (char *)c->argv[1]->ptr);
+            return;
+        }
+    }
+    while (step != 0 && slotsmgrtLazyReleaseIncrementally()) { step --; }
+
+    list *ll = server.slotsmgrt_lazy_release;
+

         server.db[j].tagged_keys = zslCreate();
     }
     server.pubsub_channels = dictCreate(&keylistDictType,NULL);
@@ -2428,7 +2457,9 @@ int processCommand(client *c) {
     }
 
     /* Check if the user is authenticated */
