Alex headshot

AlBlue’s Blog

Macs, Modularity and More

QCon London 2020 Day 3

2020 qcon conference

This morning was kicked off by Katie Gamanji, of American Express and part of the Cloud Native Computing Foundation. The talk was on Kubernetes; there were 23,000 attendees of KubeCon conferences in 2019, and over 2,000 contributors to the project. She introduced the Cloud Native Interface, which is used to ensure that a pod has its own IP which can be routed to via various mechanisms, and the Container Runtime Interface which abstracted away Docker from other engines such as gviosr, containerd etc. Mostly it seemed to be an overview of what Kube does, rather than anything new; for the people who were attending hoping to learn about more than just the basics, I’m not sure what the benefits were.

The rest of the day I spent hosting the Java track, on behalf of Martijn Verburg, who was unable to assume hosting duties due to other committments. I’m very glad that he had those committments, because I had a very enjoyable day, listening to experts in their field as well as playing compere to a captive audience. I’m very much looking forward to being invited back again!

Ben Evans from New Relic was the first speaker in my track, talking about Record and sealed types in Java, which are in an experimental phase. Record objects are data types on steroids; essentially, a data type wich has an automaticaly generated equals, hashCode and toString with the correct properties in a final data structure. Together with sealed types, which are a way of doing inner classes properly, it looks like the various experimental Java projects are really providing the goods.

Andrzej Grzesik, better known as “ags”, talked about the path that Revolut had in mirating to Java 11 over the last year. They moved over to Java 11 as the compile engine and as the runtime engine for all of their apps over the year, following up with various bugs reported against OpenJDK as they wen through, and some of the pitfalls of their experience. The main one seems to be updating all of the dependent libraries and build tools; for example, moving from Gradle v3 to Gradle v4 and v5, a step at a time. They are keen to try keeping up with the latest JDK releases, although their use of Gradle and more specifically Groovy is holding them back from migrating at the moment. Making sure that all of the dependencies worked seemed to be the biggest challenge, though most (non-abandoned) Java libraries work at this stage.

David Delabassee gave an overview from Oracle about how to best drive Java applications inside Docker containers. His examples and slides (to be uploaded later) showed how to use a multi-stage Docker build along with jlink and the --no-man-pages and --no-header-files along with compression to build a custom base image which was about 20% of its original size. He also highlighted using Alpine as a distribution and Musl as a replacement for glibc, but noted this wasn’t officially supported; project portola aims to provide a means to do this in the future. By using AppCDS he was able to shrink the launch time down further, and talked about the evolution of Docker and docker rootless along with a podman blog talking more about enabling this functionality.

Emily Jiang gave a talk and live demo of how to build a 12-factor app with Open Liberty and MicroProfile. The demo code is available on GitHub and since it was a live demo, the screencast from InfoQ will have a lot more detail. In essence, Emily demonstrated having two services, connecting via localhost, to be run inside different Kubernetes pods and with redundant services, and used asynchronous calls to be able to route around delays or failures in the underlying service implementations. One to watch carefully on the replays, I think.

The day was rounded off nicely by James (Jim) Gough whom I’ve had the pleasure of working with commercially before. He gave a talk on how GraalVM executes code, and showed a number of demonstrations of how Graal can eecute code that has been compiled using the Java compiler, by debugging through how the JDK’s JIT (in the form of Graal) works. He also demonstrated the jaotc tool for compiling Java code ahead of time for faster startup and lower memory footprint. I had had a prior audience for this talk, and so almost everything went to plan in this presentation – with the exception of the QCon sign falling off the podium by the end. Oh well, it had been a long day …

This brought to the end my 12th? QCon London. I don’t think I’ve been to all 14, but I have certainly been to most of them over the past years, and all in all, it’s just as great as ever. Obviously this year was a little ‘special’ due to all the changes in place, but I thought that the staff (both at QCon and also at the QEII conference centre itself) handled everything marveously. I can’t wait to be back again this time next year, either as an attendee, speaker or track host!

QCon London 2020 Day 2

2020 qcon conference

The second day of QConLondon had an opening keynote by (@anjuan)[] talking about the Underground Railroad network that helped free slaves in the United States. He likened various players in the scheme with the structure of management and developers. The talk was delivered in an entertaining enough fashion, but the subject was based on an analogy to something that is a part of American history rather than the UK or European history, and so was a little bit disconnected from the current reality – especially given the dual challenges to the UK of Brexshit and the Coronavirus. Ultimately I think this keynote may have worked better for an American audience.

The first real talk of the day talked about Quarkus, as a Java framework for small quick-start applications. One of the differences with a JIT enabled language is that there’s a warm-up phase when the application is reaching peak performance; not an issue for long-running applications, but can be a concern if you’re following continuous delivery, redelivering multiple times a day. If you’re deploying every 10 minutes, with every commit, then you may find that the Java application doesn’t ever reach steady state before being shut down for a new version of the service. Quarkus has supersonic/fast boot. It is designed for GraalVM by default, and takes a generated build file and uses a Maven/Gradle plugin to produce the optimised JAR, and using ahead-of-time compiler, an ELF executable for the GraalVM. It also produces containers with a small on-disk footprint. The hot reload of code makes for a fast turnaround time, and Quarkus is opinionated about how it starts Java – like creating a debug listener on the port at the same time.

Sergey Kuksenko @kuksenk0 has been a JVM engineer since 2005, and working on performance for the last decade. He kicked off a demo with two Java Mandelbrot generators, using a Complex class - but in the case of the faster demo (12fps vs 5fps), the only difference was the addition of the “inline” keyword. Valhalla provides a denser memory layout for inline class (aka value types), with the plan to have specialised generics. The ‘inline class’ rather than ‘value’ was chosen to make it easier to update the Java Language spec with fewer changes. Inline classes don’t have identity, which means they can’t be compared with == and so avoid problems like Integer.valueOf(42) == Integer.valueOf(42).

An inline class has no identity, is immutable, not nullable and not synchronizable. The JVM will decide whether to allocate the inline classes on the heap, or whether they’ll be on the stack or inlined into the container class. The phrase “Code like a class, work like an int” summarises the goal of Valhalla. The performance is about 50% faster, but importantly, has many fewer L1 cache misses. The work on benchmarking the current implementation is in progress, and seems to be under 2% regression at the moment. For any kind of arithmetic types, having Complex inline classes gave an order of magnitude speed up in some cases. The Optional class will be a value class in the future, and will be a proof of concept of a migration path. Work is ongoing to reduce the performance overheads so that it can be available in the future; for the time being, the JDK14 release in the next couple of weeks will have a version available for experimentation.

A wildcard session followed, due to the last-minute cancellation of a speaker. Instead, I went to a talk on TornadoVM, which provides a way of compiling and running Java code in parallel on a variety of different FPGA or GPU solutions. By translating Java bytecode into Tornado bytecode, and then having different translators which re-write those kernels to GPU specific instruction sets, it’s possible to get a many thousand times speed up on numerical calculations. A demo showed capturing depth information from video captured from a Microsoft Kinect, and re-rendering into three dimensional representation afterwards. Importantly they have a docker image which can be used for testing in beehivelab/tornado-gpu:latest which is covered by the project’s README.

The next session I attended was by Alina Yurenko from Oracle on “Maximising application performance with GraalVM”, which talked about using Graal as an ahead-of-time compiler for generating native images. Not only does starting the application run much faster, it also uses a lot less memory than the equivalent running application under the JVM. Partially this is due to the fact that the C2 compiler doesn’t need to compile the underlying JVM classes, and partially due to the fact that the actual runtime of the application has a far lower total memory layout. Of course, creating an accurate execution profile requires running the application under an expected (simulated) load, so that the correct hot code samples can be identified and thus translated appropriately. Graal uses information gained from the initial execution to prepare appropriate code for expected types; if these assumptions are incorrect, then the executed binary will be different. There was also a sales pitch of using GraalVM to host multiple languages, along with an evolution of the Nashorn JavaScript engine. It’s unclear as to whether people will really want to use a JVM for running multiple languages, but then again, those people never really saw JavaScript as anything other than a toy language, so what do they know? :)

The next session I attended was my own. I thought it would be a little rude not to turn up :) Fortunately the talk went OK – after all, I completed writing it with at least an hour to go – and as for timing, I finished 10s early. My talk was on CPU microarchitecture for maximum performance, looking at the nitty gritty details of how CPUs execute. I didn’t go down to the electron or transistor level, but rather talking about the general architectural details of the processor. My slides have been uploaded to my SpeakerDeck profile and apart from a quibble about a bullet on page 25, it seems that most people seem to have enjoyed it; after all, I did. The video was recorded and will be available on InfoQ at some point in the future; I’ll update this post with the link when I have a public link.

Day 2 ended with a get-together of the speakers in the usual location, and I made several contacts with people who had been speaking at QCon; some whom I knew, some whom I did not. One of the pleasures of QCon is meeting and talking to people; I enjoy meeting up with the attendees during the breaks, but it is also excellent to be able to talk to the movers and shakers of the conference.

Tomorrow I’m leading the Java track, which I’m looking forward to; stay tuned!

QCon London 2020 Day 1

2020 qcon conference

QConLondon is one of my favourite conferences. I don’t know exactly how many I have been to, but I’m in the double figures now. This year’s 14th QConLondon has been something I’ve been looking forward to for some time, not least because I’m speaking on performance on Tuesday and I’m track hosting the Java track on Wednesday, unless anything changes.

This year of course QConLondon is being held with the backdrop of the Corona virus starting its worldwide tour. Already we’ve seen a few global conferences canned (such as the GDC and the Mobile one) and I had feared that QConLondon would be the next in the list. Fortunately, the planning staff for both the conference itself and the QEII centre have been remarkably well prepared; there were hand sanitisers on the way in, personal sanitisers handed out, and instead of the usual help-yourself-lunch that have been a staple of prior conferences, this year there are pre-packed bento boxes. In fact, the only unpackaged food has been the bananas and oranges on the fruit stands, and arguably, they come in their own packaging. Together with that and the code of conduct and the pronoun badges, I think QCon is showing the way to go for other conferences.

That being said, global health has been a concern, and people are adapting. Gone are the handshakes that one might have expected, with a friendly ‘elbow bump’ or other non-contact greeting. Of course, it probably didn’t help that a conference at the QEII had a case of Corona virus a couple of weeks ago happened, but then again, with that foreknowledge I think the preparations have been handled admirably.

The only other problem to report, before writing what I went to see, was the fire alarm. There was an issue on the 2nd floor with a vape-related incident (note to people who vape: do it outside, please) causing the entire building to be evacuated. There was a brief interlude while a lot of people huddled outside – fortunately, in the sunshine – and then we went back in. The 2nd floor unfortunately kept ringing, but the rest of the floors were OK. I feel sorry for the presenters who were mid-flow when the alarm sounded; it’s not great being interrupted like that.

So, on to today’s topics. The morning keynote was by @aallan on the problems with today’s Internet of Things. There aren’t any slides available, but the content was excellent; the first half talked about how a failure in a consumer product shouldn’t have a failure mode of a dead cat (unlike some commercial providers whose pet-feeding devices had a failure that they forgot to dispense food for over a week). In particular, he looked at running TensorFlow on low power devices, like Raspberry Pi. He has a blog post talking about running TensorFlow on various devices, highlighting that the new Raspberry Pi 4 is sufficient to do machine learning tasks, and the even lower-power spark fun edge which can do machine learning while powered with a CR2032 like button battery. Seriously impressive stuff!

The next talk I went to was @samnewman on journeys from monolith to micro-services, and strategies for achieving that. He discussed the ability to refactor in-place from a monolith to a modular monolith, and by using an HTTP(S) proxy to sit between the client and the back-end implementation, which provides a control and dispatch point for diverting between new and old versions, either in a live-live, red/green or phased deployment. His slides are available and he referenced Michael Feather’s “Working effectively with legacy code” book and James Governer’s towards progressive delivery as well.

One talk you should watch when it becomes available is @deniseyu21 presentation on why is building distributed services so hard. The style of presentation (caution: cats included) and takeaways were one of the best I’ve seen; in particular, the fact that in the traditional CAP theorem, viewing it as a see-saw rather than a triangle (you don’t get to choose ignoring partition tolerance) means you have to decide whether you want to have availability at the cost of consistency or vice versa. She referenced Jepsen’s views on consistency and is writing a book for children on consistency.

The next talk I went to was Paul Hammant’s view on full cycle developers; essentially, how to ensure that developers and support staff are aligned to the delivery of a service. His slides weren’t available, but the idea was to make sure that L1 and L2 support staff are properly enabled through the creation of runbooks, produced by the developer team, and that the dev staff rotate through the L2 support staff so they gain empathy and see how they can improve the product. He referred to a couple of blog posts he’d written: hacking with JavaScript and like a used sofa.

Alexandra Noonan’s talk on “From monolith to micro-services and back again” was entertaining, and talked about the difficult issues they had in the transition, the subsequent explosion of services, and then the requirement to bring them back together again. The issues they had in the first instance were due to slow development; moving to micro-services sped that up, but then the explosion meant that library updates weren’t consistent, and so bringing them back to a monolith fixed that problem. Slides aren’t yet available, but I’ll update this post with the links when they are.

The final talk I went to was @hatofmonkeys talking about what can go wrong as part of a deployment of a new massively online player game, Monopoly City Streets. Essentially, an underfunded project with a massive marketing budget ended up attracting a few more than the 20,000 expected gamers – 1.7m, to be exact. A lot of this talk was how to survive under pressure, how 56 hour stints are not to be recommended, how a load of over 400 on a dual-core system is not great, and how PHP is full of facepalm. But the takeaway for this was a plea to allow others who have experienced failure (and failure at scale) to come and share their stories so that others can learn. I hope that Colin gives this talk again, and that it was recorded; his style of delivery was both entertaining and comedic.

All in all, the 14th QCon London first day was excellent, despite the prevailing conditions. Looking forward to tomorrow – and my talk, which is at 16:10 in St James. See you there!