Bootstrapping the Web with Scala Native
summary
Builds a Scala Native CGI app, packages it with multistage Docker builds, and scores concrete performance: simple CGI averages ~40 ms under light load, 99th percentile exceeds 1 s at ~150 users and tops near 400 req/s, while a Python CGI hits ~136 ms. Replacing CGI with FastCGI plus a tiny Go proxy drops median latency to ~4 ms and peaks ~1,500 req/s. Adding a libuv binding and multiplexed I/O reaches 4166 req/s with median ~56 ms, showing the approach works.
AI-written summary · about
chapters (36)
- 0:00Intro
- 2:05About me
- 2:57What is Scala Native
- 4:30C struct types
- 7:29Whats a server
- 8:04System calls
- 10:43Scala Native
- 13:57The Catch
- 15:05Fork
- 15:55Downsides
- 17:36UNIX Hackers
- 17:55HTTP is a Solution
- 18:20How to Get a Stable HTTP Server
- 18:32File Descriptors
- 19:05HTTP
- 19:47What we need
- 20:09Apache
- 21:29CGI Bin Handler
- 21:50Multistage docker builds
- 22:13Dynamically linked libraries
- 22:36Flask Sinatra
- 23:47Implementation
- 25:05Response Time
- 26:37How can we do better
- 27:36multiplex protocols
- 28:54HTTP to CGI
- 29:08Why CGI is better
- 31:10Parse HTTP headers
- 33:19Netcat
- 33:54nginx
- 35:11multiplexed IO
- 36:39Nodejs event loop
- 37:17Linked UV
- 38:45Gatling
- 39:50Network weirdness
- 40:20Conclusion
related talks
24mHigh Performance Serverless Functions in Scala
36mHands-on Scala-Native
06mInterview
20mQuickly develop web applications with the FastScala framework
37mFull Stack Scala Web Application
29mPure Scala Approach for Building Frontend and Backend Apps
29mFull Stack Scala Web Application.
34mTHE FUTURE OF WEBASSEMBLY FOR SCALA
