5 ms·
Can you explain who is the target audience for Lua target? What can I do with it?
by veli_joza 10y ago
Can you explain who is the target audience for Lua target? What can I do with it?
- mateuszf 10y agoMy guess would be for current lua embedding scenarios - for example for use as a scripting language in games.
- i336_ 10y agoWell, with LuaJIT you get speed. How much speed? CloudFlare's firewall system uses LuaJIT to analyse approximately 4 million GET requests per second. (Small pause, reread) That much speed. That was the figure in June 2015, at least. Some of the autogenerated code looks like this: http://i.imgur.com/F5aT0NF.png http://i.imgur.com/F5aT0NF.png (snagged via pdfimages from http://www.slideshare.net/jgrahamc/lua-the-worlds-most-infuriating-language http://www.slideshare.net/jgrahamc/lua-the-worlds-most-infur...) This video was where I had my major TIL moment: http://www.thedotpost.com/2015/06/john-graham-cumming-i-got-10-trillion-problems-but-logging-aint-one http://www.thedotpost.com/2015/06/john-graham-cumming-i-got-... I also got the impression from the one other page of autogenerated code briefly visible in this video that the firewall logic is also full of regular expressions. And yet, it completes its analysis in roughly less than 1 millisecond. It's almost a crime I haven't learned LuaJIT yet. :P That said, looking at the slideshare link, you can see that Lua as a language has some pretty annoying syntax, so I've sorta been shying away from it. So maybe I'll learn HaXe instead. :D
- delroth 10y ago> CloudFlare's firewall system uses LuaJIT to analyse approximately 4 million GET requests per second. While I agree with your premise (LuaJIT is a pretty awesome project), this example means nothing in terms of performance. — "analyse" doesn't give an indication of the workload -- it could vary from "matching against a precompiled regexp" to running advanced statistical models. — 4 millions requests per second does not mean anything without knowing the size of the deployment. You can always throw more hardware at a "trivially" parallelizable problem. — Throughput is only one dimension on the "speed" continuum, latency (and especially tail latency) is also very important. Some languages have very good throughput and fail hard at tail latency (Java, Go until recently). Some others have lower throughput but more predictable latency.
- i336_ 10y agoYou make incredibly fair points and I don't have the data to answer what you've raised. This could be lack of research or the fact that CF hasn't released it. I expect a 20/80 non-researched/non-available mix. My understanding is that the WAF detects trivial stuff like SQL injection and XSS, and the video also mentions it detected ShellShock and so forth (yeah, this was a while ago). "Thousands of regular expressions" is mentioned verbally in the video around ~11:25. That's where I got that from. There are some bits mentioned about the hardware around 19:30: - E5-2630v3 (16 cores, 32 w/ HT which is turned off), 128GB RAM, 10Gbps - Custom built by Quanta: 4 nodes per 2U (each node is like half-width and 1U high), redundant 2xPSU in the middle - 40 machines run Kafka storing 400TB of log data (ingest @ 15Gbps), 50TB disk per node - 5 machines run CitusDB (sharded PostgreSQL) to power realtime graph generation, 12TB SSD per node - 100+ machines for realtime analytics running Go (and presumably LuaJIT) - LuaJIT seems to be the realtime "hmm, interesting" flagging system, while Go is used for in-depth intelligent analysis that's (I assume) slightly behind realtime. Also, the video is actually over here - https://www.youtube.com/watch?v=LA-gNoxSLCE https://www.youtube.com/watch?v=LA-gNoxSLCE --- I'm curious to understand what tail latency is, and very interested to learn more about language latency and performance in general. What subjects would you recommend I learn about / read? (I would describe myself as interested from a hobbyist-intermediate standpont, but from a non-academic POV; I unfortunately get dismally lost with formulaic presentations, math is not a strong subject for me.)
- signa11 10y ago> While I agree with your premise (LuaJIT is a pretty awesome project), this example means nothing in terms of performance. Yup, without knowing deployment details etc this number doesn't really mean much. perhaps you might have heard of the snabb-switch project ? which does line rate 10gbps forwarding of 64b packets on a single x86 core. entire thing is written in lua including the user land 'drivers' for Intel 10g cards :) Edit: s/shabby/snabb (damn you autocorrect)
- i336_ 10y agoWait, wait. Lua or LuaJIT? That's amazing!
- knotz 10y agoYou can build a pretty damn good simulation of a Boeing 737-300 with it. (http://ixeg.net/ http://ixeg.net/)