Skip to content

How do I rate limit by req/min instead of req/s? #2689

Answered by aldas
Firu115 asked this question in Q&A
Discussion options

You must be logged in to vote

maybe

			middleware.RateLimiterMemoryStoreConfig{
				Rate:      rate.Every(5 * time.Minute / 5),
				Burst:     5,
				ExpiresIn: 5 * time.Minute,
			},

But you should read https://pkg.go.dev/golang.org/x/time@v0.7.0/rate#Limit how limiting works.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Firu115
Comment options

@aldas
Comment options

Answer selected by Firu115
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants