Score:0

Limitting Request from Nginx 1 request per minute but if before 1 minute request already done it can allow another request

kz flag

Helo Guys,

I'm new in nginx but i know that nginx so powerfull. Now i having a trouble when use limit req zone, i set the rate is 1r/m. It works fine, it can limitted 1 request download 1 minute but if the download done before 1 minute another request can allow by nginx 1 minute and i think it wasting time.

So my question can i destroy or reset the session of limit req if we already fulfill the request before one minute? So tge nginx ready to received another request after the previous request done but still 1 request allowed like the rate settting 1r/m.

Jaromanda X avatar
ru flag
so you want the limit to be 1 request at a time, rather that 1 request per minute?
Michael A.P.L avatar
kz flag
Yap, but my request is download request, so that i want is 1 download done/failed after that nginx ready to receive request download again (but at one time just allow 1 request)
Michael A.P.L avatar
kz flag
Example, i have apps with size 20 MB, i set limit rate in nginx is 625k (KBPS), i set rate 1r/m. At one time there is 1 request, so nginx will process just it and the download process start, if the download not done yet when there is another request nginx will response 503, after maybe 30 second the download is done, i want nginx ready to receive 1 request again after the first download is done. In my experience now nginx will ready to accept request again after 1 minute whereas the first download already done in 30s, so there is other 30s waste.
Jaromanda X avatar
ru flag
I think what you want is not possible, since there's so many ifs and buts
Michael A.P.L avatar
kz flag
Hmm okay thanks. So we can set nginx to waiting first download finished/failed and after that ready to receive the request again. Because if i increase the request per minute or per second, my request is download, it will be impact for bandwidth.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.