nPerf recommends using Debian, Ubuntu or CentOS for a quick start. However, the nPerf binary is compatible with all Linux 64-bits distributions.
The requirements for nPerf server hosting are the following :
It's highly recommended to use a dedicated server (or VM) because nPerf server needs to listen on standard ports (like 80 & 443). Installation on a dedicated machine is easier.
Configure your firewall to allow the following INCOMING connections from ANYWHERE :
Configure your firewall to allow the following OUTGOING connections to ANYWHERE :
If you plan to setup customized Anti-DDoS protection, please read Anti-DDoS instructions.
nPerf uses HTTP for serving binary files. This implies that if you are using a HTTP server like Apache or Nginx, you'll have to care about this.
You have 2 ways :
Supported systems for deb packages are :
Debian 9/10/11/12 & Ubuntu 18.04/20.04/22.04/24.04 LTS are fully supported for nPerfServer installation, you can get it working in one minute by using nPerf repository :
Please log in as root before running the following commands. You can login as root with sudo -i
or su
Since Ubuntu 22.04, apt-key has been deprecated, here is the new process:
apt-get -y install lsb-release gnupg &&\
wget -qO- https://repo.nperf.com/apt/conf/nperf-server.gpg.key | gpg --dearmor > /usr/share/keyrings/nperf-archive-keyring.gpg &&\
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/nperf-archive-keyring.gpg] https://repo.nperf.com/apt $(lsb_release -sc) main non-free" >> /etc/apt/sources.list.d/nperf.list &&\
apt-get update &&\
apt-get -y install nperf-server
For older Ubuntu & Debian distribs, here is the apt-key process:
apt-get -y install lsb-release gnupg &&\
wget -qO- https://repo.nperf.com/apt/conf/nperf-server.gpg.key | gpg --dearmor > /etc/apt/trusted.gpg.d/nperf.gpg &&\
echo "deb [arch=amd64] http://repo.nperf.com/apt $(lsb_release -sc) main non-free" >> /etc/apt/sources.list.d/nperf.list &&\
apt-get update &&\
apt-get -y install nperf-server
Edit the config file if needed : /etc/nperf/nperf-server.conf
(If you wanna use your legacy HTTP server, set REDIRECT_PORT_80 to 0)
To enable IPv6, uncomment the BIND_IP="::"
line. (Don't forget to send us both IPv4 and IPv6 addresses for server registration)
Then start nPerfServer : /etc/init.d/nperf-server start
To start automatically nPerfServer with the system, please run: systemctl enable nperf-server
Check your server is running: https://server-check.nperf.com/
You want the system to auto-update itself and always stay up-to-date?
Follow our guide : Debian/Ubuntu Auto Update How-To
Please contact us and tell us you have installed your server!
If you have not already opened a ticket on your helpdesk, please use this form: https://www.nperf.com/contact/
Supported systems for rpm packages are :
CentOS 7/8/9 & RedHat 7/8/9 are fully supported for nPerfServer installation, you can get it working in one minute by using nPerf repository :
Please log in as root before running the following commands. You can login as root with sudo -i
or su
yum -y install yum-utils wget &&\
rpm --import https://repo.nperf.com/conf/nperf-server.gpg.key &&\
wget https://repo.nperf.com/rhel/nperf-server.repo -O /tmp/nperf-server.repo &&\
yum-config-manager --add-repo /tmp/nperf-server.repo &&\
yum check-update
yum -y install nperf-server
Please log in as root before running the following commands. You can login as root with sudo -i
or su
yum -y install yum-utils wget &&\
rpm --import https://repo.nperf.com/conf/nperf-server.gpg.sha256.key &&\
wget https://repo.nperf.com/rhel/nperf-server.repo -O /tmp/nperf-server.repo &&\
yum-config-manager --add-repo /tmp/nperf-server.repo &&\
yum check-update
yum -y install nperf-server
Edit the config file if needed : /etc/nperf/nperf-server.conf
(If you wanna use your legacy HTTP server, set REDIRECT_PORT_80 to 0)
To enable IPv6, uncomment the BIND_IP="::"
line. (Don't forget to send us both IPv4 and IPv6 addresses for server registration)
Then start nPerfServer: /etc/init.d/nperf-server start
To start automatically nPerfServer with the system, please run: systemctl enable nperf-server
Since RHEL8, firewalld
is activated by default. You have to setup rules to allow incoming traffic
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent
firewall-cmd --zone=public --add-port=8443/tcp --permanent
Check your server is running: https://server-check.nperf.com/
Please contact us and tell us you have installed your server!
If you have not already opened a ticket on your helpdesk, please use this form: https://www.nperf.com/contact/
If you are hosting other services over HTTP or HTTPS on the same machine, you'll have to keep your working HTTP server installation.
However, nPerf services need to access some files over HTTP too, so you have to setup your server to serve them.
Please note this is an additionnal step, you have to follow the previous step and install nPerfServer first.
REMINDER: If your server is fully dedicated to nPerf, you don't have to follow this step !!!
In order to get efficient speed, we need to read files directly from RAM, this avoid to be limited by the HDD/SSD throughput and generating CPU iowait on the system.
RAM disk size is 1.2 GB. This means it will use 1.2 GB of RAM. Use free -h
to see available RAM.
We assume your HTTP DocumentRoot is in /var/www/html
. Of course, you can adapt it to your needs.
mkdir -p /var/www/html/nperf
echo "tmpfs /var/www/html/nperf tmpfs defaults,size=1200M 0 0" >> /etc/fstab
mount /var/www/html/nperf
addgroup nperf
adduser nperf --home /home/nperf --shell /bin/bash --disabled-password --gecos nperf --ingroup nperf
su - nperf
mkdir http-files
echo "OK" > http-files/latency.txt
wget https://repo.nperf.com/conf/upload.php.src -O http-files/upload.php
Generate binary files (this can take few seconds)
dd if=/dev/urandom bs=1048576 count=10 of=http-files/10MiB.dat
dd if=/dev/urandom bs=1048576 count=100 of=http-files/100MiB.dat
dd if=/dev/urandom bs=1048576 count=1024 of=http-files/1GiB.dat
Return as root
exit
cp -pu /home/nperf/http-files/* /var/www/html/nperf/
Make it persistent on reboot using cron:
echo "@reboot root cp -pu /home/nperf/http-files/* /var/www/html/nperf/" >> /etc/cron.d/nperf-ramdisk
Upload file requires PHP to be installed and configured correctly. Please check.
If you are using a VirtualHost for serving nPerf HTTP files (nperf.example.com
in our example), you have to add an alias for *.nperf.net
.
<VirtualHost *:80>
ServerName nperf.example.com
ServerAlias *.nperf.net
# ...
</VirtualHost>
server {
listen 80;
server_name nperf.example.com *.nperf.net;
...
}
If you want to protect your machine with Anti-DDoS settings, please allow up to 200 connections from the same host at the same time. This will ensure that your server will be working fine with all nPerf tools on all platforms and for all speeds, up to 10 Gb/s and above.