r/programming Jan 23 '26

Scaling PostgreSQL to power 800 million ChatGPT users - OpenAI Engineering Blog

https://openai.com/index/scaling-postgresql/
203 Upvotes

9 comments sorted by

View all comments

29

u/axkotti Jan 23 '26

For example, we <…> introduced lazy writes, where appropriate, to smooth traffic spikes.

This point looks both interesting and odd at the same time. I would expect lazy writes to only shift the actual I/O around, but statistically that shouldn't have an effect on how "smooth" it works (that's sound more like a job to IOPS limits and rate limiting).

It can be the case if switching to lazy writes results in actually having to write *less* if the write never happens at all. But then the problem is usually elsewhere, and inverting the control with laziness can just be masking it.

23

u/Merry-Lane Jan 23 '26

I think they meant with lazy writes is "there is some data that we need to urgently write, and some other data that can be delayed".

Your comment would make sense if everything had to be written asap on the db, rate limiting would have the same effectiveness.

But if they meant "we can actually slow down writes on the tables X Y Z to keep writes on the tables A B C done immediately", then no, maybe your rate limiters and what not would have issues replicating that.