Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extremely slow, slower than gnet by 40% benchmark because of syscall6 #937

Closed
hiqsociety opened this issue Sep 6, 2023 · 10 comments
Closed
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@hiqsociety
Copy link

possible to fix this?

"prefork mode" of hertz for "Hello World!" for techempower benchmark
https://github.com/cloudxaas/gosprapp/blob/main/web/app/app.go

possible to provide guidance on how to speed it up?
gnet ~ 95k req/s
hertz ~ 55k req/s

that's almost 40% slower than gnet

Screenshot from 2023-09-06 12-32-22

@github-actions github-actions bot added the invalid issue invalid issue (not related to Hertz or described in document or not enough information provided) label Sep 6, 2023
@hiqsociety hiqsociety changed the title extremely slow, slower than gnet benchmark because of syscall6 extremely slow, slower than gnet by 40% benchmark because of syscall6 Sep 6, 2023
@li-jin-gou li-jin-gou removed the invalid issue invalid issue (not related to Hertz or described in document or not enough information provided) label Sep 6, 2023
@li-jin-gou
Copy link
Member

Can you provide detailed code and pressure test environment? I only see hertz's code.

@hiqsociety
Copy link
Author

hiqsociety commented Sep 6, 2023

@li-jin-gou
the code is compared with
https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Go/gnet/src/main.go

wrk -t 1 -d 10 http://.... :8080 / 8081

ubuntu 22.04, i5, 4 threads cpu core

pls try it out.
io_uring is the next step. just saying that's all. thx

@hiqsociety
Copy link
Author

@li-jin-gou trying to use this framework with "prefork mode" to compete in techempower benchmark

do guide on how to make it faster. thx

@li-jin-gou li-jin-gou added the question Further information is requested label Sep 11, 2023
@li-jin-gou li-jin-gou self-assigned this Sep 25, 2023
@li-jin-gou li-jin-gou added the enhancement New feature or request label Oct 16, 2023
@li-jin-gou
Copy link
Member

li-jin-gou commented Oct 18, 2023

This is pr in TechEmpower/FrameworkBenchmarks#8483 @hiqsociety We found that the code for the benchmark was not the same, which could lead to inaccurate results.
I don't think it makes much sense to compare gnet and hertz, maybe look at gnet and netpoll.

@li-jin-gou
Copy link
Member

I think hertz support for prefork could be a higher priority, as it seems like his performance gains are huge. @hiqsociety

@hiqsociety
Copy link
Author

@li-jin-gou i dunno what this is about but hertz should be compared with gnet / fiber and it's still very slow compared to either.

whatever mode you prefer, just make it faster than what it is currently.

it's really too slow, defeats the purpose of using hertz.

This is pr in TechEmpower/FrameworkBenchmarks#8483 @hiqsociety We found that the code for the benchmark was not the same, which could lead to inaccurate results. I don't think it makes much sense to compare gnet and hertz, maybe look at gnet and netpoll.

@hiqsociety
Copy link
Author

hiqsociety commented Nov 10, 2023

@li-jin-gou it's fixed? possible to open this issue as a continual speed improvements update?
i just submitted a pull request to techempower benchmark on the prefork mode.

is there any guidance on built in prefork mode for hertz or can just use mine?

@li-jin-gou
Copy link
Member

li-jin-gou commented Nov 10, 2023

@li-jin-gou it's fixed? possible to open this issue as a continual speed improvements update? i just submitted a pull request to techempower benchmark on the prefork mode.

is there any guidance on built in prefork mode for hertz or can just use mine?

OK, #8483 already merged and @Skyenought will explore ways to optimize performance include Prefork etc in https://github.com/hertz-contrib/performance.

@li-jin-gou li-jin-gou reopened this Nov 10, 2023
@hiqsociety
Copy link
Author

this non-preforked results make hertz look so bad.
https://www.techempower.com/benchmarks/#hw=ph&test=plaintext&section=data-r22

my prefork version is accepted into the latest techempower benchmark repo. hope to be included in hertz as default prefork.

@li-jin-gou
Copy link
Member

this non-preforked results make hertz look so bad. https://www.techempower.com/benchmarks/#hw=ph&test=plaintext&section=data-r22

my prefork version is accepted into the latest techempower benchmark repo. hope to be included in hertz as default prefork.

Don't really want to maintain prefork as there is no real user demand for it. If a user wants to use prefork, I think it would be a good idea to refer them to your code. TechEmpower/FrameworkBenchmarks#8528

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Development

No branches or pull requests

3 participants