Software


CRDs Killed the Free Kubernetes Control Plane

Today, Google announced that it is killing the free control plane for GKE clusters, except for one free zonal cluster per billing account. Let’s look at the timeline of events (source: release notes archive):

  • June 2015 (k8s 0.19.3) - Kubernetes master VMs are no longer created for new clusters. They are now run as a hosted service. There is no Compute Engine instance charge for the hosted master.
  • End of 2015 (k8s 1.0.x) - $0.15 per cluster per hour over 6 nodes, free for clusters 5 nodes and under
  • November 2017 (k8s 1.8.x) - Eliminated control plane management fees
  • Starting June 6, 2020 (k8s 1.17.x?) - $0.10 per cluster per hour, except for one free zonal cluster per billing account. Also adds SLA if using default version offered in the Stable channel

This post explores how Custom Resource Definitions (CRDs), which were introduced at v1beta1 in Kubernetes version 1.8 and v1 in 1.16 have been used & abused, and killed the free Kubernetes control plane.


.NET Core MVC Thread Pool: Sequential vs Async Performance

I’ve been working with .NET Core lately and am really enjoying C#. I was interested in finding out more about how to increase RPS in a backend web environment. Some online research shows that .NET threads are heavy, and that .NET uses M:M threading, so the OS will do the context switching between threads. This is especially concerning in a web application because I/O intensive operations such as Database and API calls will cause threads to block and use up system resources.


Yii2 PHP 7 Performance

PHP 7.0.0 was just tagged yesterday, and I was interested to see if it could live up to the performance claims that Zend made. Yii2 is my PHP framework of choice, so I built PHP 7.0.0 from source, stress tested one of my application’s pages, and compared performance to PHP 5.6.4.

Benchmark Results

The maximum acceptable levels here for web performance are PHP 5.6.4 serving between 75-100 RPS at between a 31ms-176ms response time and PHP 7.0.0 serving 175 RPS at a 47ms response time.

PHP 7.0.0 does a very nice job here- about 2x the performance for serving Yii2! It seems that it is definitely worth upgrading.


Buzzfeed What State do you Actually Belong In Revealed

Buzzfeed recently released a quiz that has been getting a lot of attention on my Facebook news feed, titled “What State Do You Actually Belong In?“. The quiz consists of 12 sets of 12 questions and then produce an answer of a state that you supposedly closely identify with. According to Buzzfeeed, I belong in Minnesota, which is far too cold and obviously incorrect, so I decided to do some digging to figure out how their quiz system works.

buzzfeed-state-quiz

To view the states that Buzzfeed assigned to each quiz answer, view my What State Do You Actually Belong In Revealed (PDF). To see how I created this file, continue reading…


Yii Framework Active Record INSERT … ON DUPLICATE KEY UPDATE

Recently I was programming in the Yii Framework and ran into a situation where I wanted to use INSERT … ON DUPLICATE KEY UPDATE in an Active Record. In my research, I discovered that this is specific to MySQL. In my case, this was still be a valuable requirement for my Web Application and was worth extending Yii to get working. My approach was as follows:


Dojo / Dojox Mobile mblDomButton Icon List for Android and iPhone Themes

The Dojo Mobile Android and iPhone themes contain default icons that can be used in widgets, such as dojox.mobile.ListItem and dojox.mobile.ToolBarButton widgets. These icons all start with the prefix “mblDomButton”. I could not find a detailed list of these icons, so I searched through the Android and iPhone CSS files to find everything with the mblDomButton prefix. I have an Android and iPhone page listing these icons and displaying them, both shown below.


Automatically Take EBS Snapshots and Delete Old Ones with PHP Script

I am a big fan of Amazon’s RDS product, which takes automated nightly snapshots of your RDS Storage and deletes old snapshots after a specified amount of time. After reading that Amazon’s EBS drives sustain a 0.1% – 0.5% Annual Failure Rate, I also wanted to take automated nightly snapshots of my EBS drives. Deleting snapshots after a certain number of days was also of interest, because this way I am not over-paying for snapshot storage at Amazon or removing snapshots manually. I also wanted to email the results to myself after backups were taken.

I did some searching on Google and found a nice script by Chris at Applied Trust Engineering, Inc. that runs PHP from the command line to create an automatic snapshot. I used this script as an example to setup my script, so thanks, Chris. My script has support for:

  • Backup Multiple EBS Volumes
  • Protect against script running again and creating another snapshot too soon
  • Delete Snapshots after a Specified Period of Time
  • Script outputs Detailed Snapshot Information for these 5 categories:
    • Snapshots that succeeded
    • Snapshots that failed and had errors
    • Old Snapshots that were removed
    • Old Snapshots that had errors while trying to remove
    • Snapshots that were preserved
  • Includes PHPMailer code to email results of script to yourself

Script Setup

You will need: (all links open in new window)

  • My ebs_backup.php Code (download is a zip) (or look below)
  • Stores snapshot information in “./snapshot_information.json” – Make sure PHP can write this file
  • Configure the lines of code within the configuration comment blocks
  • Run script periodically to your needs with CRON or whatever
  • Requires AWS PHP SDK be configured for your AWS Account: http://aws.amazon.com/sdkforphp/
  • Optional PHPMailer Support to email results to yourself: http://phpmailer.worxware.com/ (configure PHPMailer at the very bottom of the script)

Screenshot of Output

Automatic EBS Snapshots


Chrome Extension to Block News Feed Posts on Facebook

Today, North Carolina is voting on a Constitutional Ban of same-sex marriage and civil unions. While I am opposed to the amendment, my Facebook news feed has become quite cluttered lately full of other people’s opinions on the matter. I have created a chrome extension to make it easy to block these News Feed stories and easily unfriend the pesky poster…

changes to:

The Extension

Here is the Chrome extension that will block every post with the word “amendment” in it and allow you to easily unfriend the poster:

amendment_none.crx


Naming Conventions Matter – Case Sensitivity in MYSQL and File Systems

I have been in the process of transferring a PHP + MYSQL site built on CodeIgniter from a Windows server to a Linux server and have been dealing case sensitivity problems due to the CamelCase naming convention that was used in parts of the website. This post discusses different options that you should be aware of when deciding on naming conventions if you plan on making your application compatible with both Linux and Windows.

Naming Conventions Matter