TIL: July 10, 2017

Somehow, I’ve managed for a long time to get by without knowing how to install a shell script in Mac OS X. Good news, it is super easy. Run the following command, with your script of course:

install path/to/my/script /usr/local/bin

And that’s it! Amazing!

TIL: June 27, 2017

Well I already fell behind with this, but I’m working to get back on track. I’ve decided to call this TIL for today I learned.

If you’re using an express or connect based server to back your web application, Use webpack-dev-middleware to use webpack watch mode in your development experience rather than webpack-dev-server to incorporate your backend in your build. Webpack dev server restricts you to using the dumb webpack server, rather than having the smarts of your own backend.

Inspirations

Starting a blog and contributing content back to the software engineering community has long been a goal of mine. I loosely embarked on this venture roughly a year ago, and, as you can see, I’ve made very little progress on actually producing any content for it.

This has two significant effects on my ability to produce content. For one, not writing blogs forms a negative feedback loop in my mind. I know my writing needs to improve, but without writing it doesn’t improve. Having bad writing makes me want to write less, and thus, a negative feedback loop is formed. Second, I maintain a list of topics I’d like to write about. As I’m not writing, that topic list grows longer, increasing the unease on my mind of writing; which of course makes me not want to write as well.

Today, a former intern at Digital Innovation Group (DIG) inspired through his writing. Please, check out his blog here: https://medium.com/@acparas. Every day he writes one thing he learned. Reading through these it quickly became obvious that this is something I need to take on as well. As of today, I’m going to start this practice for the next thirty days, to both improve my writing and get quick content out on my blog.

What I learned Today

Blogging is hard. Hopefully setting some regular content challenges for myself makes me better at it. Thanks Anton.

Using AWS AutoScaling Groups with Citrix NetScaler

Pairing the complex load balancing features of NetScaler with the ease of AWS AutoScaling Groups has been a challenge for us. I’ll attempt to describe our setup in a way that allows others to set up a similar setup if they so wish.

Our Setup

For all traffic from the greater internet into our servers, we have to pass it through NetScaler and Palo Alto. This has posed a bit of a challenge with resolving IPs. Pointing directly to a server is a simple task, simply add the IP of the server to a NetScaler service group.

But what if you want to use AutoScaling? AWS provides great autoscaling features that make it almost trivial to quickly scale up and down. Unfortunately, they are built to work best with AWS ELBs, which is great if that’s all you need.

The dirty solution

The first thing we tried to do is point NetScalers to ELBs. The thinking was we could point the NetScaler to the DNS entry of the ELB, which we would add when the ELB was created. This seemed like it worked, but stress testing revealed a critical flaw with the AutoScaling Group (ASG) spanning multiple Availability Zones. The ELB would switch IPs, and the DNS wouldn’t catch up with the requests. As a result, every so often you’d see a spurt of failures.

Can we find a better solution?

Even before this issue cropped up, red flags were cropping up. The ELB is an extra hop, which is never preferable if it can be avoided. Furthermore, the NetScaler is a load balancer, so we were effectively load balancing a load balancer.

The solution is to add the instances in the ASG to the NetScaler service group as they come up and down.

ASGs offer a feature to add notifications on on instance creation and termination. You simply provide the ASG an SNS topic. We then created a lambda subscribed to the SNS topic to process the events. A python script then adds the server to a service group in the NetScaler.

In my next post, I’ll post some code of how we actually do this, and get into the details.

First attempt

I haven’t quite decided what I want to blog about yet, but I know it will involve my passion, software engineering. I’ll probably focus on aspects of design and projects in general, taking lessons learned in my workplace and sharing them with others (to the extent that I can). I’ll also probably just post interesting things that I want to share as well. Signing off.