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

Re: TMPDIR - Do we also need a drive backed TPMDIR ?



Ritesh Raj Sarraf <rrs@debian.org> writes:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> On Thu, 2016-07-21 at 13:15 +0100, Neil Williams wrote:
>> > Now, back to the actual problem. For many applications, we rely on
>> > the TMPDIR environments. Tools like Python's modules help use these
>> > variables and not worry about the underneath platform.
>> > 
>> > Under Linux, with /tmp more commonly on tmpfs, how are developers
>> > dealing with it? tmpfs is limited and multi gigabyte operations may
>> > end up filling it all (as is the case in the debdelta bug report
>> > above).
>> 
>> As a drive backend, why doesn't swap work for this? There's no mention of swap
>> in the original bug report.
>
> Swap will come into effect when the kernel needs more memory.
>
> As I understand it, TMPDIR on tmpfs is capped, based on the amount of real RAM
> the machine has. And any application's view of TMPDIR is based on that capped
> size.

It's configurable.

See TMPFS_SIZE in /etc/defaults/tmpfs

And it'll cheerfully use swap, so just make sure you have enough swap
for your use case, and set the limit to suit your needs.

Alternatively, you can always create a new temporary location where you
have enough space (i.e. ~/.tmp/ ) and then either set TMPDIR to that in
the relevant user's shell profile/rc or define an alias such as:

  alias debdiff="TMPDIR=~/.debdiff-scratch-space debdiff" 

Cheers, Phil.
-- 
|)|  Philip Hands  [+44 (0)20 8530 9560]  HANDS.COM Ltd.
|-|  http://www.hands.com/    http://ftp.uk.debian.org/
|(|  Hugo-Klemm-Strasse 34,   21075 Hamburg,    GERMANY

Attachment: signature.asc
Description: PGP signature


Reply to: