Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are there req/s limits on http.request? #362

Open
dr3n83 opened this issue Mar 23, 2022 · 4 comments
Open

Are there req/s limits on http.request? #362

dr3n83 opened this issue Mar 23, 2022 · 4 comments
Labels

Comments

@dr3n83
Copy link

dr3n83 commented Mar 23, 2022

In tests using http.request I had problems exceeding 1k req/s. Below that, the response time is around 1ms, when it gets to 1k, my response time goes to 500ms to 1s for each request. Has anyone had this kind of problem? I didn't find anything about it here.

@Tieske
Copy link
Member

Tieske commented Mar 23, 2022

there can be a lot of different reasons for this to happen... resource shortage (memory, sockets/fds), network, server side latency, etc.

@dr3n83
Copy link
Author

dr3n83 commented Mar 24, 2022

Thanks a lot for the quick response.

All the points mentioned were often analyzed in detail. Both via monitoring tool like Netdata and commands like strace, mpstat and etc. There is no resource exhaustion, ringbuffer overflow or filedescriptors overflow. Sysctl is fine tuned.

I use luasocket inside a lua script called on my PowerDNS server. I validated in many ways and everything pointed to the http.request function I use luasocket to. When I have a stream above 1k of reqs/s, I have horrible degradation in response time with http.request.

Could you help me in a way to be able to debug this better inside luasocket?

@Tieske
Copy link
Member

Tieske commented Mar 24, 2022

Unfortunately this is beyond my knowledge of LuaSocket, maybe someone else knows...

@CDSoft
Copy link

CDSoft commented Mar 24, 2022

It may be an effect of the Nagle's algorithm that seems not to be disabled in http.lua.
Something like h.try(c:setoption('tcp-nodelay', true) in http.lua (function _M.open) may help in this very specific case but may not be desirable for normal HTTP usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants