Operations Manual
Constrain Resource Usage
DuckDB can use quite a lot of CPU, RAM, and disk space. To avoid denial of service attacks, these resources can be limited.  
The number of CPU threads that DuckDB can use can be set using, for example:  
```sql
SET threads = 4;
```  
Where 4 is the number of allowed threads.  
The maximum amount of memory (RAM) can also be limited, for example:  
```sql
SET memory_limit = '4GB';
```  
The size of the temporary file directory can be limited with:  
```sql
SET max_temp_directory_size = '4GB';
```