Pritunl

Pritunl Documentation

Welcome to the Pritunl developer hub. You'll find comprehensive guides and documentation to help you start working with Pritunl as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Scaling

Recomendations for scaling Pritunl on AWS

Below are tables of recommended instance types and the recommended maximum connected clients. For best performance Pritunl servers should be replicated across as many instances as possible handling as few clients as possible. Prices below are estimated costs for AWS deployments.

Server Settings

For large deployments the Max Clients option should be set as low as possible (maximum concurrent clients/nodes in cluster). OpenVPN clients will choose a random server when connecting. Setting the max clients will prevent clients from flooding one node by dropping additional clients to trigger the clients to attempt to connect to a different node.

Creating Empty Hosts

When a user downloads the VPN profile it will contain a list of the hosts in a random order. Unless the official Pritunl client is used and clients have access to the web console port the configuration sync will not be available to update the configuration. For large deployments DNS names should always be used by setting the Public Address field in the host settings. In addition it is best to over estimate the number of hosts needed for the deployment so that client configurations will already contain the DNS names for hosts that will potentially be added in the future. This can be done by adding then removing multiple hosts to the cluster leaving the host entry in the hosts tab. To quickly create hosts with one server remove the /var/lib/pritunl.uuid file then restart the Pritunl service. After the empty hosts have been added fill in the Public Address field and attach the hosts to a server. Attaching empty hosts to a server will not causes issues as Pritunl will not attempt to run a server on an offline host.

To replace the empty hosts with real hosts when scaling delete the empty host and copy the Public Address field. Then attach the real host to the server and adjust the Replication Count.

When a VPN client attempts to connect to an empty or offline host it will fail and move on to the next host this increases the connection time. This can be avoided by adjusting the DNS entries for the empty hosts to the IP address of a running host until the DNS entry is used for a real host. Having multiple DNS entries pointing to the same host will not cause any issues.

remote server3.pritunl.net 16105 udp
remote server5.pritunl.net 16105 udp
remote server2.pritunl.net 16105 udp
remote server0.pritunl.net 16105 udp
remote server4.pritunl.net 16105 udp
remote server1.pritunl.net 16105 udp

Pritunl Recommended Instance Types

Instance Type
Max Clients
Bandwidth
Cost

c4.large

2000

Moderate

$0.03/user
$76.86/month

c4.xlarge

2000

High

$0.07/user
$152.99/month

c4.8xlarge

4000

10gb

$0.30/user
$1226.10/month

MongoDB Recommended Instance Types

Instance Type
Max Clients
Cost

r3.large

20000

$121.52/month

r3.xlarge

40000

$243.76/month

r3.2xlarge

80000

$486.78/month

Example Deployments

Instances
Clients
Cost

r3.large x2 (MongoDB)
c4.large x10 (Pritunl)

Moderate Bandwidth
Best Performance: 2500
Recommended: 5000
Max: 20000

Best Performance: $0.44/user
Recommended: $0.22/user
Max: $0.05/user
$1,100/month

r3.large x2 (MongoDB)
c4.xlarge x10 (Pritunl)

High Bandwidth
Best Performance: 2500
Recommended: 5000
Max: 20000

Best Performance: $0.80/user
Recommended: $0.40/user
Max: $0.10/user
$2,000/month

r3.xlarge x2 (MongoDB)
c4.xlarge x20 (Pritunl)

High Bandwidth
Best Performance: 5000
Recommended: 10000
Max: 40000

Best Performance: $0.80/user
Recommended: $0.40/user
Max: $0.10/user
$4,000/month

r3.xlarge x2 (MongoDB)
c4.xlarge x40 (Pritunl)

High Bandwidth
Best Performance: 10000
Recommended: 20000
Max: 80000

Best Performance: $0.80/user
Recommended: $0.40/user
Max: $0.10/user
$8,000/month

r3.2xlarge x2 (MongoDB)
c4.xlarge x60 (Pritunl)

High Bandwidth
Best Performance: 15000
Recommended: 30000
Max: 120000

Best Performance: $0.76/user
Recommended: $0.38/user
Max: $0.09/user
$11,400/month

Scaling

Recomendations for scaling Pritunl on AWS