# Stdout buffering

**URL:** <https://discourse.julialang.org/t/stdout-buffering/111182>\
**Category:** General Usage\
**Tags:** documentation\
**Created:** [March 5, 2024, 10:07am UTC](https://discourse.julialang.org/t/stdout-buffering/111182 "2024-03-05T10:07:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [March 5, 2024, 10:20am UTC](https://discourse.julialang.org/t/stdout-buffering/111182/2 "2024-03-05T10:20:57Z")

</div>

See:

> <https://github.com/JuliaLang/julia/issues/13050>
>
> When 0.4-dev Julia script is submitted to a job manager (SGE), and STDERR/STDLOG… is redirected to a file, this log file is updated very infrequently, approx. once in 3 hours. Is there a way to increase the updates rate?
> 
> The script looks like this:
> 
> \`\`\` bash
> \#!/bin/sh
> \#$ -pe openmp 16
> \#$ -R y
> \#$ -l h\_rt=11:00:00
> \#$ -l h\_vmem=4G
> \#$ -S /bin/bash
> \#$ -m ae
> \#$ -j y
> \#$ -o \<...\>/$JOB\_NAME\_$JOB\_ID.log
> 
> \<...\>
> 
> export NWORKERS=$(($NSLOTS-1))
> 
> julia --color=no -q -p $NWORKERS \<...\>/run.jl \<...\>
> \`\`\`

and this thread:

> [@Set flushing mode for output stream](https://discourse.julialang.org/t/set-flushing-mode-for-output-stream/102546/3):
>
> I think the best way is to Define default buffering for stdout and stderr. On Linux, stdout is line-buffered and stderr is unbuffered (I haven’t verified this, though). I think these are excellent defaults. Give the programmer the ability of setting the buffering behavior of a new stream. Give the programmer the ability of changing the buffering mode of any stream. I’m afraid I don’t think that flushing in println() is the way to go. We expect maximal efficiency when printing into a fully b…

maybe of help, I tried to understand the issues, and make a PR, I probably need to reread (what I wrote), posting in case helpful.

---

_[View the full topic](https://discourse.julialang.org/t/stdout-buffering/111182)._
