replyerror:err已达到最大客户端数-redis

wnvonmuf  于 2021-06-09  发布在  Redis
关注(0)|答案(0)|浏览(284)

我正在从nodejs脚本运行此函数:

  1. const redis = require('redis')
  2. const redisOptions = {
  3. url: '*****',
  4. password: '******'
  5. }
  6. const checkMessageStatus = (cachedMessageId, callback = () => {}) => {
  7. const client = redis.createClient(redisOptions)
  8. client.get('*', (err, cachedMessage) => {
  9. // returns error if it exists
  10. // figure out why this gets called twice
  11. if(err) return console.log('redis err',err)
  12. // returns true if message is cached
  13. if(cachedMessage) return
  14. // sets message as ID in database if the message hasn't been sent already
  15. client.set(cachedMessageId, JSON.stringify(cachedMessageId), 'EX', 120 * 60, (redisSetError, redisSetResponse) => {
  16. // console.error(redisSetError)
  17. // console.log(redisSetResponse)
  18. client.quit(callback)
  19. })
  20. })
  21. }

我收到这个错误:

  1. ReplyError: ERR max number of clients reached

数据库是通过redis实验室托管的,我可以有30个连接。
我跑了:

  1. CLIENT KILL TYPE normal
  2. CLIENT KILL TYPE slave
  3. CLIENT KILL TYPE pubsub

当我跑的时候 info clients :

  1. # Clients
  2. connected_clients:1
  3. client_longest_output_list:0
  4. client_biggest_input_buf:0
  5. blocked_clients:0

问题:即使只有一个连接的客户端,我仍然会遇到此错误:

  1. ReplyError: ERR max number of clients reached

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题