4 ms·
AFAIK HAProxy also uses lua, so it would probably suffer in terms of performance quite similarly in that aspect. There's also the memory safety aspect with Rus
by arandomusername 3y ago
AFAIK HAProxy also uses lua, so it would probably suffer in terms of performance quite similarly in that aspect.
There's also the memory safety aspect with Rust.
- VWWHFSfQ 3y agoI've never heard anybody suggest that nginx with luijit suffers from performance issues.
- steveklabnik 3y agoI worked at Cloudflare, but long ago, and not on this sort of thing. Cloudflare has extensive experience with both of these things, including employing Mike Pall for a time. That they've invested in Pingora instead is an interesting data point precisely due to that deep expertise at scale. As they say in the link that started this subthread: > In production, Pingora consumes about 70% less CPU and 67% less memory compared to our old service with the same traffic load. The savings come from a few factors. > > Our Rust code runs more efficiently compared to our old Lua code. On top of that, there are also efficiency differences from their architectures. For example, in NGINX/OpenResty, when the Lua code wants to access an HTTP header, it has to read it from the NGINX C struct, allocate a Lua string and then copy it to the Lua string. Afterwards, Lua has to garbage-collect its new string as well. In Pingora, it would just be a direct string access.
- deleted 3y ago[deleted]