An accelerator can reduce the time it takes to reach a server, it does this by routing your network packets through to AWS global network (rather than going through the general internet).
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-188-1024x789.png)
Let’s create one
An accelerator also able to load balance and you can specify the weights/traffic dials (percentage of traffic that goes to each endpoints).
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-189.png)
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-164.png)
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-174.png)
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-166.png)
Configure the endpoint groups, I specified that 70% of traffic (Traffic dial) should go to my Singapore end group.
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-167.png)
For each endpoint group I configure port overrides. Advantage of this is because in Linux for ports below to 1024 requires root privilege to run, I can use non root user to run services on higher ports. Running services as root is considered less secure (if the service gets cracked/hacked then the cracker/hacker will have root privilege).
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-168.png)
You can also customize the health check parameters
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-173.png)
Specify the endpoints in each endpoint group, here I am using EC2 instances, but they are other types you can choose from. I specified the same weight 128, which means I want traffic to be divided equally 50% 50% between the 2 instances.
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-170.png)
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-171.png)
Once created you can start testing.
On my instances, I have nginx running on port 80, 8080 and 8090.
Mine had a warning, I forgot to set the security groups to allow port 8080 and 8090. Let’s fix that.
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-172-1024x29.png)
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-175-1024x34.png)
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-176.png)
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-178.png)
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-181.png)
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-179.png)
Is client IP preserved?
After checking the nginx access logs, yes, client IP is preserved, which is good and as advertised.
However, even though I specified health checks to be done every 30 seconds. Seems like the health checks are a lot more frequent.
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-180-1024x608.png)
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-182.png)
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-183.png)
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-184.png)
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-185.png)
Unhealthy endpoints
Let’s see what is the behaviour of the accelerator when 1 or more endpoints are unhealthy. I stopped the nginx services on 2 of the Singapore instances.
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-190-1024x216.png)
The results are as expected, the accelerator will only choose the healthy endpoints. All good using any of the 2 accelerator IP addresses, the accelerator DNS name and Route53 DNS name.
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-195.png)
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-196.png)
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-197.png)
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-198.png)
AWS also provides a speed comparison tool so you can evaluate and see for yourself what are the speed improvements from where you are located. It is available on https://speedtest.globalaccelerator.aws/
![](https://zestycoder.com/wp-content/uploads/sites/8/2023/10/image-199-1024x533.png)