# Which directories are used for caching/prestaging?

**URL:** <https://forum.duplicati.com/t/which-directories-are-used-for-caching-prestaging/9580>\
**Category:** Support\
**Created:** [April 7, 2020, 8:16pm UTC](https://forum.duplicati.com/t/which-directories-are-used-for-caching-prestaging/9580 "2020-04-07T20:16:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![S1dney](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/s/e480ec/32.png) [@S1dney](https://forum.duplicati.com/u/S1dney)\
**Post date:** [April 7, 2020, 8:16pm UTC](https://forum.duplicati.com/t/which-directories-are-used-for-caching-prestaging/9580/1 "2020-04-07T20:16:28Z")

</div>

Hey all,

I want to make sure the backups don’t really wear out my SSD’s rather quickly so I’m looking into making sure cached data is written to a directory backed by RAM on my host.  
I’ve mapped /tmp of the duplicati docker container to a folder in /tmp on my host (which resides in RAM).

If I’m not mistaking any cache/processing operations that duplicati (docker version) does are (by default) in /tmp, so this should effectively push everything in RAM on my host right?  
Now I’m still seeing about 1/3 of total backup size being written to flash storage, so I’m wondering… Am I missing a location that duplicati uses to maybe compress or encrypt blocks?  
Note that my total RAM usage on the host is at 57% max so it should not be swapping to disk or so.

I’ve been reading a lot of topics on the forum already that discuss SSD wear (like [this topic](https://forum.duplicati.com/t/attention-ssd-users-if-your-temp-directory-isnt-ram-backed-duplicati-will-prematurely-wear-your-ssd/5779/9)) and have been reading the whitepaper [A block­-based storage model for remote online backups in a trust­-no-­one environment](https://www.duplicati.com/assets/Block-basedstorageformat.pdf) but I wasn’t able to find an answer yet.

Running duplicati in a docker container, version 2.0.5.1\_beta\_2020-01-18.  
Thanks for any efforts taken! 🍻

---

<div class="post-metadata">

**Author:** ![drwtsn32](https://forum.duplicati.com/user_avatar/forum.duplicati.com/drwtsn32/32/2591_2.png) [@drwtsn32](https://forum.duplicati.com/u/drwtsn32)\
**Post date:** [April 8, 2020, 12:54am UTC](https://forum.duplicati.com/t/which-directories-are-used-for-caching-prestaging/9580/2 "2020-04-08T00:54:30Z")

</div>

I believe there are only two settings related to this:

[–tempdir](https://duplicati.readthedocs.io/en/latest/06-advanced-options/#tempdir)  
[–asynchronous-upload-folder](https://duplicati.readthedocs.io/en/latest/06-advanced-options/#asynchronous-upload-folder)

The default (for both) is /tmp on Linux from what I can tell. So if you’ve mapped /tmp in the docker container to a RAM drive on your host you should be fine.

---

<div class="post-metadata">

**Author:** ![S1dney](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/s/e480ec/32.png) [@S1dney](https://forum.duplicati.com/u/S1dney)\
**Post date:** [April 8, 2020, 9:19am UTC](https://forum.duplicati.com/t/which-directories-are-used-for-caching-prestaging/9580/3 "2020-04-08T09:19:58Z")

</div>

Thanks!

That’s what I thought, strangely I’m still seeing a quite high number of writes outside of RAM space, therefore this question.  
If someone else has a contribution I’m still open 🙂

Cheers!

---

<div class="post-metadata">

**Author:** ![drwtsn32](https://forum.duplicati.com/user_avatar/forum.duplicati.com/drwtsn32/32/2591_2.png) [@drwtsn32](https://forum.duplicati.com/u/drwtsn32)\
**Post date:** [April 8, 2020, 1:13pm UTC](https://forum.duplicati.com/t/which-directories-are-used-for-caching-prestaging/9580/4 "2020-04-08T13:13:06Z")

</div>

There will be a lot of activity on the sqlite database corresponding to the backup job, but you don’t want to place that in a RAM drive.

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [April 8, 2020, 4:50pm UTC](https://forum.duplicati.com/t/which-directories-are-used-for-caching-prestaging/9580/5 "2020-04-08T16:50:32Z")

</div>

You could conduct more experiments if you like, for example by moving the [Database](https://duplicati.readthedocs.io/en/latest/03-using-the-graphical-user-interface/#database-management) of a test job. [Temporary Files Used By SQLite](https://sqlite.org/tempfiles.html) sometimes are next to the DB, other times they’ll follow [TMPDIR](https://duplicati.readthedocs.io/en/latest/06-advanced-options/#tempdir).

Reportedly, swap for the Docker is the host OS swap, and possibly that’s contributing some writes.  
[iostat -p](https://linux.die.net/man/1/iostat) can give statistics down to the partition level if that helps. I don’t know what other tools do.

---

<div class="post-metadata">

**Author:** ![S1dney](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/s/e480ec/32.png) [@S1dney](https://forum.duplicati.com/u/S1dney)\
**Post date:** [April 13, 2020, 1:20pm UTC](https://forum.duplicati.com/t/which-directories-are-used-for-caching-prestaging/9580/6 "2020-04-13T13:20:01Z")

</div>

Jus wanted to report back on this.  
I did not had the time to look into this further, but as @ts678 said I did notice a lot of write activity regarding SQLite Journal files on the persistent storage, this might indicate the SQLite is writing outside of the /tmp dir for temporary matters.

Thanks for the suggestions both!!  
I will surely check this out when I see time, for now marking as resolved.
