Sea to Sky Gondola Lift Incident

Since picking up skiing last year, I’ve taken some interest in how chairlifts and gondolas work. (For anyone else interested, sites like LiftBlog and Skilifts.org detail lift installation history, specifications and other technical details on lift operations).

According to various news reports, early yesterday morning around 4-5am, staff at the Sea to Sky Gondola heard a loud bang and later discovered the deropement of the system with the haul rope snapped and many cabins fallen to the ground.

Although the Sea to Sky Gondola isn’t a ski hill and I haven’t personally ridden on this gondola, this particular incident hits home because the same type of Doppelmayr gondola system is also used at Whistler Blackcomb where I have skied (and plenty of other ski resorts around the world). So I went out in the afternoon to check out the aftermath, as a catastrophic failure of a gondola haul rope is very rare.

Continue reading “Sea to Sky Gondola Lift Incident”

Why we Pray and How to Pray

“Prayer.” In youth ministry, it’s one of the most common responses youth give when they can’t think of anything else. Catholics who were raised in the faith from childhood may have been taught reciting prayers such as the Our Father, Hail Mary, Glory Be, and other “standard” prayers. Is “prayer” just saying the same words over and over again? Why do we as Catholics pray? And how do we pray to make the most out of it?

In the past two weeks, Fr. Justin Huang, pastor of St. Anthony of Padua parish in Vancouver, preached in his homilies the answers to these questions. I think it was a great reminder for some of us who might be just going through the motions and forgetting the purpose of prayer.

In the following sections, I summarize Fr. Justin’s homilies, but I encourage you to read the full homilies linked to understand the details.

Continue reading “Why we Pray and How to Pray”

Reducing Database Load using Redis and Batched Insert/Update SQL Queries

I’ve been running my “T-Comm” Bus Locator website for over seven years now. As a quick recap, on the backend, it’s a procedural PHP/MySQL website, kind of a typical thing one would see of PHP development circa 2000s.

The high level overview is that every minute or two, the system polls TransLink’s real time information APIs for the locations of the all the buses in the system. The system then calculates some information based on TransLink’s GTFS data, which has the schedule information for the entire system. Then it saves the data into a MySQL database, and some other outputs for use on the web interface.

So naturally as more buses operate during the daytime (up to around a thousand buses), the CPU load increases during the day, then drops off at night (down to several on the Night Bus routes). It could take about two minutes to calculate all the necessary information to update all the buses during the daytime

CPU load over the last week

Last night, I set off to find a quick way to optimize this, without having to rewrite the entire system (which arguably it sort of needs, but that’s for another day). From a cursory at the system resources using tools such as htop, it was pretty obvious that the bottleneck was on the MySQL database and its reading and writing to the relatively slow hard disks.

Continue reading “Reducing Database Load using Redis and Batched Insert/Update SQL Queries”