coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sort: new feature: use environment variable to set buffer size


From: Assaf Gordon
Subject: Re: sort: new feature: use environment variable to set buffer size
Date: Thu, 30 Aug 2012 10:20:55 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20120510 Icedove/10.0.4

Jim Meyering wrote, On 08/30/2012 05:02 AM:
> Pádraig Brady wrote:
>> Thanks for the detailed rationale, however
>> ...
>>
>> So currently I'd be 70:30 against adding such a variable.
> 
> Thanks for replying, Pádraig.  Those are good points.
> Another is that we have a strong aversion to adding
> support for new environment variables in coreutils programs
> because it makes formerly-robust usage prone to malfunction or abuse.
> 

Thanks for the detailed reply. I understand your objection to a new environment 
variable.


Perhaps you can suggest an alternative:

I'm looking for a way to make a script (that uses sort with pipe input) be 
adapted "well enough" to work on servers with varying 
hardware (memory and CPU).
When using regular file input, the memory usage will be efficient (with the 
recent changes, based on the file size and up to a certain threshold of 
total/available physical memory).
But when using pipes, there's no easy way to set memory usage, and the default 
is very low.

Perhaps there's a way to use "default_sort_size()" with pipe input? 

Or expose the value returned by "default_sort_size()" as a command-line program 
(similar to "nproc")?
(I couldn't find a portable way to report total/available ram across different 
unix machines).

possibly going on a tangent here, but a small program like "physmem" that will 
report either total, available, or recommended ram could be useful.

Any suggestions will be appreciated.

Thanks,
 -gordon





reply via email to

[Prev in Thread] Current Thread [Next in Thread]