Server-side WebAssembly Horacio Gonzalez - @LostInBrittany Noviembre 3-4-5, 2020

Who are we? Introducing myself and introducing OVH OVHcloud

Horacio Gonzalez @LostInBrittany Spaniard lost in Brittany, developer, dreamer and all-around geek Flutter

OVHcloud: A Global Leader 200k Private cloud VMs running 1 Dedicated IaaS Europe 30 Datacenters Own 20Tbps Hosting capacity : 1.3M Physical Servers 360k Servers already deployed Netwok with 35 PoPs

1.3M Customers in 138 Countries

OVHcloud: 4 Universes of Products WebCloud Domain / Email Domain names, DNS, SSL, Redirect Email, Open-Xchange, Exchange Baremetal Cloud VM General Purpose Baremetal SuperPlan T2 >20e Virtualization T3 >80e Storage PaaS for Web Mutu, CloudWeb Compute Standalone, Cluster Game Collaborative Tools, NextCloud Database T4 >300e Bigdata T5 >600e HCI Plesk, CPanel AI PaaS with Platform.sh VDI Cloud Game Public Cloud 12KVA /32KVA Hosted Private Cloud K8S, IA IaaS PaaS for DevOps Storage File, Block, Object, Archive Databases SQL, noSQL, Messaging, Dashboard Network Virtual servers VPS, Dedicated Server Network VPS aaS pCC DC SaaS CRM, Billing, Payment, Stats IP FO, NAT, LB, VPN, Router, DNS, DHCP, TCP/SSL Offload Virtuozzo Cloud Security Wordpress, Magento, Prestashop Wholesales Hosted Private Cloud IAM, MFA, Encrypt, KMS IT Integrators, Cloud Storage, VMware SDDC, vSAN 1AZ / 2AZ vCD, Tanzu, Horizon, DBaaS, DRaaS Nutanix HCI 1AZ / 2AZ, Databases, DRaaS, VDI OpenStack IAM, Compute (VM, K8S) Stortage, Network, Databases Storage Ontap Select, Nutanix File OpenIO, MinIO, CEPH Zerto, Veeam, Atempo AI ElementAI, HuggingFace, Deepopmatic, Systran, EarthCube Bigdata / Analitics / ML Cloudera over S3, Dataiku, Saagie, Tableau, MarketPlace CDN, Database, ISV, WebHosting Support, Managed High Intensive CPU/GPU, Support Basic Encrypt Support thought Partners KMS, HSM Managed services Encrypt (SGX, Network, Storage) IA, DL Hybrid Cloud Standard Tools for AI, AI Studio, vRack Connect, Edge-DC, Private DC IA IaaS, Hosting API AI Dell, HP, Cisco, OCP, MultiCloud Bigdata, ML, Analytics Datalake, ML, Dashboard Secured Cloud GOV, FinTech, Retail, HealtCare

Did I say WebAssembly? Wasm for friends…

WebAssembly, what’s that?

A low-level binary format Not a programming language A compilation target

That runs on a stack-based virtual machine A portable binary format that runs on all modern browsers… but also on NodeJS and elsewhere!!

With several key advantages

But above all… WebAssembly is not meant to replace JavaScript

Who is using WebAssembly today? And many more others…

A bit of history Remembering the past to better understand the present

Executing other languages in the browser A long story, with many failures…

2012 - From C to JS: enter emscripten Passing by LLVM pivot

2013 - Generated JS is slow… Let’s use only a strict subset of JS: asm.js Only features adapted to AOT optimization

WebAssembly project Joint effort

Server-side WebAssembly Too good to not to use it

Solomon on Web Assembly

Solomon on Web Assembly

A very interesting feature set

Features of Wasm Why is everybody looking at it?

Near native speed https://medium.com/wasmer/benchmarking-webassembly-runtimes-18497ce0d76e

Highly portable It can be run almost everywhere…

Readable and debuggable Each .wasm file with it .wat companion file

Memory safe & secure Running in a fully sandboxed environment

Accepting many source languages And more and more…

Still a young platform… But growing up fast!

Native WASM types are limited WASM currently has four available types: ● ● ● ● i32: 32-bit integer i64: 64-bit integer f32: 32-bit float f64: 64-bit float Types from languages compiled to WASM are mapped to these types

How can we share data? Using the same data in WASM and JS? Shared linear memory between them, and serializing the data to one Wasm types

Solution is coming: Interface types Beautiful description at: https://hacks.mozilla.org/2019/08/webassembly-interface-types

No outside access By design, communication is done using the shared linear memory only

Solution exists: WASI

Mono-thread and scalar operations only Not the most efficient way…

Solution exists: SIMD

Solutions are coming too: Wasm Threads Threads on Web Workers with shared linear memory

Incoming proposals: Garbage collector And exception handling

The Bytecode Alliance Taking WASM out of the browser

The Bytecode Alliance

Bytecode Alliance projects

Wasmtime

Cranelift

WebAssembly Micro Runtime

Lucet

Other runtimes Runtimes, runtimes everywhere

Wasmer Run any code* on any client… almost * Languages compiling to WASM

Wasmer

Wasmer ecosystem

Wasmer ecosystem

Wasm3

Wasm3

And even Wasm over GraalVM!

Or in Kubernetes…

Some examples IRL? Like companies using these things

Fastly works on the edge of the cloud

Clever Cloud FaaS infrastructure https://www.youtube.com/watch?v=wchehMIsu80

Clever Cloud FaaS Infrastructure Already used in internal projects Able to execute complex loads (neural networks models)

Clever Cloud FaaS Infrastructure Blazing fast

Clever Cloud FaaS Infrastructure Blazing fast

That’s all, folks! Thank you all!