@chaizhenhua "OK. so we need add sync flag every time CopyBufferToNginx is called. right?"

I think we need the sync flag only when we send an empty buffer. But I would like to keep this as it is right now, and look at respecting upstream flushes separately if you OK with that?