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 Placement groups.

    What it is


    Placement Groups - Logical associations of cluster types of AWS instances to reduce network latency. AWS guarantees a speed of 10 Gb between servers running in the same placement group. Purely theoretically, these instances run geographically nearby.

    With the usual deployment of instances, the following picture is obtained:


    At the start of instances 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 a placement group and launch instances in it. Note that already running cars can no longer be placed in the placement group.

    1. CLI Tools

    Let's create a placement group:
    $ ec2-create-placement-group MyFirstCluster -strategy cluster
    

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

    2. AWS Console

    We create a placement group:


    And add 10 new instances to the group, choosing a placement group when they are created:


    Performance tests


    An article would be “about nothing” if it did not have network performance tests between cluster instances outside and in placement groups.

    Test

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

    1000 times a line of the form starts:
    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, on this and we will build our guesses about how well the placement of the group works.

    results

    Of course, it’s hard to figure out whether the test is eligible, but what 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 graph with the servers in the placement group is a little faster than outside.

    conclusions


    When using clustered 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, so it is better to divide them into several groups if you have many servers.

    Do you use Placement Groups in your AWS projects? Is there any interesting performance data?

    Also popular now: