![Lead Image © Lucy Baldwin, 123RF.com Lead Image © Lucy Baldwin, 123RF.com](/var/ezflow_site/storage/images/archive/2021/65/comparing-startup-times-of-linux-distros-in-the-cloud/perf_dojo_123rf_9719495_lucybaldwin_resized.png/187115-1-eng-US/Perf_Dojo_123RF_9719495_LucyBaldwin_resized.png_medium.png)
Lead Image © Lucy Baldwin, 123RF.com
Comparing startup times of Linux distros in the cloud
Cloud Startup
Launching instances on Amazon Elastic Compute Cloud (EC2) can be a lengthy affair for those used to instant gratification, taking entire minutes to complete. Historically, Windows instances have brought up the rear by taking considerably longer to initialize than Linux-based instances because of sysprep
and the reboot that follows. The open source world is somewhat more streamlined, but there is still considerable variance between Linux distributions, with one to two minutes being a reasonable expectation of first availability.
One Ping Only, Please
Trying to connect multiple times as an instance boots is inelegant. Fortunately, you can use shell-fu to script your way out of this. The BSD version of ping
[1], notably on macOS, includes a convenient "one ping only" option (-o
) that I would like to think honors Sean Connery's famous quote in Hunt for Red October
. The option terminates ping
once the first reply is received. Like Connery's character, Captain Marko Ramius, you can use this option to ask for "one ping only, please" (Listing 1).
Listing 1
One Ping Only
$ ping -o 52.90.56.122; sleep 2; ssh ubuntu@52.90.56.122 PING 52.90.56.122 (52.90.56.122): 56 data bytes Request timeout for icmp_seq 0 Request timeout for icmp_seq 1 Request timeout for icmp_seq 2 64 bytes from 52.90.56.122: icmp_seq=3 ttl=48 time=40.492 ms [ output truncated ] Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-56-aws x86_64)
Whether you launch the instance with the Amazon Web Services (AWS) Console [2] or
...Buy this article as PDF
(incl. VAT)