Amazon Project Kuiper – job openings in my team


Are you looking for new challenges?
At Project Kuiper we are working to provide broadband internet service to tens of millions of people around the world who are currently underserved. Come join us!

Do you want to know more about this project? have a look to this video:


Here are some of our current openings. Feel free to reach out directly to me if you want to know more about these or other positions.

Software Engineer

Senior Systems Development Engineer

Senior Ecad Tools Application Engineer

Systems Dev Engineer Enterprise Engineering

Atlassian Support Engineer

Systems Engineer

EBS Storage Performance Notes – Instance throughput vs Volume throughput


I just wanted to write a couple lines/guidance on this regard as this is a recurring question when configuring storage, not only in the cloud, but can also happen on bare metal servers.

What is throughput on a volume?

Throughput is the measure of the amount of data transferred from/to a storage device per time unit (typically seconds).

The throughput consumed on a volume is calculated using this formula:

IOPS (IO Ops per second) x BS (block size)= Throughput

As example, if we are writing at 1200 Ops/Sec, and the chunk write size is around 125Kb, we will have a total throughput of about 150Mb/sec.

Why is this important?

This is important because we have to be aware of the Maximum Total Throughput Capacity for a specific volume vs the Maximum Total Instance Throughput.

Because, if your instance type (or server) is able to produce a throughput of 1250MiB/s (i.e M4.16xl)) and your EBS Maximum Throughput is 500MiB/s (i.e. ST1), not only you will hit a bottleneck trying to write to the specific volumes, but also throttling might occur (i.e. EBS on cloud services).

How do I find what is the Maximum throughput for EC2 instances and EBS volumes?

Here is documentation about Maximum Instance Throughput for every instance type on EC2: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-optimized.html

And here about the EBS Maximum Volume throughput: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html

How do I solve the problem ?

If we have an instance/server that has more throughput capabilities than the volume, just add or split the storage capacity into more volumes. So the load/throughput will be distributed across the volumes.

As an example, here are some metrics with different volume configurations:

1 x 3000GB – 9000IOPS volume:

GP2-1x3000GB-9000IOPS

3 x 1000GB – 3000IOPS volume:

GP2-3x1000GB-3000IOPS

Look at some of the metrics: these are using the same instance type (m4.10xl – 500Mb/s throughput), same volume type (GP2 – 160Mb/s throughput) and running the same job:

  • Using 1 volume, Write/Read Latency is around 20-25 ms/op. This value is high compared to 3x1000GB volumes.
  • Using 1 volume, Avg Queue length 25. The queue depth is the number of pending I/O requests from your application to your volume. For maximum consistency, a Provisioned IOPS volume must maintain an average queue depth (rounded to the nearest whole number) of one for every 500 provisioned IOPS in a minute. On this scenario 9000/500=18. Queue length of 18 or higher will be needed to reach 9000 IOPS.
  • Burst Balance is 100%, which is Ok, but if this balance drops to zero (it will happen if volume capacity keeps being exceeded), all the requests will be throttled and you’ll start seeing IO errors.
  • On both scenarios, Avg Write Size is pretty large (around 125KiB/op) which will typically cause the volume to hit the throughput limit before hitting the IOPS limit.
  • Using 1 volume, Write throughput is around 1200 Ops/Sec. Having write size around 125Kb, it will consume about 150Mb/sec. (IOPS x BS = Throughput)

log4j vulnerability – quick notes


This issue may lead to remote code execution (RCE) via use of JNDI.

  • Vendor: Apache Software Foundation
    • Product: Apache Log4j
      • <=2.14.1: affects 2.14.1 and prior versions

Fix: log4j 2.15.0

To list all JAR files on your system containing the vulnerable class file (including fat JARs), you can use:

for f in $(find . -name '*.jar' 2>/dev/null); do echo "Checking $f…"; unzip -l "$f" | grep -F org/apache/logging/log4j/core/lookup/JndiLookup.class; done

Additional details here:

https://www.cve.org/CVERecord?id=CVE-2021-44228

Raspberry Pi + Java R2D2 Robot – Part 1


This project was born as a Coronavirus project for my kids (you know how difficult could be to have your kids all day at home… oh school: please come back, we forgive you!)

On this post we cover the initial steps, including the full platform/chassis running, commanded by a Raspberry Pi and some Java code.

On this video we can see the chassis running:

 

The body of the R2D2 will be a 12″ cardboard tube from Home Depot. The chassis aluminum flat bars are also from HD:

2020-04-18 10.16.05

 

R2D2 head will be molded from a balloon, newspaper paper and paste (flour + water):

2020-04-18 11.46.58

 

Chassis design:

2020-04-18 11.47.28

 

Cutting, drilling and assembling:

2020-04-18 12.28.45

2020-04-18 12.34.452020-04-18 12.53.332020-04-18 12.57.15

 

 

 

 

 

 

 

 

 

 

 

This is how the chassis will fit into the tube:

2020-04-18 12.46.53

 

Soldering:

2020-04-18 13.09.55-4

 

Wheels in place:

2020-04-18 14.02.44

 

Preliminary setup and code testing:

2020-04-18 14.13.242020-04-19 11.05.302020-04-19 12.09.46-22020-04-19 12.09.46

 

 

 

 

 

 

 

 

 

 

Final assembly of the chassis:

2020-04-19 12.42.58

 

We are using two separate battery packs: one for the raspberry and a second one (more amps and 12V) for the motors and the L298n motor driver:2020-04-19 13.02.19

 

To be continued…..

2020-04-19 18.24.02

Proyecto Raspberry Pi + Java R2D2 Robot – Parte 1


Este proyecto nacio a causa del Coronavirus como una manera de mantener entretenidos a mis hijos (me imagino que ya saben que complicado puede ser tener a los chicos todo el dia en casa… Escuela volve!!)

En este post les muestro los pasos iniciales, incluyendo la construccion de la plataforma/chasis, y su funcionamiento comandado por un Raspberry Pi y algo de codigo en Java

En este video, vemos como funciona hasta ahora con el chassis ya ensamblado:

 

El “cuerp” del R2D2 es un tubo de carton de 12″ de los que se usan en construccion. El chasis esta construido con barras planas de aluminio:

2020-04-18 10.16.05

 

La cabeza del R2D2 se moldea con un globo, papel de diario y engrudo (agua y harina):

2020-04-18 11.46.58

 

Diseño del chasis:

2020-04-18 11.47.28

 

Cortando, taladrando y ensamblando:

2020-04-18 12.28.45

2020-04-18 12.34.452020-04-18 12.53.332020-04-18 12.57.15

 

 

 

 

 

 

 

 

 

 

 

Asi quedara el chasis en el tubo:

2020-04-18 12.46.53

 

Soldando:

2020-04-18 13.09.55-4

 

Ruedas en su lugar:

2020-04-18 14.02.44

 

Armado preliminar y prueba de codigo:

2020-04-18 14.13.242020-04-19 11.05.302020-04-19 12.09.46-22020-04-19 12.09.46

 

 

 

 

 

 

 

 

 

 

Ensambrado final del chasis:

2020-04-19 12.42.58

 

Usamos dos paquetes de baterias recargables: una para el Raspberry y otra (con mas amperaje y de 12V) para los motores y el driver L298N:

2020-04-19 13.02.19

 

Continuara…..

2020-04-19 18.24.02

Count and Say


/*Lets write an algorithm that, given an initial value, will produce the next 'count and say' sequence:
1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, …
*/

public class CountAndSay{

  public static void main(String[] args){

     System.out.println("Count and Say algorithm");

     System.out.println("next sequence is: " + countAndSay(args[0].toString()));

  }

  public static String countAndSay(String input){

     Boolean change=false;
     String output="";
     int count=1;

     char[] str = input.toCharArray();

     System.out.println("Input is: " + input);

     for (int i=0;i<str.length;i++){

       if (i+1<str.length && str[i]==str[i+1]){
          count++;
       }
       else{
          output = output + count + str[i];
          count=1;
       }

     }

     return output;

  }

}

 

 

Listen on a port/Send data to a port


Listening with nc:

nc -l 8089

Checking that 8089 port is listening:

netstat -nap|grep 8089
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:8089 0.0.0.0:* LISTEN 27543/nc
tcp 0 0 127.0.0.1:8089 127.0.0.1:43592 TIME_WAIT -

Sending data to 8089 port:

telnet localhost 8089
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
hello

 

listeningOnAPort_SendingDataToAPort

 

Move a Linux running process to a screen shell session


Use case:

  • You just started a process (i.e. compile, copy, etc).
  • You noticed it will take much longer than expected to finish.
  • You cannot abort or risk the process to get aborted due to the current shell session finishing.
  • It would be ideal to have this process on ‘screen’ to have it running on backgroud.

We can move it to a screen session with the following steps:

  1. Suspend the process
    1. press Ctrl+Z
  2. Resume the process in the background
    1. bg
  3. Disown the process
    1. disown %1
  4. Launch a screen session
    1. screen
  5. Find the PID of the process
    1. pgrep myappname
  6. Use reptyr to take over the process
    1. reptyr 1234

 

Note: at the moment of writing this, reptyr is not available on any Fedore/Redhat repo. We’ll need to compile:

$ git clone https://github.com/nelhage/reptyr.git
$ cd reptyr/
$ make
$ sudo make install

 

 

 

 

Update protobuf to 2.5 on Centos 6


Update protobuf to 2.5 on Centos 6:

$ cd /usr/local/src/
$ wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
$ tar xvf protobuf-2.5.0.tar.gz
$ cd protobuf-2.5.0
$ ./autogen.sh
$ ./configure --prefix=/usr
$ make
$ make install
$ protoc --version

Install protobuf for java

$ cd java
$ mvn install
$ mvn package

You should be good to go.

To enable you to install different versions of protobuf, install stow then change ./configure --prefix=/usr to ./configure --prefix=/usr/local/stow/protobuf-2.5.0

Then link protobuf into your system with stow:

$ cd /usr/local/stow
$ stow protobuf-2.5.0

Note: stow uses /usr/local/bin by default. Make sure thats in your $PATH

To unlink that version of protobuf,

$ stow -D protobuf-2.5.0