I have an Amazon Elastic Compute Cloud (Amazon EC2) instance and I want to find the network packets per second (PPS) limit for that instance.
The PPS for an Amazon EC2 instance depends on a number of network characteristics for the instance. This includes:
- Traffic mix, Transmission Control Protocol (TCP) versus User Datagram Protocol (UDP)
- Number of flows
- Packet size
- New connections versus existing connections
- Applied security group rules
PPS allowance is considered separately from the overall bandwidth allowance. While an instance might be under overall bandwidth allowance, the PPS allowance can be exceeded if the mean packet size is too small.
Customers can perform PPS benchmarking using the iperf2 test. Depending on the network characteristics, this test can help customers find out the approximate PPS limit of any Amazon EC2 Instance subjective to the network characteristics highlighted earlier.
To perform an iperf2 test, do the following:
1. Create two Amazon EC2 instances in the same Availability Zone (AZ) using an Amazon Linux 2 image. The instance type of both the instances should be similar.
2. Install development tools and git on both instances by running the following commands:
sudo yum groupinstall "Development Tools"
sudo yum install git
3. Clone iperf code on both Amazon EC2 instances by running the following commands:
sudo git clone https://git.code.sf.net/p/iperf2/code iperf2-code
4. Build and install the package on both Amazon EC2 instances using the following:
sudo make install
5. Run iperf on one instance while in listening mode. This instance will act as a server for your iperf test:
sudo /usr/local/bin/iperf -s -u
6. Run the following iperf command on the other instance. This instance will act as a client:
sudo /usr/local/bin/iperf -c <private_IP_of_server_instance> -u -i 1 -l 16 -b 20kpps -e -P64
The response shows you the maximum PPS achieved for this instance type. For more information, see MANPAGE of IPERF.