Open ghost opened 11 years ago
@liorc11 These error logging is done automatically by the underlying ngx_lua module. You can disable this automatic error logging by putting the following line into the right place in your nginx.conf file:
lua_socket_log_errors off;
See http://wiki.nginx.org/HttpLuaModule#lua_socket_log_errors for more details.
Just added a new section "Automatic Error Logging" to lua-resty-redis's documentation:
https://github.com/agentzh/lua-resty-redis#automatic-error-logging
This has been a FAQ already :)
I tried adding it both on http, server and location I still get [crit] 72267#0: *306432429 connect() to 127.0.0.1:6381 failed (99: Cannot assign requested address), client: 217.163.21.187, server: 127.0.0.1
It is very easy for me to to reproduce it, as I have a redis with millions of keys, if I just do "keys *" on it I start getting this lines for 10-20 seconds until the system recovers
Hello!
On Fri, Oct 4, 2013 at 2:53 AM, liorc11 notifications@github.com wrote:
I tried adding it both on http, server and location I still get [crit] 72267#0: *306432429 connect() to 127.0.0.1:6381 failed (99: Cannot assign requested address), client: 217.163.21.187, server: 127.0.0.1
This error is critical and it is generated by the Nginx core. The ngx_lua module cannot disable it on its side.
This error indicates that you've run out of the ephemeral ports. Are you properly enabling the connection pool in lua-resty-redis? See
https://github.com/agentzh/lua-resty-redis#set_keepalive
for how to enable keepalive connection pools for your Redis queries.
Also, you can use the ngx-lua-conn-pools tool to trace the connection pools in any specified nginx worker processes:
https://github.com/agentzh/nginx-systemtap-toolkit#ngx-lua-conn-pools
Regards, -agentzh
I'm trying to cache errors on connect to a redis instance both by using ok, err = .... and wrapping up the code with a pcall
In both cases still an error line goes to nginx error log. I have a high load application and if a redis instance goes down for a few secs my error log gets flooded with messages. Is there a way around it?