1

In an amazon EC2 instance, we pay for each GB of data transfer in/out.

Which means, when are sent to server, it's data transfer in. When a user access some website hosted there, data is being transfered out (size of the page depends on how much text, how many images, etc).

The server has SQL Server database, so its local. However, if I try to connect to the database using via my elastic public IP instead of localhost or private ip in the connection string, do it count as Data Transfer Out, like it was coming from outside the server? Do this consumes bandwidth?

6
  • 1
    aws.amazon.com/ec2/pricing/#Data_Transfer states EC2 transfer from the Internet in is free, but if you use the public IP from within the zone it'll be $0.01/GB in. Use the private IP or localhost.
    – ceejayoz
    Jun 16, 2016 at 1:07
  • @ceejayoz thanks for your help. I changed to localhost. In my security group, do I still need to keep an Outbound rule for MS SQL (TCP protocol, port 1433)? I thought removing this rule, would not allow me to connect to my database remotely anymore, but the website would still connect since it's local. Jun 16, 2016 at 1:20
  • You don't need any security groups if you're solely using it as localhost. If you want to connect remotely from your personal computer, you'll need a rule allowing that your IP in.
    – ceejayoz
    Jun 16, 2016 at 1:33
  • @ceejayoz The website and db are hosted in same server, but people use the website. I configured my domain to point to amazon nameservers, and configured amazon A records in route 53 to resolve to my public elastic IP. Should I point it to private IP as well? My issue is the excess of data transfer out to internet usage. It's free until 1GB, after it's 0,09 per GB. My website is consuming about 1GB/day for about 1000 visits/day. Jun 16, 2016 at 1:49
  • 2
    You're mixing all sorts of concepts into a big jumble. Your users (who access it via the domain, which should be pointed at the EC2 public IP) will be accessing the website, which incurs inbound traffic to EC2 (free) and outbound traffic from EC2 (paid). Your code running on the server will communicate to the database within the same instance (free) via localhost (not the elastic IP). If you're using a GB a day of outbound bandwidth, you'll be paying about $3/month in bandwidth costs.
    – ceejayoz
    Jun 16, 2016 at 1:56

0

You must log in to answer this question.

Browse other questions tagged .