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

fix: #2033 shared queue push bug #2156

Closed

Conversation

keroxp
Copy link
Contributor

@keroxp keroxp commented Apr 20, 2019

  • fixed Uncaught Error: Expecting promise in table. 0 #2033

  • I finally found SharedQueue (js, also rust) wrongly push record item though it has full records according to MAX_RECORDS size.

  • shifting operation to SharedQueue that pushed more than MAX_RECORDS will cause obtaining wrong subarray of shared bytes.

  • That is why deserialized flatbuffers message has cmd_id=0

  • NOTE: this fixing seriously degrade benchmarks

  • benchmark comparison between https://deno.land/std/http/http_bench.ts is below

[email protected] (ended with error #2033 )

 ➜  wrk -t12 -c400 -d30s http:https://127.0.0.1:4500
Running 30s test @ http:https://127.0.0.1:4500
  12 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    18.86ms    3.58ms  62.30ms   86.99%
    Req/Sec     1.67k   203.47     2.77k    89.08%
  597492 requests in 30.02s, 28.49MB read
  Socket errors: connect 0, read 383, write 0, timeout 0
Requests/sec:  19904.28
Transfer/sec:      0.95MB

this PR (no error after benching)

➜  wrk -t12 -c400 -d30s http:https://127.0.0.1:4500
Running 30s test @ http:https://127.0.0.1:4500
  12 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    99.21ms   12.93ms 262.61ms   84.30%
    Req/Sec   315.41     45.03   564.00     87.41%
  112963 requests in 30.10s, 5.39MB read
  Socket errors: connect 0, read 451, write 0, timeout 0
Requests/sec:   3753.16
Transfer/sec:    183.26KB

I don't fully understand how SharedQueue is needed, MAX_RECORDS seems to be small for intensive use cases...?

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

Cool nice work. I’ve only given this a quick skim - but it’s not clear to me why there’s a performance degradation - do you have an idea? this test demonstrates the problem you were seeing (it fails before the fix is applied)?

@keroxp
Copy link
Contributor Author

keroxp commented Apr 20, 2019

No idea... I'm investigating around here. https://github.com/denoland/deno/blob/master/core/isolate.rs#L453

@ry
Copy link
Member

ry commented Apr 20, 2019

@keroxp I suspect the performance hit might be due to the debug logging. I've minimized your changes into a smaller patch for perf testing here: #2158
(Please see if this is still fixing your bug)

@ry
Copy link
Member

ry commented Apr 20, 2019

closed in favor of #2158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uncaught Error: Expecting promise in table. 0
2 participants