1

My infrastructure is: gandi domain, aws dns, route53 api.domain cname pointing to a to self-signed ssl-enabled elb (having 1 elasticbeanstalk instance). Elasticbeanstalk instance is docker-based. That means nginx forwards to docker instance. Docker instance has nginx which serves static files, and reverse-proxies to golang (fastcgi to port 3000). Data is stored on Amazon RDS and is accessed using go-sql-driver.

It looks overly complicated, what is the best way to simplify?

macguy
  • 294
  • 3
  • 12
  • 1
    The title of the question and the question ask different things completely. Do you want to benchmark or simplify your deployment? – Not_a_Golfer Jan 08 '15 at 12:41
  • I want to benchmark and then improve (by simplifying deployment and any other means necessary) – macguy Jan 08 '15 at 13:11

1 Answers1

2

The answer to your header question "How do I benchmark (tried ping, traceroute, pingdom) and improve speed?" is probably best answered by searching for "website benchmarking" or similar. There are many website benchmarking tools out there. (have a look at Siege, ab, boom, boom in Go, or vegeta. There are many more out there, but that should get you started.)

The answer to "It looks overly complicated, what is the best way to simplify?" is:

What do you need it to do?

For a simple, static site, your setup is overly complex. For a distributed, fault redundant, high-availability site, it's nowhere near enough. You need to fit your infrastructure to your needs.

"route53 api.domain cname pointing to a to self-signed ssl-enabled elb (having 1 elasticbeanstalk instance):" Do you need the load balancer? Are you going to add more endpoints? Does the application support load balancing in this way? (will requests be treated atomically, are all requests unique etc.)

"nginx forwards to docker instance:" Do you want to manage the SSL certificate in the Go app, or the NginX config? The way you're running it now is probably the simplest for now, but once again, it depends on your needs.

"Docker instance has nginx which serves static files, and reverse-proxies to golang (fastcgi to port 3000):" This sounds overly complex (but, it depends on what you want). Can this replaced with nginx just serving a directory of static files on that path? Do you need fastCGI at all here?

" Data is stored on Amazon RDS and is accessed using go-sql-driver:" This is fine for AWS, once again, depending on your requirements (performance, compliance etc.)

Hope that helps.

Intermernet
  • 18,604
  • 4
  • 49
  • 61
  • Thank you for answering. It's a startup I'm doing, and if it succeeds, scaling it will be my next step. I'll obviously need it to be fault-redundant, have high-availability, master-read replicas and whatsnot. – macguy Jan 08 '15 at 13:51
  • I'll admit, I went with the load balancer for the ssl (at first). I was thinking of maxing out on vertical scaling, and handling horizontal scaling when the time comes. Concerning atomicity, I'm not too sure how the application will perform. As for managing the ssl certificate, I'd rather go with the fastest option. I developed the application in go, thinking if things go well, a chat component could be added. It sounds like elasticbeanstalk might not be adequate. Wouldn't launching an EC2 instance, and manually installing go be best? – macguy Jan 08 '15 at 14:07
  • @macguy No problem, please note that my answer is basically a bunch of questions. These shouldn't be taken as criticisms, and there are probably valid reasons for all of the components in your suggested setup. It is, however, worth asking the "how can I simplify this?" question all the time. Good luck on the startup! – Intermernet Jan 08 '15 at 14:08
  • On the contrary, believe me when I say this: I'm highly appreciative! I'm asking all these questions because I'm learning things as I go and I'm really not convinced with my current infrastructure. I completely agree: not asking these questions will definitely lead to problems in the future. – macguy Jan 08 '15 at 14:11
  • @macguy "Wouldn't launching an EC2 instance, and manually installing go be best?" Depends on how Amazon go with their container runtime stuff. I'm playing with Google's stuff at the moment, and I think CoreOS and a few others are worth keeping an eye on... This space is moving fast :-) – Intermernet Jan 08 '15 at 14:11
  • Yeah other platforms are worth looking into :) – macguy Jan 08 '15 at 14:12
  • I gather there's no other way than trial and error (removing components 1 by 1) to find out the slowdown culprit? – macguy Jan 08 '15 at 14:15
  • @macguy That may work, but you're better off replacing the Go app with something really simple (A "Hello world" web server) and seeing if the performance drastically increases. If so, then look into RDS or application slowness. If not, it's something else. (elastic beanstalk, ELB, DNS etc). Work out the systems that could be causing the slowness, list them in order of operation, then divide and conquer :-) – Intermernet Jan 08 '15 at 14:22
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/68416/discussion-between-macguy-and-intermernet). – macguy Jan 08 '15 at 14:24