# Long Request Timeouts

By default an HTTP connection that is sending or receiving data will timeout after five minutes. A connection that is idle and not sending or receiving data will timeout after one minute.

### Increase File Limits

With a longer timeout more requests can be created and a larger open file limit will need to be configured. This will prevent the server from crashing when hitting the open file limit. After running the commands restart the server.

```shell
sudo sh -c 'echo "* hard nofile 100000" >> /etc/security/limits.conf'
sudo sh -c 'echo "* soft nofile 100000" >> /etc/security/limits.conf'
sudo sh -c 'echo "root hard nofile 100000" >> /etc/security/limits.conf'
sudo sh -c 'echo "root soft nofile 100000" >> /etc/security/limits.conf'
```

### Request Timeouts

To accommodate long requests such as large downloads or uploads the read and write timeout can be increased. Set the read and write timeout to the expected time that the longest request will take in seconds. The commands below will set a one hour timeout. The configuration is stored in the database and only needs to be run on one host in the cluster. Once set the web server on each of the nodes will automatically restart after a few seconds. This can be seen in the logs which will also show the timeout in the starting server event.

```shell
sudo pritunl-zero set router read_timeout 3600
sudo pritunl-zero set router write_timeout 3600
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pritunl.com/kb/zero/general/long-request-timeouts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
