Avoid flying domestic in China

Xi'an Xianyang International Airport (XIY) departure hall

I originally intended to blog about each city I visited during this vacation in Hong Kong & mainland China, but I got so busy with the actual tourism that I didn’t end up writing anything except for Hong Kong.

However, recent experiences flying (first from Xi’an to Shanghai Pudong, and then from Beijing to my birthplace) have been sufficiently dissatisfactory to warrant a rant about the state of domestic air travel in China.

1. China Southern Airlines problems

Supposedly this is one of the 10 worst airlines in the world, according to Business Insider/Zagat.

Xi’an to Shanghai

Our flight from Xi’an to Shanghai was delayed by about 3 hours. The incoming flight was late supposedly due to weather in Shanghai, so it wasn’t necessarily the airline’s fault. However, communication about the matter was rather poor (see complaints below about the XIY airport) and the delay estimates didn’t seem to be updated in the airline’s electronic systems, even though they knew pretty early on that our flight wouldn’t be able to leave til nearly midnight. China Southern’s website, Google, and (I think) FlightAware, were all providing inaccurate information as a consequence.

Meanwhile, multiple other airlines seemed to have no problem getting planes to fly the same route on time.

Beijing to my hometown

The flight left on time.

Curious observation, not so much a complaint: why did they think it necessary to serve food on a 1.5 hour short haul flight that left at 11 pm? It was a sausage bun of the sort you’d find at an Asian bakery for very cheap… not that one should expect very much of economy class airline food.

I did have an issue with the no mobile phone policy; mobile phone use is prohibited, even in airplane mode. Supposedly this is a Chinese government regulation for which foreigners have been detained for violating. I’m sure older planes with unshielded wiring could be affected by the cumulative effects of everyone’s EM interference—and that’s probably part of why China’s rules haven’t caught up to Europe’s or the US’s—but I really doubt the A320 would have faced much risk from smartphones in airplane mode. A flight attendant actually came around to enforce the rule. Oh well. I suppose we’ll have to blame the government for this obsolete rule.

Deplaning on the tarmac
Deplaning on the tarmac toward a bus to the gate. Sorry for the blur; I took the picture in a hurry.

2. Airport problems

Xi’an Xianyang International Airport (XIY)

The airport was grand and modern—far bigger than was necessary given the remoteness of and air traffic to that city. When we arrived from Hong Kong by Dragonair, we were basically the only arriving international flight; all the other gates seemed to be empty, and our flight’s baggage came on the only active conveyor belt, right next to a sign with such bad Engrish that it substituted an f for what have been a t in “tag”.

The departure hall, too, was much bigger than this city needed. There were other more serious problems, though.

Xi'an Xianyang International Airport (XIY) departure hall
Xi’an Xianyang International Airport (XIY) departure hall

For one, the technology seemed to outpace the capabilities of the people—a recurring observation on this trip. Airport employees made simultaneous, overlapping announcements on the PA system, talking over each other. They also made that gross blowing sound into the microphone each time before starting an announcement, as a mic check. For comparison, I’m told that at many Western airports, announcements are recorded and placed into an automated, prioritized queue (e.g. see Phonetica).

Second, the departure hall featured at least one smoking chamber. The one I observed was a glass booth for people to smoke their cigarettes… but the glass walls didn’t reach the floor, so the booth wasn’t actually isolated from the surrounding environment. Smokers also didn’t close the door fully, which led to that entire gate area smelling like smoke, unfortunately triggering my asthmatic cough repeatedly for those three hours we were delayed there.

Third, there was a ridiculous lack of use of digital information systems. The counter at the gate where we were waiting appeared to lack an airline reservations/logistics computer, and delays were usually not reflected on the airport displays, instead being announced in Chinese and broken Engrish on the PA. On the counter hung a piece of paper, hand-filled with the flight number and the fact that there was a delay. Eventually when we boarded, I don’t even recall if our tickets were scanned—just checked by the gate agent a flight attendant at the gate.

XIY gate counter, with no computer or TV screens specific to that gate
XIY gate counter, with no computer or TV screens specific to that gate

Whatever illusions of modernity and professionalism one got from the physical appearance of the airport were disrupted by these oversights.

Beijing Capital International Airport (PEK) Terminal 2

Never mind that Terminal 2 (T2) and Terminal 3 (T3) are practically separate airports with a minimum connection time (MCT) of 160 minutes for domestic<->international connections… or that the Airport Express train only goes from T3->T2 and not the other way around…

Possibly because of the passenger load at PEK, the airline would not accept checked baggage prior to 3 hours before departure. Consequently, I could not go through security, and had to lug around my heavy suitcase to coffee and dinner in the unsecured area for a few hours… while coping with the dearth of general (i.e. not paid restaurant) seating space prior to security. While I was sipping my drink, I began wheezing and coughing—remember my allergy-related cough?—because some unscrupulous customers were smoking, indoors, in an open restaurant. I can’t believe no one else complained. At last, a waitress told the smoker to put it out.

The story doesn’t get much better after screening. Once inside, I found that my boarding pass did not indicate a gate, and that the terminal displays did not show a gate assignment. My impression, and I could be wrong, is that PEK—and perhaps other airports—does not assign gates until shortly before departure. Unfortunately, that also meant no clear direction to go in the secured area, and nowhere really to sit…

Well, hey, at least I got to charge my phone at a charging station… which other patrons seemed to treat as a garbage bin in table form.

Patrons' food and garbage at a charging station in PEK T2
Patrons’ food and garbage at a charging station in PEK T2

3. The alternative: high speed rail

High speed rail in China is a wonderful thing. We took it from Shanghai to Nanjing in 2nd class, and from Nanjing to Beijing in 1st class seats. In each segment, top speeds exceeded 300 km/h. Trains always left and arrived on time, and seats were more spacious than any economy class seats on an airplane. Typically trains run about every 15 minutes along this route, and all the ones we took on this trip seemed to be filled.

High speed rail from Shanghai
High speed rail from Shanghai

Here are some photos of Chinese high speed rail stations and trains, from my last visit in 2012:

Given that a trip from Shanghai to Beijing in 2nd class would only be 553 RMB (about $89 USD)—uniform pricing regardless of when the ticket is purchased, unlike airfare—and that train stations are generally more convenient to get to/from than airports are—where a high speed rail link exists, I would definitely choose it.

4. Is it any better in the US?

I don’t fly that much in the US, and when I do, it’s often a rather short flight between Philadelphia and Boston. JetBlue and American are pretty nice, though. Even then, the convenience of taking Amtrak to/from 30th Station in Philadelphia and South Station in Boston usually makes rail travel far preferable to short haul flights when rail is an option.

But I doubt the US will ever develop high speed rail as China has. There’s not enough space or money or will—and, arguably, there is no comparable need.

Do you have comparable complaints about domestic air travel in China or the US? Please share.

Changing this site’s tagline

Previously, my site tagline was “News, technology, life, and more.”

As of today, it is now “Technology, law, life, and more.”

When I first started this blog in 2008, I labelled it “A blog discussing current events, news, politics, technology, law and more.” Even then, as a high schooler, I was interested in the law—and in the intersection of law and technology.

I distanced myself from law for a while, enticed by opportunities in engineering and medicine, right around the time I was applying to university and completing my first year of undergrad. Mirroring this stage of my life, I removed the keywords “politics” and “law”. I blogged about healthcare-related issues.

As I now decide between two fantastic law schools to attend next year, I’ve realized that my entire path has been leading me to this intersection of law & technology. But no matter where I go, I will always be a technologist first; the order of words in “Technology, law, life, and more” reflects that (and the deliberate Oxford comma).

It was time to update my blog to publicly acknowledge my choice of path in life—indeed, my return to my true passions.

Installing a Puppet master on CentOS 7 with nginx and Unicorn

Puppet master node successful test

I was experimenting with configuration management tools, and wanted to set up a Puppet master node for my virtualized machines.

It is unfortunate that most guides out there today are tailored specifically for Ubuntu, or rely on prepackaged DEBs that do all the work (which, obviously, don’t really help on CentOS/Fedora/RedHat). This guide on DigitalOcean for setting up a Puppet master on Ubuntu 14.04 is pretty solid, but my own preferences are for CentOS and Fedora. Furthermore, I have completely migrated to using nginx in all my servers, though many deployment guides for Puppet still use Apache and Passenger. And the closest I could find in a guide for CentOS 6, nginx, and Unicorn used SysVinit and God… which are unnecessary now that systemd has been adopted.

(If you’re not as picky, just use Foreman Installer. It’ll take care of everything… even on CentOS 7.)

This guide will use:

  • CentOS 7 (at the time of writing, latest release)
    • systemd
  • nginx 1.7.x (mainline, from official nginx repository)
  • Unicorn
  • Puppet open source 3.7.x

Continue reading “Installing a Puppet master on CentOS 7 with nginx and Unicorn”

Fedora 21 on XenServer

Fedora

In this post:

  1. Prebuilt Fedora Cloud images for XenServer
  2. Kickstart scripts for Fedora Server on XenServer

Fedora
Fedora 21 was just released earlier this week on December 9, 2014. The biggest change was the separation of the distribution into three “products”:

  • Fedora Cloud, a lightweight optimized distribution for public/private clouds, containerization with Docker and Project Atomic.
  • Fedora Server, the traditional platform for running services, usually on a headless host whether virtualized or on baremetal.
  • Fedora Workstation, a developer-friendly desktop running a cutting edge OS.

Of course, as always, OpenStack/KVM and Docker get a lot of love, but Xen and XenServer are once again ignored. This post is my solution. With the prebuilt images distributed here and the kickstart scripts below, you can deploy Fedora 21 on your own XenServer (6.2+).
Continue reading “Fedora 21 on XenServer”

Found some old screenshots…

When I first came to Penn, the website for the Nominations & Elections Committee looked like this:

Old NEC site circa 2011
No, this wasn’t the year 1999… this was in 2011.

NEC website redesign

I set out to redevelop and redesign this, upgrading it from a static HTML site edited over SFTP to a WordPress CMS on Canvas. More importantly, the website redesign in 2012 needed to fit the rebranding that Penn underwent that academic year. In other words, I wanted it to look more like the university’s design. (An email to the Communications office responsible for web assets clarified that we could, in fact, do this.)

Continue reading “Found some old screenshots…”

Google, you should know better

Gmail doesn't recognize YYYY-MM-DD format
Google doesn’t recognize YYYY-MM-DD format in contacts.

The YYYY-MM-DD format (%Y-%m-%d) is an internationally accepted, and standardized (ISO 8601) date format. The entire ISO 8601 system is based on big-endian ordering (greatest-to-least units) within the string, so… year, month, day, hour, minute, second. It makes a hell lot more sense than the American traditional MM/DD/YY format. So much so, in fact, that ANSI and the National Institute of Standards and Technology (NIST) have both adopted it. In some countries, like China, the traditional format in the language follows the same big-endianness: 2006年1月29日, which spells out 2006-01-29.

The advantage of this format isn’t just for programmers, where sorting dates and times requires no special logic (i.e. 2014-01-31 unambiguously precedes 2014-02-01, even if they were both written without delimiter symbols).

The format also eliminates any confusion between the fields. For instance, though colloquial American 11/12/13 should be interpreted as November 12, __13, it could just as easily pass for December 13, 2011. There is no room for confusion in 2013-11-12.

XKCD says it best:

XKCD reminds us of ISO 8601
xkcd: ISO 8601

Now, it’s understandable that maybe Google needs to recognize people’s different formats of entering dates in their colloquial formats, like MM/DD/YY. But there is no excuse not to recognize the YYYY-MM-DD format.

Even more so, because the date in my screenshot, 1995-09-24, has no possible misinterpretation. To any rational human being, there’s no way to think that this is the 9th day of the 24th month (!) of 1995.

PVHVM CentOS 7 on XenServer

In this post:

  1. Benchmarks
  2. Prebuilt image
  3. Kickstart script

Following my previous post on running CentOS 7 and Ubuntu 14.04 as fully-paravirtualized guests on XenServer, I ran some benchmarks to compare the relative performance of fully-paravirtualized (henceforth abbreviated PV) domUs against HVM guests using paravirt drivers and interrupts/timers (henceforth PVHVM).

The performance differences between the two types has been studied for some time. Once upon a time, PV was undoubtedly faster, free of the overhead associated with full hardware emulation. With newer hardware features that have been supported for the last few years, PVHVM, which takes advantage of features in the processor as well as a Linux kernel that recognizes that it is operating as a virtual guest, has surpassed PV performance in most arenas.

Benchmarks

Benchmarks have severe limitations. The statistics here are only meant to be compared relatively among themselves—between the PV and PVHVM guests running exactly the same specs and software. It would be a futile exercise to compare them against VMs running on other servers, which might have better SANs, lighter workloads, or faster CPUs and RAM. The specific test profiles in the Phoronix software are also based on outdated versions of Apache httpd and nginx, which makes them unreliable for assessing real-world performance.

Some of the relevant comparisons:

It’s worth noting that CentOS 7 with a 3.10 kernel performed poorly compared to other distributions—both Fedora 20 (kernel 3.15) and Ubuntu 14.04 (kernel 3.13) outperformed CentOS on web serving workloads (not shown). But the evidence pretty conclusively showed that PVHVM generally performed better than PV on all of the operating systems.

Prebuilt image

Update (2017-04-28): Because these images are now out of date and insecure, the .xva images have been deleted. You should instead use the distribution’s latest cloud images in .qcow2 format, converted for XenServer.

To that end, I’d like to offer a prebuilt CentOS 7.0.1406 image that runs in PVHVM on XenServer. You should feel free to choose between this and the PV version from my previous post, depending on your needs. (If you need to accommodate higher density on your server, you might be better off with PV. Run benchmarks yourself to decide what you should use.)

As before, you can decompress (xz -d ___.xvz.xz or use your GUI of choice) then import through XenCenter (File – Import…) or the command line (xe vm-import filename=___.xva).

This image is provided with no guarantees. Please let me know in the comments if you find an issue with it.

  • CentOS 7.0.1406 (as of 2014-07-31)
    Filename: centos-7.0.1406-20140731-pvhvm-template.xva.xz
    Size: 325 MB xz-compressed; 1.4 GB decompressed
    Specs: 2 vCPUs, 2 GB RAM, 8 GB disk without swap, installed software, with XenServer Tools 6.4.93
    SHA256 hash: c3ef221ae886cea4c3be09996d0cb2049dc2ac8f10dd5323f85beee25ce9d4cd
    MD5 hash: 44583aa3cdbf1db1c62b2db05530ce6f
    Username: centos
    Password: Asdfqwerty

Kickstart script

A PVHVM system requires no special accommodations when installing, except that UEFI and GPT are not certain to be supported. Merely select the “Other install media” option in XenCenter, and use a standard installer ISO/DVD. Do NOT use any of the CentOS or RHEL templates! Those will create PV guests.

An automated kickstart like the one used to create the image above may help you build a generic template. Hit <Tab> at the CentOS DVD menu and append a ks=__ parameter to use a kickstart script hosted at an HTTP location.

The image above was built with the cent70-server-pvhvm.ks script at revision e278f2a8139fb624bc2cdcd9a80d8b51b7910de3, embedded below. If there are any updates to this script, they will be added to the develop branch on GitHub. You can also edit it yourself before deploying.

[github file=/frederickding/xenserver-kickstart/blob/e278f2a8139fb624bc2cdcd9a80d8b51b7910de3/centos-7.0/cent70-server-pvhvm.ks][/github]

Did this help you?

If you were able to use this image or the kickstart, I’d appreciate a brief comment to let me know it worked for you. I’d hope that the bandwidth costs are going to good use!