📜 ⬆️ ⬇️

AWS Insight: How Placement Groups Work

Hello! image

Many have projects with a highload. Few use clusters on AWS. And those who still use them, should use the Placement group.

What it is


Placement Groups (logical groups) - logical associations of cluster types of AWS instances, which allow to reduce network delays. AWS guarantees 10 Gb speed between servers running in the same placement group. Theoretically, these instances run geographically nearby.
')
At usual placement of instans approximately the following picture turns out:


When instances start in the placement group, the instances are physically close, thus it turns out to win in network delays:


How to create a placement group and run instances in it


There are 2 ways to create both a placement group and to launch instances in it. Note that already launched cars can no longer be placed in the placement group.

1. CLI Tools

Create a placement group:
$ ec2-create-placement-group MyFirstCluster -strategy cluster 

And we will launch 10 cluster GPU instances in it:
 $ ec2-run-instances ami-02f54a6b -n 10 --instance-type cg1.4xlarge --placement-group MyFirstCluster --group MyClusterSecurityGroup 

2. AWS Console

Create a placement group:


And we add 10 new instances to the group, choosing the placement group when creating them:


Performance tests


An article would be “about nothing” if there were no network performance tests between cluster instances outside and in the placement groups.

Test

The test is performed between two Cluster Compute Quadruple Extra Large Instance cluster instances (cc1.4xlarge). On one, the default NGINX is installed and started. On the other is httpd with the Apache Bench tool.

1000 times a line of the form is launched:
 ab -c 60 -n 4000 http://$ADDR/ 

As a result, 1000 * 60 * 4000 = 240.000.000 requests were sent to the server. We will calculate the average response time, and on this we will build our guesses about how well the placement group works.

results

Of course it is hard to figure out whether a test is valid, but that is, that is.

Here is a graph of the average server response time (grep 'Time per request' | grep "across"):


It can be seen that the schedule with servers in the placement group is a little faster than outside it.

findings


When using cluster instances on EC2 / VPC, it is necessary and useful to use Placement Groups. This slightly reduces network latency, which, with long-term use, can significantly affect cluster performance.

AWS recommends that you do not use more than 128 instances in one placement group, therefore it is better to divide them into several groups if you have many servers.

Do you use Placement Groups in your AWS projects? Any interesting performance data?

Source: https://habr.com/ru/post/161315/


All Articles