@rbac('*')
    def max_servers(self, resource_desc, load_adjusted=False):
        """
        Returns `total_cpus` * `max_load` if `resource_desc` is supported;
        otherwise, zero. The return value may be limited by `server_limit`.

        resource_desc: dict
            Description of required resources.

        load_adjusted: bool
            If True, then the returned number of servers is adjusted for
            current host loading.
        """
        retcode, info = self.check_compatibility(resource_desc)
        if retcode != 0:
            return (0, info)

        avail_cpus = self.total_cpus * self.max_load
        if load_adjusted:  # Check system load.
            try:
                loadavgs = os.getloadavg()
            # Not available on Windows.
            except __HOLE__:  #pragma no cover
                pass
            else:
                self._logger.debug('loadavgs %.2f, %.2f, %.2f, max_load %.2f',
                                   loadavgs[0], loadavgs[1], loadavgs[2],
                                   self.max_load * self.total_cpus)
                avail_cpus -= int(loadavgs[0])
        avail_cpus = max(int(avail_cpus), 1)
        if self.server_limit == 0:
            avail_cpus = min(avail_cpus, self.total_cpus)
        elif self.server_limit > 0:
            avail_cpus = min(avail_cpus, self.server_limit)
        # else no special limiting.

        if 'min_cpus' in resource_desc:
            req_cpus = resource_desc['min_cpus']
            if req_cpus > avail_cpus:
                return (0, {'min_cpus': 'want %s, available %s'
                                        % (req_cpus, avail_cpus)})
            else:
                return (avail_cpus / req_cpus, {})
        else:
            return (avail_cpus, {})
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/resource.py/LocalAllocator.max_servers