Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

Updated to the latest Octane.#2817

Merged
NateBrady23 merged 5 commits into
TechEmpower:masterfrom
simongui:master
May 26, 2017
Merged

Updated to the latest Octane.#2817
NateBrady23 merged 5 commits into
TechEmpower:masterfrom
simongui:master

Conversation

@simongui

@simongui simongui commented May 23, 2017

Copy link
Copy Markdown
Contributor

This PR updates the FrameworkBenchmark code with the latest Octane support. It adds the following after this discussion.

  • Proper HTTP parsing support.
  • Both /plaintext and /json endpoints.

I expect Octane to be removed from the stripped status the discussion above placed on it since I've implemented what was discussed and it can return to being displayed normally along with the other results instead of being hidden.

@mention-bot

Copy link
Copy Markdown

Thanks @simongui for contributing to The Framework Benchmarks! @nbrady-techempower, code you've worked on has been modified. If you have the chance, please review. If you wish to unsubscribe from these notices, please open a Pull Request with the commit message [ci skip] and your github name added to the userBlacklist array in the .mention-bot file.

sds response_buffer = sdsnew("HTTP/1.1 200 OK\r\n");
response_buffer = sdscat(response_buffer, "Server: octane\r\n");
response_buffer = sdscat(response_buffer, "Content-Type: application/json\r\n");
response_buffer = sdscat(response_buffer, "Content-Length: 28\r\n");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be Content-Length: 27?

{"message":"Hello, World!"} has a length of 27.

@msmith-techempower msmith-techempower May 24, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it's a bit 'gamey' to just throw the length in like this instead of computing the length. Just informed that this computation would be at compile-time anyway.

@simongui

Copy link
Copy Markdown
Contributor Author

@msmith-techempower Fixed, sorry that was left over by accident, no gaming intentions.

write_batch* batch = create_write_batch(number_of_requests);

for (int i=0; i<number_of_requests; i++) {
if (requests[i]->path[1] == 'p') {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this match any path beginning with "/p" (e.g. "/parrot", not just "/plaintext")?

for (int i=0; i<number_of_requests; i++) {
if (requests[i]->path[1] == 'p') {
create_plaintext_response_sds(batch);
} else if (requests[i]->path[1] == 'j') {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly here.

@simongui simongui May 25, 2017

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is really nit picking because not all uses of HTTP libraries require routing and some HTTP libraries shouldn't dictate how routing syntax behaves either.

Also the benchmark doesn't even stress routing, for example I could implement a common radix trie just to satisfy this request but the code is essentially at runtime going to do the exact same thing as this code. Let's be honest, everyone's routing library in this benchmark is comparing one character or multi-character single instruction comparisons and then routing because the benchmark tests have extremely primitive routes.

So I'll implement this only to satisfy something that takes several hundreds of lines of code that essentially executes a single character comparison because there's no routes that share the same prefix.

This code does not give me any special performance over anyone else because everyones is doing the same thing in the end.

There's no requirements in these benchmarks about requiring a routing module and what features that routing module needs to pass.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll agree with @simongui with "everyone else is doing it" however, I will point out that someday (maybe soon) we may have another p* route, or j* route that's part of the test suite and part of the verification may be testing that those routes exist.

That being said, I'm fine with this for now. @simongui does this give you any performance gains over requests[i]->path = 'plaintext'? Just curious.

I'm sorry if it seems like we're picking on you. It's not the intention. The benchmarks constantly need to improve and evolve and I totally appreciate your discussion in all of it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nbrady-techempower No worries, I'm under the microscope now haha :)

No, it doesn't give me any optimizations for setting the path. Octane uses a lot of zero-copy optimizations (like many of the top results in the benchmarks) but that's totally valid. All that means is Octane reduces the amount of memory copying it's doing and reuses the original buffer used for receiving from the socket by just pointing to positions in the buffer.

I'll probably add more extensive routing at some point but I think it's going to be an optional feature because different people have different routing requirements. I'm trying to build something that has layers where people can opt in to what they want or replace what they don't want.

I actually think a benchmark with a few hundred routes would be a good addition. I suspect various frameworks have much different performance characteristics based on their routing performance that doesn't show up in the plaintext and json benchmarks.

Frameworks who don't have routing would be excluded from that list.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, a routing test with a large routing map is in the pipeline.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. Hint: wrk supports Lua scripting so you can probably build a routing table in Lua and randomly select from it. I've done similar things for testing HTTP key/value stores with Wrk.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we currently use lua for some wrk formatting. However, the routing map will probably be at the python level of the toolset. Finishing up the specs for a cached db test and then I feel like a strong routing test should be next. I'll ping you for input when that happens.

Thanks for your help and patience!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem :) I'm looking forward to getting this merged and a R15 preview run so that I can see where I sit performance wise so I can continue working on things since I kind of rushed this implementation to satisfy the requirements to get out of stripped status haha.

Thanks for handling everything so well!

@NateBrady23

Copy link
Copy Markdown
Member

@msmith-techempower this LGTM

@simongui

Copy link
Copy Markdown
Contributor Author

Awesome thanks so much :) Is there a PR required to remove this from stripped status?

@NateBrady23

Copy link
Copy Markdown
Member

Nope, that would be in the benchmark_config.json approach: we made the modification just for that round

@simongui

Copy link
Copy Markdown
Contributor Author

Great, thanks!

@NateBrady23
NateBrady23 merged commit cddfbb4 into TechEmpower:master May 26, 2017
@NateBrady23

Copy link
Copy Markdown
Member

@simongui Just wanted to give you a heads up. Octane is hanging in our Server Central environment right after octane is installed! I can get it to verify in vagrant so it's not immediately clear what's going on.

http://sprunge.us/KYUE

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants