Question
What is the FME_TEMP environment variable?
Answer
FME_TEMP
FME puts many temporary files in the system temporary directory, which on some Windows versions defaults to C:\temp or under the user local temp directory (i.e. C:\Users\mark\AppData\Local\Temp). If there is not enough room in this directory due to space limitations on the C:\ drive, you can override this default and send the FME temporary files to a different directory using the FME_TEMP environment variable. The FME_TEMP environment variable can be used for both FME Form (formerly FME Desktop) as well as FME Flow (formerly FME Server) using the steps below.
Windows
Control Panel > System and Security > System > Advanced system settings > Environment Variables
FME searches for a temp directory using the following tests in order:
- If the user environment variable FME_TEMP exists, use its value as the temporary directory path.
- If the user environment variable TEMP exists, use its value as the temporary directory path.
- If a directory called \temp exists on the drive on which FME is running, use that directory.
- If a directory called \tmp exists on the drive on which FME is running, use that directory.
If all of these tests fail to locate an existing temporary directory, FME ends with an error message indicating that it couldn't open a temporary file.
To remedy this situation, either:
Create an <FMEdrive>:\temp or <FMEdrive>:\tmp directory (where <FMEdrive> is the drive on which FME is running).
OR
Define the FME_TEMP or TEMP user environment variable, either system-wide or for the user account on which FME is running. For example, if the temporary files are to be placed into the directory j:\scratch then the environment variable FME_TEMP would be set to j:\scratch before FME is run.
Some operating systems default to a RAM drive for the temp drive. This means that FME caching may consume RAM, which can affect performance. Setting FME_TEMP will force FME to cache to a physical drive which may improve performance.
If using the FME_TEMP environment variable to change the temporary system folder for FME Flow, please be sure to set FME_TEMP in the system environment variables and not the user environment variables. It is also recommended that you restart FME Flow in order to have the changes take effect.
Linux
On LINUX platforms such as Ubuntu, you'd set the environment variable in /etc/environment, e.g.
FME_TEMP=/<temp folder
To set FME_TEMP differently for each user, FME_TEMP can be set in ~/.profile
This will take precedence over the path set in /etc/environment.
If FME_TEMP is set in ~/.bashrc like
export FME_TEMP=/<temp folder then that will only affect FME translations run from the console or Workbench if started from the console.
To effect FME Workbench when started from the menu, set FME_TEMP in /etc/environment or ~/.profile
FME Workbench creates temporary mapping files in the directory pointed to by the TEMP environment variable if set. Otherwise, C:\temp is used.
FME Flow will also make use of the FME_TEMP directory. Typically, the automatically generated directory for data download and data streaming results looks something like
C:\ProgramData\Safe Software\FME Flow\resources\system\temp\requestdata\FME_4F366F63_1437683309563_2288
but this can be overridden using FME_TEMP.
SAIF Format and Temporary Files
If anyone is using the SAIF format, this format behaves differently (for historical reasons). SAIF also uses temporary files as it reads/writes, but that module uses the environment variables...
- STK_TMPDIR
- TMPDIR
in the order shown to figure out what temporary directories the SAIF writer/reader will use.
Note: SAIF has been depreciated as of FME 2023.0, for more information, please see FME Deprecations.
Performance Tuning with FME_TEMP
Many of the FME temporary files are created when caching data for larger datasets or for display in FME. Using a faster hard drive can make quite a difference to the FME translation if disc cache I/O speeds are improved. An example would be if you have an SSD (Solid State Drive) on your computer. These are typically quite a bit faster than traditional HHD drives, so if you can point your FME_TEMP to an SSD then you'll see a bit of a performance increase when working with larger datasets. More on performance tuning at Performance Tuning FME
Purging Temp Files
For more information, see Why did the temporary files not get deleted from my translation?
Comments
0 comments
Please sign in to leave a comment.