Next.js Discord

Discord Forum

@upstash/redis takes ~400ms to ping/pong how to reduce

Unanswered
AM posted this in #help-forum
Open in Discord
AMOP
Hello I'm trying to create distributed locking system and I need fast locks, i've combined upstash/redis with upstash/lock to achieve but writing to redis took like ~400ms which is bit to much any ideas how to improve?

5 Replies

American Chinchilla
have you tried production build?
to verify
@American Chinchilla have you tried production build?
AMOP
hm just locally actually, but also there is a 1 thing,

I'm located in Bulgaria ( Europe ) and Redis instance is in:

N. California, USA (us-west-1)

gotta try on prod tho
@American Chinchilla to verify
AMOP
wow on prod actually is 3-4-5-6ms 😮
AMOP
even my bad I though that if acquiring new lock / writing to redis took 400ms there is a place for race condition, but redis handle this with atomic approach wich means OP's will be handlede sequientially 🙏