protected function _setOptions()
    {
        $this->_Memcached->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);

        $serializer = strtolower($this->_config['serialize']);
        if (!isset($this->_serializers[$serializer])) {
            throw new InvalidArgumentException(
                sprintf('%s is not a valid serializer engine for Memcached', $serializer)
            );
        }

        if ($serializer !== 'php' &&
            !constant('Memcached::HAVE_' . strtoupper($serializer))
        ) {
            throw new InvalidArgumentException(
                sprintf('Memcached extension is not compiled with %s support', $serializer)
            );
        }

        $this->_Memcached->setOption(
            Memcached::OPT_SERIALIZER,
            $this->_serializers[$serializer]
        );

        // Check for Amazon ElastiCache instance
        if (defined('Memcached::OPT_CLIENT_MODE') &&
            defined('Memcached::DYNAMIC_CLIENT_MODE')
        ) {
            $this->_Memcached->setOption(
                Memcached::OPT_CLIENT_MODE,
                Memcached::DYNAMIC_CLIENT_MODE
            );
        }

        $this->_Memcached->setOption(
            Memcached::OPT_COMPRESSION,
            (bool)$this->_config['compress']
        );
    }