# Server Tuning

Below are the commands that control the web server queue and thread options. These often need to be adjusted for high capacity deployments. The Systemd web server provides security benefits and also allows better monitoring of the `pritunl-web` server process in the `pritunl-web.service` unit.

```shell
# Enable Web Server Systemd
sudo pritunl set app.web_systemd true

# Low Capacity (1 CPU, 4GB RAM)
sudo pritunl set app.request_queue_size 200
sudo pritunl set app.request_accepted_queue_size 100
sudo pritunl set app.request_thread_count 20
sudo pritunl set app.request_max_thread_count 100

# Standard Capacity (2 CPU, 4GB RAM)
sudo pritunl set app.request_queue_size 600
sudo pritunl set app.request_accepted_queue_size 300
sudo pritunl set app.request_thread_count 50
sudo pritunl set app.request_max_thread_count 300

# High Capacity (4 CPU, 4GB RAM)
sudo pritunl set app.request_queue_size 1200
sudo pritunl set app.request_accepted_queue_size 600
sudo pritunl set app.request_thread_count 100
sudo pritunl set app.request_max_thread_count 600

# Extreme Capacity (8 CPU, 8GB RAM)
sudo pritunl set app.request_queue_size 4000
sudo pritunl set app.request_accepted_queue_size 2000
sudo pritunl set app.request_thread_count 100
sudo pritunl set app.request_max_thread_count 2000

# Restart Server After Changes
sudo systemctl restart pritunl
```


---

# 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/vpn/debugging/server-tuning.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.
