location = /shared {
	content_by_lua_block {
	        local dict=ngx.shared.dog;
		local n1=ngx.now()
		for i=1,100000 do
			dict:add("hello",1)
			dict:get("hello")
		end
		local n2=ngx.now()
		ngx.say("n1 : "..tostring(n1).." n2:"..tostring(n2))
	}
}

Is there any possible that the worker switch to processing another request during the execution of the for loop ?

    Write a Reply...