This link says:

The buffer size must not exceed the size of an atomic write to a disk file. For FreeBSD this size is unlimited.

How can I find size of atomic write on my server? Is there any command to check this?

  • possible duplicate of What is the size of an atomic write to disk on my system? – mvillar May 25 '15 at 12:53
  • 1
    @mvillar I have read answer of the question you mentioned. It doesn't answer my needs. It is telling about the largest atomic write at the block level. – g13 May 25 '15 at 13:05
  • @g13 You are right. That answer is useless. (I even pointed that out when it was originally posted). – kasperd May 26 '15 at 13:54
  • @kasperd, I have few more doubts about nginx access logs like what if I have different access logs, is this buffer size individual for each access log or shared? I can't find any good documentation regarding this issue. – g13 May 26 '15 at 16:45
  • @g13 That is a different question altogether. The question about what sizes of writes are guaranteed to be atomic is a question about kernel and file system, in reallity it is completely unrelated to nginx. Your second question sounds like it is actually about nginx, and that I don't know anything about. Be aware that if you ask a question about where to find documentation, it is likely to be closed as off-topic. But if you mention which documentation you read and what questions you are left with after reading the documentation, then you have a much better chance at getting an answer. – kasperd May 26 '15 at 17:55

I was trying to find out size of an atomic write in Linux myself and the most helpful reading was from this Unix Stack Exchange answer

But in summary

This is from man 7 pipe.

POSIX.1-2001 says that write(2)s of less than PIPE_BUF bytes must be atomic: the output data is written to the pipe as a contiguous sequence. Writes of more than PIPE_BUF bytes may be nonatomic: the kernel may interleave the data with data written by other processes. POSIX.1-2001 requires PIPE_BUF to be at least 512 bytes. (On Linux, PIPE_BUF is 4096 bytes.)

So in Linux the size of an atomic write is 4096 bytes.

You can find a nice table of the PIPE_BUF size for different OS'es here http://ar.to/notes/posix#pipe-buf.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.