I've been looking for an EC2 instance type that has good network performance (at least as good as the c3.2x), but I don't need almost any other resources, since I'm using this server solely as an HAProxy load balancing server.

But the tiers only seem to be focused on all the other factors of the server (RAM, CPU cores, graphics cards, etc.) and then network just goes up with it (roughly) equally on all types. Basically, I need the hardware performance of a t2.med, but the network speed of, say, a c4. Any thoughts?

I also thought this may be important to note, I have used ELB, but it just doesn't have any where near the control that HAProxy has.

  • I would suggest reconsidering the ELB and the more modern Application Load Balancer. A single HAProxy isn't highly available at all. If that instance goes down, availability zone gets knocked out, backbone goes down - your down. This is something ELBs don't have an issue with. Amazon has provided us the innovation and technology to accomplish most our tasks efficiently, reliably and cost effectively. So it's up to you if you want the costs and headaches then still not have high availability. – Appleoddity Sep 26 '17 at 23:55
  • @Appleoddity it isn't a single instance of course, but we needed more control over behavior of it, since we're using MySQL where different ports get balanced to the same servers in different ways – Brian Leishman Feb 4 at 13:52

In AWS network performance tends to scale with CPU count. If you need higher network bandwidth you usually need to use a larger instance size.

This website has a good chart of network performance vs cost. If you sort by network performance you can run your eye down the price column and find the instance that has the performance you need for the best price.

For example, r4.large at $0.13/h is pretty good value, but is still three times more expensive than a t2.medium. The m3.medium at 0.067c/hr is worth considering.

You should probably reconsider using managed services like ELB. I also wonder if you could use a number of t2 instances in parallel, but that depends on what you're doing.

  • Seems to be the same conclusion I've come to, currently I'm using a c4 (1 cent more than the m4), but it just seemed so overkill – Brian Leishman Sep 26 '17 at 22:29
  • I've read the Google Cloud has better I/O than AWS. That probably doesn't help, but it's interesting. – Tim Sep 26 '17 at 23:11
  • @BrianLeishman, more specific network performance specs for some instance types are somewhat inauspiciously documented here. The t2 class isn't mentioned, but if I recall from testing, a t2.medium has about 500 Mbits/sec of network. Do you not find that? I use nothing but t2's for my HAProxy deployments, with even the nanos handling hundreds of thousands of requests per day, sometimes even including SSL termination, while barely tickling their credit balances. – Michael - sqlbot Sep 26 '17 at 23:22
  • @Michael-sqlbot I did try that actually, but we definitely run out of "burst" pretty quickly, and then the system slowed down to a halt. I am however, using a t2 for my failover LB, since that one should be, and doesn't need to be, constantly running – Brian Leishman Sep 27 '17 at 13:11

The R4 series have ENA's which are higher thoroughput, lower latency interfaces.


As a benefit of using an r4, you'll have a bunch of a extra memory that you can run something like varnish in.

Otherwise, most instance types have pretty decent fractional 10GB adapters. If you need the "resources of t2.medium" but better outright performance, a c4.large might be up to the job. They have significantly better compute performance. They're a good fit for HAProxy because you're probably terminating SSL there, which is compute intensive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.