I want to know about the test procedure of calculating the max clients supported by Openvpn server.
There is no limit to calculate; the answer is "unlimited." Realistically, you will encounter one or more of the following practical limits before you can successfully connect an infinite number of clients.
If the question you meant to ask was
"How many clients can my particular server handle well?" then you should pay particular attention to CPU, Memory, Bandwidth, and possibly fd (socket) benchmarks during testing you must perform.
The following hard-limits are going to apply that are not OpenVPN-specific:
- Sockets. The OS (kernel) imposes per-process limits on sockets and file-descriptors
- Memory. Each client consumes some memory varying a bit depending on the exact configuration. I've found this amounts to around 600k per client. Eventually you will OOM your kernel before you reach "infinite" clients.
The following soft-limits apply where performance suffers after a point:
- CPU. Encryption is processor-intensive, and once a CPU is at 100% performance will degrade. OpenVPN is single-threaded, so any given instance can only use 1 core.
- Bandwidth. This one is fairly self-explanatory.
- Available IP space. OpenVPN will allow clients to connect even when there are no more available IPs, but it is not possible to use OpenVPN meaningfully without assigning them addresses. Given the size of IPv4 (and of course the much-larger IPv6) space, this will never pose a realistic issue.