> For the complete documentation index, see [llms.txt](https://docs.pritunl.com/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pritunl.com/kb/zero/general/long-request-timeouts.md).

# Long Request Timeouts

Increase timeouts for long requests

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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
