Closed sstong123 closed 6 years ago
Is there any potential issue under high concurrency?
@sstong123 you can simply increase the lua_max_pending_timers
.
https://github.com/openresty/lua-nginx-module/#lua_max_pending_timers
add lua_max_pending_timers 1024
in nginx.conf file?
@sstong123 nope, 1024
is the default value, you should use 2048
or 4096
for your case.
please see the doc carefully next time.
I mean shoud I add the lua_max_pending_timers value
in nginx.conf file?(not about the value)
@sstong123 yes.
I got the below error message when my code like location = /test {lua_max_pending_timers 2048....}
or server{lua_max_pending_timers 2048...}
[emerg] 8420#14252: "lua_max_pending_timers" directive is not allowed here in nginx.conf:125
Is 'lua_max_pending_timers 'directive under 'local 'or 'server' tag? or need import something ?
lua_max_pending_timers
syntax: lua_max_pending_timers <count>
default: lua_max_pending_timers 1024
context: http
http {
lua_max_pending_timers 2048;
server {
#...
}
}
local bp = producer:new(broker_list, { producer_type = "async" }); local ok, err = bp:send(topicName, key, message)
When I use a performance tool to mock about 2000 concurrent users to call the above code,all the messages are saved in kafka server(as expected),but I get the errors in nginx error.log as blow,why this happened?
2018/04/24 10:15:15 [error] 6934#0: *429631 [lua] producer.lua:284: _flush_buffer(): failed to create timer at _flush_buffer, err: too many pending timers, client: 10.150.50.235, server: , request: "POST /saveKafkaMsg HTTP/1.0", host: "10.150.50.234"