Our production environment continuously writes to Dgraph, and the write pressure is quite high. When the batch size is large, Dgraph often gets stuck at the WaitForTs
function. Would it be possible to mitigate this issue by caching the previous startTS
value and using it as a query parameter? (Our real-time requirements are not very strict.)
WaitForTs is not getting the start timestamp from the zero. It’s waiting for the write threads to be completed before we can start reading stuff for new transaction. It’s to make sure that dgraph is consistent.
Thank you for your response! Can we cache the startTS from an hour ago for queries? Our queries are getting pending, and our real-time requirements are not very strict.
You can just reuse old start ts, and it should work. However, using old start ts could cause issues. You could use zero’s api to get a timestamp and then keep using it.
Thanks for taking the time to help! Wish you all the best!
Also, if you’re trying to unblock the reads, I think an RO+best-effort query would by-pass the wait for the TS. Right @harshil_goel?
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
@matthewmcneely Yeah that’s correct, best-effort query would also bypass the wait for the ts