采矿池,go + redis,许多工作人员连接调用错误accept4:打开的文件过多

Trying to run mining pool written in go + redis.

When it is not many worker connected is works fine. But when it is more (more than 1000) workers trying to communicate with server it is leads to error

Calls in redis_go done in such way.

tx := r.client.Multi()
ms := util.MakeTimestamp() / 1000
defer tx.Close()

What can cause problem? As I understand it is problem with max connection? But how can I solve it.

Thank you in advance.

error1

error2

ulimit is 65536

update (is such way it doesn't help)

func (r *RedisClient) WriteHashRate(login string, id string, hashRate 
int64, expire time.Duration) {
tx := r.client.Multi()
ms := util.MakeTimestamp() / 1000

tx.Exec(func() error {
r.writeHashRate(tx, login, id, hashRate, expire, ms)
return nil
})

tx.Close()
}