@classmethod
def set_max_size(cls, pid, size):
    """Set the maximum number of connections for the specified pool

        :param str pid: The pool to set the size for
        :param int size: The maximum number of connections

        """
    with cls._lock:
        cls._ensure_pool_exists(pid)
        cls._pools[pid].set_max_size(size)
