Skip to main content

Questions tagged [buffer]

This tag is for questions about kernel buffer caches, including pipe buffers. These are used to store the recently accessed files and/or frequently accessed files.

Filter by
Sorted by
Tagged with
3 votes
2 answers
167 views

This is best illustrated with an example I feel: { printf 'foo\nbar\n' ; sleep 2 ; } | grep -m1 foo { printf 'foo\n' ; sleep 2 ; printf 'bar\n' ; sleep 2 ; } | grep -m1 foo Both of these commands, ...
Zorf's user avatar
  • 171
7 votes
3 answers
2k views

The sync command "writes any data buffered in memory out to disk". As far as I understand, data may be buffered in memory for very long time, even if the disks have no activity. How can I ...
xuhdev's user avatar
  • 597
0 votes
0 answers
37 views

I'm using the dd command to write to a USB stick. My command is pretty straightforward: dd if=myimage.iso of=/dev/sdd bs=1M status=progress and indeed, I seem to be getting the progress reported: ...
einpoklum's user avatar
  • 11.1k
0 votes
2 answers
165 views

Given the pipeline printf '%s\n' 1 2 3 4 5 6 7 8 9 | while read -r num do echo "$num" > /dev/stderr echo "$num" done | while read -r num do echo $(( $num * 10 )) [ &...
fuumind's user avatar
  • 449
0 votes
1 answer
135 views

I have a problem with pagecache that I don't understand. As I understand, the pagecache will serve as disk cache for reading from and writing to disk. But I don't know how the kernel can map 10G ...
Tai Nguyen Huu's user avatar
0 votes
1 answer
891 views

I have a C application which receives a lot of data over a TCP socket. Is it somehow possible to get the kernel buffer size for that file descriptor / socket? I would like to know how much data is ...
Kevin Meier's user avatar
1 vote
1 answer
330 views

On Linux I have a process (ffmpeg) that writes very slowly (even slower than 1kb / s sometimes) to disk. Ffmpeg can buffer this to 256kb chunks that get written infrequently but ffmpeg hangs ...
Pete's user avatar
  • 153
7 votes
1 answer
682 views

After a comment from OP, I discovered that /dev/stdout gives blocks of 10 KiB even after disabling buffering, but - does not. Why is this? I could not find anything regarding this in man tar nor man ...
wjwrpoyob's user avatar
  • 460
0 votes
1 answer
2k views

In a VM of 16GB RAM, we are running rsync as a cron job(for every 10 minutes) on our production to sync GBs of folder from AWS EFS to local storage. After few days of running we found that the VM is ...
Swastik's user avatar
  • 103
0 votes
0 answers
121 views

Taking inspiration from this blog post, I'm playing around with linux device drivers (which I'm studying from ). The read field of the file_operations associated with the driver is initialized to the ...
Enlico's user avatar
  • 2,362
3 votes
1 answer
325 views

Our RHEL 7 machines have great long Log files and I asked about buffering of cut in this question. That question remains but a bit of experimentation showed a different issue. I decided to try using ...
user1683793's user avatar
1 vote
1 answer
116 views

I have a script that "listens" to amixer events (volume change and mute), piping the volume and mute status to xob. It works great, but the (ab)use of stdbuf -oL <command> looks wrong ...
fff's user avatar
  • 13
1 vote
1 answer
3k views

After reading this link: How do you empty the buffers and cache on a Linux system?, I know that there are some commands that can help us to empty the buffers and cache of the OS. But I'm not sure if ...
Yves's user avatar
  • 3,411
2 votes
1 answer
486 views

I have to do a long task (convert image format) for every file of a folder. I achieved to use pv to write the estimation of duration with (used sleep here to simulated processing time): pv -B 1 =(find ...
rafoo's user avatar
  • 121
0 votes
0 answers
871 views

I am currently sending ~9mpps, each packet is 72bytes large, and is a UDP DNS request. The packets are being sent to a Dell server I have using an intel i40e interface. The server is using all of its ...
Dave's user avatar
  • 732
1 vote
2 answers
919 views

I'm reading TLPI, and in section 4.4: System calls don’t allocate memory for buffers that are used to return information to the caller. Instead, we must pass a pointer to a previously allocated ...
sudeepdino008's user avatar
0 votes
1 answer
151 views

One of the arguments to the tr command is: -u Guarantee that any output is unbuffered. Under what circumstances is it a good idea to not buffer the output? e.g. should I use -u if I expect each ...
falsePockets's user avatar
6 votes
2 answers
787 views

I am aware that STDOUT is usually buffered by commands like mawk (but not gawk), grep, sed, and so on, unless used with the appropriate options (i.e. mawk --Winteractive, or grep --line-buffered, or ...
ChennyStar's user avatar
  • 2,019
4 votes
1 answer
1k views

I'm fairly new to vim (I'm using nvim) so forgive my lack of knowledge, many questions are similar to mine, but not quite the same. I would like this: vim by default should cut/copy to a buffer, not ...
5c0tt_b0t's user avatar
  • 101
1 vote
0 answers
48 views

I want to perform updates on a file via multiple processes in parallel. These processes all open this file for write in parallel. Abbreviations used: f : file, p[i] : process i, b[i] : buffer for FD ...
uzumas's user avatar
  • 150
2 votes
0 answers
702 views

I am running a ping from one of the terminals: ping www.google.com This runs without any issues indefinitely. Now on another terminal, I run: for i in {1..5}; do speedtest; done Now after sometime on ...
Jean's user avatar
  • 211
3 votes
2 answers
625 views

I want to use pipes on Linux as a synchronization primitive between a master process and a slave process. The classic way is to create two pipes, but I believe there's a way to use a single fd instead....
Alisa Sireneva's user avatar
3 votes
1 answer
1k views

I am restoring files from a tar archive on an LTO-7 tape to a locally mounted network share. If I directly restore to the share it runs very slowly (90 MB/s). When I use an additional buffer I get the ...
swami's user avatar
  • 205
0 votes
0 answers
993 views

I am trying to understand the inner workings of Unix based OSs. I was reading on buffered I/O, and how the buffer size affects the number of system calls made, which in turn affects the total time ...
Prashant Pandey's user avatar
2 votes
1 answer
394 views

From The Linux Programming Interface: (I've read the related sections. I pasted this sum-up diagram just for illustration.) I know that for direct IO which uses read and write system calls. There is a ...
Rick's user avatar
  • 1,257