Server

Debugging Pritunl server

Getting Information For Bug Report

Use the commands below to get information needed for debugging an issue. Refer to Repair Database for information on repairing the database.

pritunl version
printf "dh:\n" && sudo df -h
printf "free:\n" && sudo free -l -m
printf "pritunl lsof: " && sudo lsof -p `pgrep -x pritunl` | wc -l
printf "pritunl-web lsof: " && sudo lsof -p `pgrep -x pritunl-web` | wc -l
printf "pritunl-dns lsof: " && sudo lsof -p `pgrep -x pritunl-dns` | wc -l
printf "pritunl limits:\n" && sudo cat /proc/`pgrep -x pritunl`/limits
printf "pritunl-web limits:\n" && sudo cat /proc/`pgrep -x pritunl-web`/limits
printf "pritunl-dns limits:\n" && sudo cat /proc/`pgrep -x pritunl-dns`/limits
printf "limits:\n" && sudo sh -c "ulimit -Hn; ulimit -Sn"
sudo netstat -tulpn | grep pritunl
printf "pritunl-http:\n" && curl -I http://localhost/check
printf "pritunl-internal:\n" && curl -I http://localhost:9756/check
printf "pritunl-https:\n" && curl --insecure https://localhost
sudo strace -p `pgrep -x pritunl`
sudo strace -p `pgrep -x pritunl-web`
sudo strace -p `pgrep -x pritunl-dns`

Server Synchronized Time

Several components of a multi-server Pritunl cluster rely on accurate synchronized time on all the servers. It is important to ensure all servers in a cluster have the same time.

Connection Reset Error

If you are seeing the macOS/Linux error connection reset by peer or the Windows error An existing connection was forcibly closed by the remote host in the client logs, this can indicate the Pritunl web server queue is overloaded. Use the commands below to increase this based on the resources available on the system and the requirements for the deployment. Generally, a server should have a thread for each concurrent connection, as the connection requests can take time with some authentication modes and will quickly overload if a server comes online and all clients attempt to reconnect at the same time.

Process Inspection

To debug CPU usage of the pritunl process py-spy can be used. Run the command below to install py-spy from PyPI into the Pritunl packaged Python build. If sampling rate error is shown reduce the --rate 50 option. This will not work for the Golang based pritunl-web and pritunl-dns processes.

Last updated