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.

learn more… | top users | synonyms

1
vote
1answer
43 views

Filter out duplicate lines of tail -f [duplicate]

I often need to tail -f apache access logs for websites to troubleshoot issues- one thing that makes it annoying is that anyone loading a page once may cause 12+ lines to get written to the log, and ...
2
votes
1answer
44 views

non-blocking/multi-threaded cat

cat is blocking from what I see in the code, i.e. it uses blocking read() and then it uses blocking write(). I want to call some tool where I disable all stdout buffering by purpose (e.g. like ...
3
votes
2answers
25 views

stdbuf supposed behavior for subprocesses

I didn't exactly find something about the following in the man-page. How is the supposed behavior in subprocesses spawned by a process which was itself spawned by stdbuf? E.g.: stdbuf -oL myprog ...
0
votes
0answers
16 views

Is there a way to edit video buffer size in google chrome in linux?

Its easy to do in windows but how to do it in google-chrome in cent OS 7. NOTE :I think google-chrome here is not using adobe flash perhaps it does not even need it but still i can play videos.
3
votes
0answers
29 views

Does Linux perform buffering twice when hosting a VM?

I ran a KVM VM on my CentOS host and found that after performing a HDD-intensive operation, it used all of the host's memory I assigned to it. However, free on the guest suggests that the memory's ...
3
votes
4answers
283 views

Restrict size of buffer cache in Linux

Is there a way to tell the Linux kernel to only use a certain percentage of memory for the buffer cache? I know /proc/sys/vm/drop_caches can be used to clear the cache temporarily, but is there any ...
4
votes
3answers
215 views

use line buffering when piping output to file

I have a perl program that prints to stdout, which I then pipe into a file, like this: ./skript.pl > file.txt 2>&1 This makes the output of that skript buffer. However, I would like to be ...
0
votes
0answers
12 views

Apache2 custom errorLogger buffer

I'm currently using this: ErrorLog "|/var/www/HClogger.py >> /var/log/apache2/web-error.log" This allows me to have a file log, but also send the log to a HipChat room. The script is: ...
2
votes
2answers
135 views

Avoid output buffering for a command group (curly braces) in bash script

I have a bash script containing a group of commands in curly braces { ... }. This group contains some initial echo commands and then one loop. At each iteration the loop executes various slow commands ...
1
vote
2answers
166 views

How to identify cause of large buffer memory usage?

I have a production machine running a 2.6 kernel (Centos 6.7) with 64 GB of RAM of which 18 GB is apparently used for buffer memory. I am interested in identifying specifically what that 18 GB is ...
0
votes
2answers
106 views

awk output has extra carriage returns and is buffered

My ultimate goal is to get a zenity progress dialog to work while encoding with fdkaac. I first started with some code that is working when I encode "aa.wav" to "aa.mp3" with lame. This results in a ...
2
votes
0answers
94 views

Understanding inotifywait, pipes and buffers

I want to monitor every file change in a directory with inotifywait. inotifywait shall write to a FIFO buffer, which then can be read, leisurely. While experimenting with relatively huge amounts of ...
0
votes
1answer
87 views

Wanted: nonassociative array in AWK

I am looking at speeding up some code in AWK by serially processing an internal string representation instead of serially processing an array representation. (For Examples 1 and 2 below assume ...
4
votes
3answers
156 views

How to append data to buffer in shell script?

I'd like to do following using shell script: (for simplicity, I use same data for INPUT. In real case, the data changes with loop label jj) #!/bin/sh for jj in `seq 100`; do cat INPUT.file ...
8
votes
1answer
988 views

Increase FIFO size limit

Thanks to the answers to my other question, I now understand that FIFO on Linux, i.e. /dev/xconsole has a buffer limit of 64 KB. How can I increase this limit to 128 KB? Apparently, I will need to ...
3
votes
1answer
51 views

How do I ensure all data to an SSH pipe is sent, despite lengthy disconnects?

I'm on a laptop with intermittent internet connectivity. (i.e. I sometimes don't have network for a week.) I want the output of a process on my laptop to end up on my server. It all needs to get ...
-1
votes
1answer
85 views

Why readdir() only reads 32K of directory entries at a time?

readdir() only reads 32K of directory entries at a time. Why does it read only 32K entries? Is it dependent on buffer or any other parameters? Can I change that value so that I can read as many ...
5
votes
3answers
415 views

How to forward between processes with named pipes?

The /tmp/in, /tmp/out and /tmp/err are named pipes, already created and opened by some process (for reading, writing and writing, respectively). I would like to create a new process that pipes its ...
1
vote
1answer
34 views

Why combining two unbuffers give this error?

I am reading this answer here and run test code unbuffer xxd -ps /usr/bin/telnet | unbuffer -p less but get Missing filename ("less --help" for help). Why combining two unbuffers give this error? ...
5
votes
3answers
468 views

Why does this one-liner fail to produce output? [duplicate]

The following produces nothing in bash: while true ; do upower -d ; sleep 1 ; done | grep percentage | uniq I've discovered that it doesn't matter what the last- or even the second to last- program ...
0
votes
0answers
57 views

Backup server with tar, encrypt and directly transfer the result, AFTER BUFFERING IT

So I've been investigative how to make full backups with tar, and I found that tar is a good tool if the backup is to be made once, and if the server has enough disk space to handle the output file. ...
1
vote
1answer
276 views

Formatting grep output with awk. Simple case and background case

I'm struggling with this problem. I have this line: mplayer *.* 2>/dev/null | grep Playing which just launchs mplayer and only the line matching Playing filename is printed on screen. This works ...
1
vote
1answer
94 views

Function tracing per thread

I have a complex multi threaded application running on a Cent OS 5.8 the application is coded using C and C++ I am searching for a FUNCTION TRACING tool which can help me do the following. Trace ...
1
vote
0answers
218 views

How can I find which process is eating my memory? [duplicate]

My Linux system sometimes reaches 90% memory usage. We are running some Java processes, and top shows overall usage as 45%. If I stop the running processes, usage reduces to 5-10%. I want to list ...
2
votes
4answers
194 views

Completely buffer command output before piping to another command? [duplicate]

Is there a way to only execute a command after another is done without a temp file? I have one longer running command and another command that formats the output and sends it to a HTTP server using ...
3
votes
3answers
140 views

What to use instead of `buffer` for 1GB buffer? [duplicate]

buffer(1) seems to be old-ish and have hard-coded values preventing it to cache large amount of data. $ buffer -m 1G max_shmem 1 too low // it doesn't even understand gigabytes $ buffer -m 1000M ...
21
votes
2answers
2k views

Pipes, how do data flow in a pipeline?

I don't understand how the data flows in the pipeline and hope someone could clarify what is going on there. I thought a pipeline of commands processes files (text, arrays of strings) in line by line ...
1
vote
1answer
336 views

Is it useful for a proxy to buffer less data than Linux RCVBUF can?

I am looking at how HTTP proxies and reverse proxies deal with slow client problems. The idea is that the upstream server only have a limited slots for clients and if the client is slow to receive ...
0
votes
1answer
660 views

How to enable a non-root user to empty the linux buffer cache

I'm required to empty the linux buffer cache in a python script, that runs on a Debian wheezy VM. As root I run sync; echo 3 | sudo tee /proc/sys/vm/drop_caches, but the script is run by a user, ...
2
votes
3answers
443 views

Buffering (named) pipe in GNU OS

In the GNU OS a process can only write data to a pipe if another process reads the same data (from the same pipe) at the same time. Is there something like a pipe which lets the 1st process write and ...
0
votes
1answer
33 views

:bnext not cycling through all buffers in vim

For some reason :bnext is not cycling though all the buffers shown by :buffers I have 5 buffers open but only 3 buffers are visited when I used :bnext repeatedly. How can I cycle through all the ...
4
votes
1answer
87 views

Disable buffering in a VM configuration

I am executing some benchmark using a DBMS and virtual machines. And I am using this command free && sync && echo 3 > /proc/sys/vm/drop_caches && free on each Guest, and ...
4
votes
1answer
227 views

Meaning of fsync() in sshfs+LUKS setup

Background: I'm investigating methods for encrypted storage on untrusted machines. My current setup uses sshfs to access a LUKS-encrypted image on the remote machine, which is decrypted locally and ...
1
vote
1answer
86 views

Use saved input for scripts

I have a few scripts that I constantly enter in input as below: [support@ccfcore-3 exporttool]$ ./sendExamToRepo.sh Enter the Study Instance UID: 2.25.98472613238667427310842065102689842379 The ...
1
vote
2answers
127 views

Specifying height for vertical splits in vim

Usually I am editing two files, A and B, split horizontally. I set it up, so that one buffer would only occupy the first 2 lines at the top of the screen, and the rest is for the other buffer. ...
3
votes
1answer
233 views

Does “mount -o remount,ro” flush filesystem buffers?

On Linux, does mount -o remount,ro flush filesystem buffers/cache, or should I also run sync to achieve that?
6
votes
2answers
2k views

What should be the buffer size for the sort command?

I have a machine with 2 TB of RAM and I am running a sort command on a file of size 150G where I have specified the buffer-size as 1000G, after doing my bit of reasearch on google, I got this piece of ...
12
votes
1answer
3k views

What exactly is scrollback and scrollback buffer?

What are "scrollback" and "scrollback buffer" in programs like bash and screen, and how do they relate to the tty, the programs being run, and stdin/ stdout/ stderr? Here is the only definition of ...
3
votes
1answer
150 views

Artificially prime buffer cache?

Is it beneficial to artificially prime the buffer cache when dealing with larger files? Here's a scenario: A large file needs to be processed, line by line. Conceptually, it is easy to parallelize ...
5
votes
3answers
685 views

Piping commands, modify stdin write to stdout

echo Hello World | nano - | less I want to modify Hello -> Goodbye while in the the text editor. It does not have to be with nano. I am stuck with nano reading stdin but requiring me to write to a ...
1
vote
1answer
530 views

How to control buffering of pipes in bash scripts?

I need my script to be executed with stdbuf -i0 -o0 -e0 otherwise user will wonder why there is no output (becuase of pipe buffer). How can I acheive it? #!/usr/bin/stdbuf -i0 -o0 -e0 /bin/bash ...
0
votes
1answer
316 views

Preventing a new instance of a program to open when calling it

My problem is with FBI (frame buffer image viewer) for Linux, but my question and any answers are perhaps applicable to more than only that program. I don't know. Anyway… While things are loading on ...
3
votes
1answer
829 views

Difference between “blockdev --flushbufs” and “sync” on Linux?

Is there a difference in practice between running blockdev --flushbufs and sync(1) on Linux? (apart from blockdev flushing for a specific device, and sync being system-wide). sync(1) manpage says it ...
7
votes
1answer
1k views

`unbuffer` or `stdbuf` for removing stdout buffering?

Is there a difference between unbuffer(1) and stdbuf(1)? From what I gather, unbuffer makes more than the "best effort" of calling the libc function set(X)buf at the beginning, and then letting things ...
1
vote
2answers
6k views

How to reduce buffers\cache

A monitoring system keeps alerting that my machine is reaching\breaking through it's RAM utilization threshold which is 15 GBs. I've done some reading and understood that the apparent RAM utilization ...
2
votes
1answer
121 views

Why don't I see a file being copied right away with ls?

Is it due to the buffering in memory? I did cp /network/large_file . & and I kept doing ls -lh to monitor progress, but the file didn't appear until it was about 400MB. Linux 2.6 kernel, Bash 4, ...
13
votes
3answers
5k views

vim - how can i do a 'change word' using the current paste buffer

I have some text in my paste buffer, e.g. I did a yw (yank word) and now I have 'foo' in my buffer. I now go to the word 'bar' and I want to replace it with my paste buffer. To replace the text ...
4
votes
3answers
1k views

Are there any ways or tools to dump the memory cache and buffer?

As the title, I want to check out what files are loaded in buffer. Just so it's clear, the buffers & cache I'm referring to are what show up when you run the free -m command: $ free -m ...
1
vote
1answer
2k views

very high buffer memory usage [closed]

Is this normal - I've never seen buffers so high? $ cat /proc/meminfo MemTotal: 16332808 kB MemFree: 1112264 kB Buffers: 10630124 kB Cached: 699400 kB SwapCached: 0 kB Active: 3262924 kB Inactive: ...
1
vote
1answer
744 views

Daemontools multilog loses log line time information. How to fix it?

I am using daemontools to monitor a process and its output log. I am using multilog to write the logs to disk. The run script for the log is: #!/bin/bash PATH=/usr/local/bin:/usr/bin:/bin cd ...