---
title: "Could not get a resource from the pool"
author: "fengqinyun"
date: "2016-02-19T15:00:52Z"
tags: []
categories: ["开源软件"]
slug: "could-not-get-a-resource-from-the-pool"
draft: false
lastmod: "2016-02-19T15:00:52Z"
id: 2277446
url: "https://stevenfeng.iteye.com/blog/2277446"
---

出现这次错误，看网上修改

 config.setMaxTotal(60000);//设置最大连接数  
        config.setMaxIdle(1000); //设置最大空闲数 
        config.setMaxWaitMillis(3000);//设置超时时间  

修改了还是不管用，

redis.conf 下面也没有maxclients这个参数，默认无限制，进程可以打开的最大文件描述符数。

设置同一时间最大客户端连接数，默认无限制，Redis可以同时打开的客户端连接数为Redis进程可以打开的最大文件描述符数，如果设置 maxclients 0，表示不作限制。当客户端连接数到达限制时，Redis会关闭新的连接并向客户端返回max number of clients reached错误信息
    maxclients 128

看了一下 nlimit -a open files太小，调一下解决问题