You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 24, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 24, 2026. It is now read-only.
Please look at the source for the framework here, the date value is passed along from the main event loop, also the date header validation does exist in the tfb toolset.
Thanks for confirming. Do you know how it's getting over the "physical" limits then? If not then I will try to check the full payload it's sending so I can understand.
@fafhrd91 historically all plaintext results have been capped at 7M rps because when you look at the minimum request size and the network packets, over a 10Gb/s network, it can't be faster than that.
This was confirmed by:
stripping the /paintext url to /p (and triggered a new rule in the specs)
using smaller Server: ... headers (and triggered a new rule in the specs)
using a faster network card (in our Microsoft's lab) which improved all plaintext results for top frameworks (up to 14M rps) without changing anything else.
I am not excluding any magic trick though, even at the network level, which could be a totally fine explanation.
i've done a little investigation here and it seems each faf request from wrk is 87 bytes and each response back is 126 bytes.
so, if we assume for argument sake an average ethernet packet size of 8192 bytes, that would allow 64 responses per packet plus 66 bytes of protocol overhead for TCP/IP/Ethernet, giving us an overhead of ~1 byte per response for an overall average including protocol overhead of 127 bytes per response.
if we divide 10,000,000,000 (10Gb) bits by (127 * 8 = 1016) bits we get a theoretical max throughput of 9,842,519 responses per second on a 10Gb ethernet interface.
so, i think it is possible that the faf solution, due to it's extreme low level and focus on shaving every possible microsecond off the server side processing overhead could be significantly faster than all the other frameworks no? it does seem to skew the results on the TE charts though so maybe it should be tagged as stripped instead of realistic?
i also can confirm that the responses are adhering to the rules and the date field does change at least every second.
@sebastienros are my calculations above correct? as far as i understand, they would assume full duplex communication between web server and benchmark server so that would mean theoretical throughput of 10Gb up and 10Gb down simultaneously yes? if not, then i can't understand how we could even reach 7m RPS. 🤷♂️
I didn't see this right away, so sorry for the delay.
There is no single secret that accounts for the difference in performance between faf and other projects. Each component in faf has been hand optimized to some degree.
If anyone is extra curious they can test each component individually against what they have. The source code is a little dense but has decent separation-of-concerns.
@errantmind i will take a look. i find rust syntax so horrific to look at though. i'll see if i can put together something in plain old C that would achieve the same throughput.
@sebastienros @nbrady-techempower can anyone confirm re. my questions/calculations above? i had thought, as sebastien asserted above, that 7m RPS was some kind of hard limit based on the hardware but it seems not. 🤷♂️
Sorry, haven't had time to look into it, but I had done the same calculation 3 years ago (we recorded it I think) and we confirmed the 7M. I had looked at wireshark traces too because we didn't understand why all results capped at 7M. Then we ordered new NICs (40gb/s) and magically the benchmarks became much faster. All these benchmarks that are currently at 7M reach 10M+ when using a faster card, with the same hardware (we own the same physical machines as TE), so I don't think faf is just faster because it's "more" optimized than other fast frameworks. But until proven otherwise this is what it is, and I totally understand that there are some tests to validate the results. Hope to find some time to investigate more soon.
I took some tcp dumps and all looks fine. Compared to ULib (c++) also which used to be the fastest on our faster network.
The important things I noted are
The headers Server : F vs Server: ULib, which is saving 3 bytes.
The packets are smaller for ULib, so it's more common to have the responses split in two packets vs. FAF
All pipelined requests fit in one packet of 2720B, for both. Even though the MTU is 1500. I read there are some network optimizations that make it possible.
But something that you should re-calculate, is that the requests are 170B, so these should be the network bottleneck (if it is one):
From the client each packet is 2720B (16 requests of 170B) plus the preamble (66B) which makes 2786B to send 16 requests.
The NICs are full-duplex so 10Gb up AND down.
10^9/2786 = 358937 groups of 16 requests per second
358937 * 16 = 5,742,992 RPS
And this is assuming there is no lost/empty packets (and there are)
thanks for getting back. that's odd - when i run locally and do a single http request the http payload is only 126 bytes. not sure where 170 bytes is coming from. thanks for confirming re. full duplex. i think my calculation is correct then if we can resolve the 126 bytes versus 170 bytes you are seeing for http payload?
one thing i have found when testing with wrk is the number of requests it reports is literally never the actual number of requests the server received. from tests i have done is undercounting by ~3%. i'll see if i can spend some time over next week or two investigating this issue further - it's definitely a weird one!
this script is useful for seeing RPS across threads but it seems to undercount requests in same way, so something unusual seems to be happening inside wrk itself.
General FYI: I am actively looking into this today as it is annoying not to know what is going on here. I have a few suspicions and will post an update here today/tomorrow with whatever I find.
In the meantime I ask that FaF is excluded from this round of the official results until we have an answer here. @nbrady-techempower
Reacted by Andrii Kurdiumov, Rémy de Sérésin, SDesya74 and Stuart Blackler
Reacted by Vladyslav Hrehul, Dmytro Kushniruk, Galder Zamarreño, Artem Kamysh, Leirons, Dmytro Levchik, Stephan, Evtushenko Ivan and itrofimow
I broke my build in the process of upgrading between Rust versions so I'll have to wait before seeing the updated results, but I'll go ahead and explain the bug.
The bug affected HTTP 1.1 pipelined requests outside of local networks, in situations where the pipelined requests exceeded the network interface's MTU. In short, FaF was sending more responses than there were requests.
On Linux, by default, loopback interfaces often use very high MTU. Because of this, the bug did not manifest over loopback which made it harder to pinpoint initially, only after I set my loopback MTU to a more standard 1500 could I reproduce it.
As the benchmark was sending nearly double the MTU bytes as pipelined requests, the socket reads usually contained a partial request at the end of the segment (totalling 1500 bytes). FaF was not updating a pointer to a read buffer where it needed and was responding to the 9 complete pipelined requests, then responding again to the full 16 requests after reading the remaining data from the socket in a subsequent loop. Wrk is counting all these responses as a part of the results. I wrote some simple tests to ensure FaF is now behaving as expected so I'm pretty confident the issue is resolved.
Reacted by Egor Bogatov, Victor Lee, Joan Miquel, OmariO, karb0f0s, Andrew Johnston, Nikolay Kim, Andrii Kurdiumov, Anton Kirilov, Dan Konshin and 10 more
I am checking the full route, and have been for a very long time now. You appear to be looking at an older commit.
It is pretty strange to me that you are fixated on setting process priority as this keeps popping up. It is neither unusual nor unrealistic as scheduling has an effect on performance, and this is a benchmark. Even if it wasn't a benchmark it wouldn't be unusual for any latency-sensitive application (e.g. audio, games, etc).
Please refer to the following for the current commit and diff:
@sebastienros We now have 3 runs in which faf has behaved as expected (i.e. in line with the other top performers), and a detailed explanation of the issue by @errantmind, so shall we consider the matter settled?
And why do the TFB scripts themselves calculate the speed as much as dividing by a hardcoded constant 15?
For example, what's the difference if we take the number of requests and time from my test:
129135108 / 15.0 = 8609007 req/sec (FAKE result)
129135108 / 15.1 = 8551993 req/sec
Activity
sebastienros commentedon Jun 7, 2022
I think the date is empty as the variable is never initialized: https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Rust/faf/src/main.rs#L43
The initialization seems to have been removed in this PR: https://github.com/TechEmpower/FrameworkBenchmarks/pull/6523/files#diff-e828d6a53c980b3107862cfa2530ba397b76f56d2a0bb3d555465a6f6217f4feL52-L53
That would explain the network bandwidth difference.
sebastienros commentedon Jun 7, 2022
/cc @errantmind
sumeetchhetri commentedon Jun 9, 2022
Please look at the source for the framework here, the date value is passed along from the main event loop, also the date header validation does exist in the tfb toolset.
sebastienros commentedon Jun 9, 2022
Thanks for confirming. Do you know how it's getting over the "physical" limits then? If not then I will try to check the full payload it's sending so I can understand.
fafhrd91 commentedon Jun 9, 2022
could process priority affect throughput?
sebastienros commentedon Jun 9, 2022
@fafhrd91 historically all plaintext results have been capped at 7M rps because when you look at the minimum request size and the network packets, over a 10Gb/s network, it can't be faster than that.
This was confirmed by:
/paintexturl to/p(and triggered a new rule in the specs)Server: ...headers (and triggered a new rule in the specs)I am not excluding any magic trick though, even at the network level, which could be a totally fine explanation.
billywhizz commentedon Jun 15, 2022
@sebastienros @fafhrd91 @sumeetchhetri @errantmind
i've done a little investigation here and it seems each faf request from wrk is 87 bytes and each response back is 126 bytes.
so, if we assume for argument sake an average ethernet packet size of 8192 bytes, that would allow 64 responses per packet plus 66 bytes of protocol overhead for TCP/IP/Ethernet, giving us an overhead of ~1 byte per response for an overall average including protocol overhead of 127 bytes per response.
if we divide 10,000,000,000 (10Gb) bits by (127 * 8 = 1016) bits we get a theoretical max throughput of 9,842,519 responses per second on a 10Gb ethernet interface.
so, i think it is possible that the faf solution, due to it's extreme low level and focus on shaving every possible microsecond off the server side processing overhead could be significantly faster than all the other frameworks no? it does seem to skew the results on the TE charts though so maybe it should be tagged as stripped instead of realistic?

i also can confirm that the responses are adhering to the rules and the date field does change at least every second.
billywhizz commentedon Jun 16, 2022
@sebastienros are my calculations above correct? as far as i understand, they would assume full duplex communication between web server and benchmark server so that would mean theoretical throughput of 10Gb up and 10Gb down simultaneously yes? if not, then i can't understand how we could even reach 7m RPS. 🤷♂️
errantmind commentedon Jun 17, 2022
I didn't see this right away, so sorry for the delay.
There is no single secret that accounts for the difference in performance between faf and other projects. Each component in faf has been hand optimized to some degree.
If anyone is extra curious they can test each component individually against what they have. The source code is a little dense but has decent separation-of-concerns.
billywhizz commentedon Jun 17, 2022
@errantmind i will take a look. i find rust syntax so horrific to look at though. i'll see if i can put together something in plain old C that would achieve the same throughput.
@sebastienros @nbrady-techempower can anyone confirm re. my questions/calculations above? i had thought, as sebastien asserted above, that 7m RPS was some kind of hard limit based on the hardware but it seems not. 🤷♂️
sebastienros commentedon Jun 17, 2022
Sorry, haven't had time to look into it, but I had done the same calculation 3 years ago (we recorded it I think) and we confirmed the 7M. I had looked at wireshark traces too because we didn't understand why all results capped at 7M. Then we ordered new NICs (40gb/s) and magically the benchmarks became much faster. All these benchmarks that are currently at 7M reach 10M+ when using a faster card, with the same hardware (we own the same physical machines as TE), so I don't think faf is just faster because it's "more" optimized than other fast frameworks. But until proven otherwise this is what it is, and I totally understand that there are some tests to validate the results. Hope to find some time to investigate more soon.
sebastienros commentedon Jun 17, 2022
@billywhizz
MTU is 1500 on these NICs, including the ones we use.
billywhizz commentedon Jun 17, 2022
@sebastienros ok, so if my quick calculation is correct that would make it a theoretical max RPS of ~9.4m.
each packet = (11 * 126) + 66 = 1452 bytes = 11616 bits
10bn bits / 11616 = 860881 packets
860881 packets * 11 = 9,469,696 RPS
assuming full duplex and that downstream link can use the full 10Gb. does that sound correct?
sebastienros commentedon Jun 17, 2022
I took some tcp dumps and all looks fine. Compared to ULib (c++) also which used to be the fastest on our faster network.
The important things I noted are
Server : FvsServer: ULib, which is saving 3 bytes.But something that you should re-calculate, is that the requests are 170B, so these should be the network bottleneck (if it is one):
From the client each packet is 2720B (16 requests of 170B) plus the preamble (66B) which makes 2786B to send 16 requests.
The NICs are full-duplex so 10Gb up AND down.
10^9/2786 = 358937 groups of 16 requests per second
358937 * 16 = 5,742,992 RPS
And this is assuming there is no lost/empty packets (and there are)
billywhizz commentedon Jun 17, 2022
@sebastienros
thanks for getting back. that's odd - when i run locally and do a single http request the http payload is only 126 bytes. not sure where 170 bytes is coming from. thanks for confirming re. full duplex. i think my calculation is correct then if we can resolve the 126 bytes versus 170 bytes you are seeing for http payload?

21 remaining items
joanhey commentedon Jul 7, 2022
@kant2002
You will get more information directly from the wrk repo.
https://github.com/wg/wrk/issues/259#issuecomment-359228045
billywhizz commentedon Jul 9, 2022
one thing i have found when testing with wrk is the number of requests it reports is literally never the actual number of requests the server received. from tests i have done is undercounting by ~3%. i'll see if i can spend some time over next week or two investigating this issue further - it's definitely a weird one!

this script is useful for seeing RPS across threads but it seems to undercount requests in same way, so something unusual seems to be happening inside wrk itself.
errantmind commentedon Jul 17, 2022
General FYI: I am actively looking into this today as it is annoying not to know what is going on here. I have a few suspicions and will post an update here today/tomorrow with whatever I find.
In the meantime I ask that FaF is excluded from this round of the official results until we have an answer here. @nbrady-techempower
Change port for FAF (#7446)
errantmind commentedon Nov 3, 2022
Sorry, I had some other work come up I had to prioritize.
It appears there was a fairly niche bug after all. I patched the code and will write an explanation after the next continuous run completes.
errantmind commentedon Nov 6, 2022
I broke my build in the process of upgrading between Rust versions so I'll have to wait before seeing the updated results, but I'll go ahead and explain the bug.
The bug affected HTTP 1.1 pipelined requests outside of local networks, in situations where the pipelined requests exceeded the network interface's MTU. In short, FaF was sending more responses than there were requests.
On Linux, by default, loopback interfaces often use very high MTU. Because of this, the bug did not manifest over loopback which made it harder to pinpoint initially, only after I set my loopback MTU to a more standard 1500 could I reproduce it.
As the benchmark was sending nearly double the MTU bytes as pipelined requests, the socket reads usually contained a partial request at the end of the segment (totalling 1500 bytes). FaF was not updating a pointer to a read buffer where it needed and was responding to the 9 complete pipelined requests, then responding again to the full 16 requests after reading the remaining data from the socket in a subsequent loop. Wrk is counting all these responses as a part of the results. I wrote some simple tests to ensure FaF is now behaving as expected so I'm pretty confident the issue is resolved.
joanhey commentedon Nov 15, 2022
I said it before, in this issue #6967
But it's still a issue and not a rule.
And again I say it with this PR #7701
For me is NOT realistic, and also not fair play.
joanhey commentedon Nov 15, 2022
We need to add more tests.
joanhey commentedon Nov 15, 2022
All the frameworks can only check for the first chart, and not the exact route.
Also all can use
nice -20.errantmind commentedon Nov 15, 2022
I am checking the full route, and have been for a very long time now. You appear to be looking at an older commit.
It is pretty strange to me that you are fixated on setting process priority as this keeps popping up. It is neither unusual nor unrealistic as scheduling has an effect on performance, and this is a benchmark. Even if it wasn't a benchmark it wouldn't be unusual for any latency-sensitive application (e.g. audio, games, etc).
Please refer to the following for the current commit and diff:
https://github.com/TechEmpower/FrameworkBenchmarks/tree/master/frameworks/Rust/faf
https://github.com/TechEmpower/FrameworkBenchmarks/pull/7701/files
volyrique commentedon Dec 10, 2022
@sebastienros We now have 3 runs in which
fafhas behaved as expected (i.e. in line with the other top performers), and a detailed explanation of the issue by @errantmind, so shall we consider the matter settled?sebastienros commentedon Dec 10, 2022
Absolutely, we should close the issue and put faf back on the board. Another great TechEmpower story.
remittor commentedon Mar 24, 2023
@sebastienros
Server: HP Z6 G4 Dual Xeon Gold 5120 (TurboBoost off), Net link 10Gbps, Debian 11, Python 3.9
framework:
libreactor(builded from manual: link )Client: Intel 12700K (20 threads), Net link 10Gbps, Debian 11
On server 28 cores loaded ~ 25%...30%
Result: 8552362 req/sec
122 + 13 = 135 bytes
135 * 129135108 = 17433239580 bytes => (17433239580 * 8) / (1000 * 1000 * 1000) = 139.46591664 Gbit
139.46591664 / 15.1 = 9.236 Gbps
Bonus: Net 25Gbps
remittor commentedon Mar 24, 2023
@joanhey
And why do the TFB scripts themselves calculate the speed as much as dividing by a hardcoded constant
15?For example, what's the difference if we take the number of requests and time from my test:
129135108 / 15.0 = 8609007 req/sec (FAKE result)
129135108 / 15.1 = 8551993 req/sec