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

is there any way to low down the latency? #98

Closed
cctse opened this issue Jun 2, 2020 · 7 comments
Closed

is there any way to low down the latency? #98

cctse opened this issue Jun 2, 2020 · 7 comments
Assignees
Labels
help wanted Extra attention is needed long term It's going to be a long-term work question Further information is requested stale
Milestone

Comments

@cctse
Copy link

cctse commented Jun 2, 2020

It's really unacceptable compare to actix-web

# actix-web hello world
❯ wrk -t2 -c400 -d30 http://127.0.0.1:8003
Running 30s test @ http://127.0.0.1:8003
  2 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     4.49ms    1.42ms  37.84ms   89.36%
    Req/Sec    39.17k     6.07k   53.37k    87.92%
  2341083 requests in 30.09s, 290.24MB read
  Socket errors: connect 0, read 2, write 0, timeout 0
Requests/sec:  77805.54
Transfer/sec:      9.65MB

~ took 30s

# gnet  http hello world
❯ wrk -t2 -c400 -d30 http://127.0.0.1:8005
Running 30s test @ http://127.0.0.1:8005
  2 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    31.15ms   44.52ms 455.23ms   82.66%
    Req/Sec    44.67k     5.97k   55.07k    79.17%
  2667833 requests in 30.03s, 274.78MB read
  Socket errors: connect 0, read 30, write 0, timeout 0
Requests/sec:  88836.18
Transfer/sec:      9.15MB

~ took 30s
@cctse cctse added help wanted Extra attention is needed question Further information is requested labels Jun 2, 2020
@panjf2000 panjf2000 added the long term It's going to be a long-term work label Jun 3, 2020
@cctse
Copy link
Author

cctse commented Jun 4, 2020

gent mentioned above was running in one core,the latency was not so bad when running in multicore, but the qps fall back

# gnet hello world with multi-core
❯ wrk -t2 -c400 -d30 http://127.0.0.1:8005
Running 30s test @ http://127.0.0.1:8005
  2 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     4.74ms    2.06ms  57.74ms   92.88%
    Req/Sec    39.30k     5.86k   63.58k    76.42%
  2345670 requests in 30.06s, 241.60MB read
  Socket errors: connect 0, read 172, write 0, timeout 0
Requests/sec:  78038.99
Transfer/sec:      8.04MB

~ took 32s

@gitmko0
Copy link

gitmko0 commented Aug 29, 2020

gnet can do more req/s than actix-web, that's amazing.
would like to see a full fledge web server example to go along with it, not just a simple hello world though.
BUT... where's this hello world code?

@cctse
Copy link
Author

cctse commented Aug 29, 2020

@gitmko0 since this is a low level framework, you need implement the http protocols youself. check sample code, add your "Hello World!" to Encode or Decode。also run with low memory, about 7m

@gitmko0
Copy link

gitmko0 commented Aug 29, 2020

this is a bit too low level. is there anyone willing to make it a codeable / usable thing like fasthttp? is any of this sort in progress? also, what's the advantage in this?
this gnet reminds me of smf... https://github.com/smfrpc/smf
maybe can get some ideas from there to make it faster.

anyway, back to the topic. i'm here on gnet coz i saw http performance and i'm looking for something like fasthttp.
so... can we get fasthttp kind of way for us to program on if anyone is expanding this to fasthttp, the velocity of adoption will be there.

@panjf2000
Copy link
Owner

As @cctse said, gnet is a low-level networking framework which provides the most basic functionalities for other frameworks/libraries in application layer, I encourage developers to build application-layer frameworks/libraries on top of gnet, but that's up to them.

Besides, please open a new issue for your new topic about gnet instead of adding comments in an irrelevant issue.

@panjf2000 panjf2000 added this to the Long term milestone Jan 3, 2022
Copy link

This issue is marked as stale because it has been open for 30 days with no activity.

You should take one of the following actions:

  • Manually close this issue if it is no longer relevant
  • Comment if you have more information to share

This issue will be automatically closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Sep 26, 2024
Copy link

github-actions bot commented Oct 4, 2024

This issue was closed because it has been inactive for 7 days since being marked as stale.

If you believe this is a false alarm, please leave a comment for it or open a new issue, you can also reopen this issue directly if you have permission.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed long term It's going to be a long-term work question Further information is requested stale
Projects
None yet
Development

No branches or pull requests

3 participants