fifo file is just a type of file which when opened for both reading and writing instantiates a pipe like a pipe() system call would.
On Linux at least, the data that transits though that pipe is not stored on the file system at all (only in the kernel as kernel memory). And the size attribute of the fifo file is not relevant and is always 0.
On Linux, you can change the size of a pipe buffer (whether that pipe has been instantiated with
pipe() or via opening a fifo file) with the
fcntl(), though for unprivileged users, that's bound by
/proc/sys/fs/pipe-max-size. Any of the writer or reader to the pipe can issue that
fcntl() though it makes more sense for the writer to do it. In the case of a named pipe, you'd need to do that for each pipe instantiated though the fifo file.
$ mkfifo fifo
$ exec 3<> fifo # instantiate the pipe
$ seq 20000 > fifo
^C # seq hangs because it's trying to write more than 64KiB
$ exec 3<&- 3<> fifo # close the first pipe and instantiate a new one
$ (perl -MFcntl -e 'fcntl(STDOUT, 1031, 1048576)'; seq 20000) > fifo
$ # went through this time
Above, I used
perl to issue the
fcntl(), harcoding the value of
F_SETPIPE_SZ (1031 on my system).