diff --git a/dmemcache.inc b/dmemcache.inc
index f598284..66b48d5 100644
--- a/dmemcache.inc
+++ b/dmemcache.inc
@@ -85,6 +85,38 @@ function dmemcache_set($key, $value, $exp = 0, $bin = 'cache', $mc = NULL) {
 }
 
 /**
+ * Place multiple items into memcached.
+ *
+ * @param array $items
+ *   array of cache objects with the same expiration time.
+ * @param int $expiration
+ *   Parameter expire is expiration time in seconds. If it's 0, the item never
+ *   expires (but memcached server doesn't guarantee this item to be stored all
+ *   the time, it could be deleted from the cache to make place for other
+ *   items).
+ * @param string $bin
+ *   The name of the Drupal subsystem that is making this call. Examples could
+ *   be 'cache', 'alias', 'taxonomy term' etc. It is possible to map different
+ *   $bin values to different memcache servers.
+ * @return bool
+ *   TRUE on succes, FALSE otherwise.
+ */
+function dmemcache_setMulti($items, $bin) {
+
+  $rc = FALSE;
+  $expiration = $items[0]->expire;
+  $mc = dmemcache_object($bin);
+    if ($mc instanceof Memcached) {
+      $rc = $mc->setMulti($items, $expiration);
+    }
+    else {
+      // this only works with Memcached
+      return;
+    }
+  return $rc;
+}
+
+/**
  * A temporary error handler which keeps track of the most recent error.
  */
 function _dmemcache_error_handler($errno, $errstr) {
diff --git a/memcache.inc b/memcache.inc
index 729fa9f..deef37d 100644
--- a/memcache.inc
+++ b/memcache.inc
@@ -266,6 +266,71 @@ class MemCacheDrupal implements DrupalCacheInterface {
   }
 
   /**
+   * Implements DrupalCacheInterface::setMulti().
+   */
+  public function setMulti($items, $bin = 'cache') {
+
+    if(extension_loaded('Memcached') && variable_get('memcache_extension') == 'Memcached') {
+
+      $created_microtime = round(microtime(TRUE), 3);
+
+      // group cache items by expiration time.
+      $item_groups = array();
+      $big_item_groups = array();
+      foreach ($items as $item) {
+        if (is_object($item)) {
+          $memcached_key = dmemcache_key($item->cid, $bin);
+          $item->created = REQUEST_TIME;
+          $item->created_microtime = $created_microtime;
+          $expire = $item->expire;
+          if ($expire == CACHE_TEMPORARY) {
+            // Convert CACHE_TEMPORARY (-1) into something that will live in memcache
+            // until the next flush.
+            $item->expire = REQUEST_TIME + 2591999;
+            // This is a temporary cache item.
+            $item->temporary = TRUE;
+          }
+          // Expire time is in seconds if less than 30 days, otherwise is a timestamp.
+          elseif ($expire != CACHE_PERMANENT && $expire < 2592000) {
+            // Expire is expressed in seconds, convert to the proper future timestamp
+            // as expected in dmemcache_get().
+            $item->expire = REQUEST_TIME + $expire;
+            $item->temporary = FALSE;
+          }
+          else {
+            $item->expire = $expire;
+            $item->temporary = FALSE;
+          }
+          // check if the data is exceeding the maximum size allowed by memcached
+          $max_len = variable_get('memcache_data_max_length', 1048576) - (512 + strlen($memcached_key));
+          if(is_object($item->data) || is_array($item->data)){
+            $data_size = strlen(serialize($item->data));
+          }else{
+            $data_size = strlen($item->data);
+          }
+          if($data_size < $max_len){
+            $item_groups[$expire][$memcached_key] = $item;
+          }else{
+            $big_item_groups[] = $item;
+          }
+        }
+      }
+
+      foreach ($item_groups as $expiration => $cache_items) {
+        dmemcache_setMulti($cache_items, $bin);
+      }
+      foreach ($big_item_groups as $cache_item) {
+        _dmemcache_set_pieces($cache_item->cid, $cache_item->data, $cache_item->expire, $bin);
+      }
+    } else {
+      // setMulti only available in Memcached
+      return;
+    }
+
+  }
+
+
+  /**
    * Implements DrupalCacheInterface::clear().
    */
   public function clear($cid = NULL, $wildcard = FALSE) {
