Skip to content

feat: try to support epoll #478

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

Merged
merged 6 commits into from
Jul 29, 2022
Merged

feat: try to support epoll #478

merged 6 commits into from
Jul 29, 2022

Conversation

PsiACE
Copy link
Member

@PsiACE PsiACE commented Jul 29, 2022

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

In this PR, I have tried to introduce a new module called nfs:

  • nfs = async-fs + nuclei
  • with nuclei, we have easy access to support on iouring

However, the implementation of async-fs is buggy and I think we can reimplement part of it(TODO).

Also, I don't think nuclei's performance has been fully exploited.

@PsiACE PsiACE changed the title feat: try to support iouring feat: try to support epoll Jul 29, 2022
@PsiACE PsiACE marked this pull request as ready for review July 29, 2022 12:28
@PsiACE PsiACE requested a review from Xuanwo July 29, 2022 12:29
@Xuanwo
Copy link
Member

Xuanwo commented Jul 29, 2022

@PsiACE Can you share the benchmarks after replacing tokio-fs?

@PsiACE
Copy link
Member Author

PsiACE commented Jul 29, 2022

@PsiACE Can you share the benchmarks after replacing tokio-fs?

Please wait, I'm re-running the benchmarks

@PsiACE
Copy link
Member Author

PsiACE commented Jul 29, 2022

Let's Rock

into_stream/into_stream time:   [1.1525 ms 1.1549 ms 1.1578 ms]                                    
                        thrpt:  [3.3737 GiB/s 3.3823 GiB/s 3.3893 GiB/s]
                 change:
                        time:   [-2.8908% -2.3755% -1.8955%] (p = 0.00 < 0.05)
                        thrpt:  [+1.9321% +2.4333% +2.9769%]
                        Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
  6 (6.00%) high mild
  5 (5.00%) high severe
into_stream/raw_reader  time:   [115.85 µs 118.97 µs 122.46 µs]                                   
                        thrpt:  [31.898 GiB/s 32.835 GiB/s 33.719 GiB/s]
                 change:
                        time:   [-10.494% -7.6130% -4.6085%] (p = 0.00 < 0.05)
                        thrpt:  [+4.8312% +8.2404% +11.724%]
                        Performance has improved.

     Running benches/ops/main.rs (target/release/deps/ops-2d3b92834dadf829)
Gnuplot not found, using plotters backend
read_full/4.00 KiB      time:   [2.5138 µs 2.5227 µs 2.5333 µs]                                
                        thrpt:  [1.5058 GiB/s 1.5122 GiB/s 1.5175 GiB/s]
                 change:
                        time:   [-93.496% -93.030% -92.520%] (p = 0.00 < 0.05)
                        thrpt:  [+1237.0% +1334.8% +1437.6%]
                        Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
  6 (6.00%) high mild
  5 (5.00%) high severe
read_full/256 KiB       time:   [14.186 µs 14.273 µs 14.380 µs]                               
                        thrpt:  [16.978 GiB/s 17.105 GiB/s 17.210 GiB/s]
                 change:
                        time:   [-97.019% -96.718% -96.353%] (p = 0.00 < 0.05)
                        thrpt:  [+2641.9% +2946.9% +3254.3%]
                        Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
  1 (1.00%) low mild
  4 (4.00%) high mild
  6 (6.00%) high severe
read_full/4.00 MiB      time:   [214.56 µs 215.47 µs 216.52 µs]                               
                        thrpt:  [18.041 GiB/s 18.129 GiB/s 18.206 GiB/s]
                 change:
                        time:   [-96.356% -96.101% -95.813%] (p = 0.00 < 0.05)
                        thrpt:  [+2288.4% +2464.7% +2644.5%]
                        Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
  3 (3.00%) high mild
  4 (4.00%) high severe
Benchmarking read_full/16.0 MiB: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.9s, enable flat sampling, or reduce sample count to 60.
read_full/16.0 MiB      time:   [1.1487 ms 1.1637 ms 1.1807 ms]                                
                        thrpt:  [13.233 GiB/s 13.428 GiB/s 13.602 GiB/s]
                 change:
                        time:   [-95.042% -94.595% -94.079%] (p = 0.00 < 0.05)
                        thrpt:  [+1589.0% +1750.2% +1917.1%]
                        Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
  4 (4.00%) high mild
  2 (2.00%) high severe

read_part/4.00 KiB      time:   [2.5701 µs 2.5792 µs 2.5890 µs]                                
                        thrpt:  [1.4734 GiB/s 1.4790 GiB/s 1.4843 GiB/s]
                 change:
                        time:   [-91.996% -91.480% -90.961%] (p = 0.00 < 0.05)
                        thrpt:  [+1006.4% +1073.7% +1149.3%]
                        Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
  3 (3.00%) high mild
  2 (2.00%) high severe
read_part/256 KiB       time:   [23.225 µs 23.289 µs 23.352 µs]                               
                        thrpt:  [10.455 GiB/s 10.483 GiB/s 10.512 GiB/s]
                 change:
                        time:   [-94.334% -93.900% -93.454%] (p = 0.00 < 0.05)
                        thrpt:  [+1427.5% +1539.4% +1665.0%]
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high severe
read_part/4.00 MiB      time:   [315.22 µs 316.74 µs 318.73 µs]                               
                        thrpt:  [12.255 GiB/s 12.333 GiB/s 12.392 GiB/s]
                 change:
                        time:   [-95.642% -95.277% -94.871%] (p = 0.00 < 0.05)
                        thrpt:  [+1849.8% +2017.2% +2194.5%]
                        Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) high mild
  3 (3.00%) high severe
read_part/16.0 MiB      time:   [1.9670 ms 2.0023 ms 2.0403 ms]                                
                        thrpt:  [7.6582 GiB/s 7.8036 GiB/s 7.9435 GiB/s]
                 change:
                        time:   [-93.000% -92.358% -91.658%] (p = 0.00 < 0.05)
                        thrpt:  [+1098.8% +1208.5% +1328.5%]
                        Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
  6 (6.00%) high mild

read_parallel/1x4.00 KiB                                                                             
                        time:   [3.4231 µs 3.4391 µs 3.4608 µs]
                        thrpt:  [1.1022 GiB/s 1.1092 GiB/s 1.1144 GiB/s]
                 change:
                        time:   [-86.195% -85.126% -83.988%] (p = 0.00 < 0.05)
                        thrpt:  [+524.54% +572.30% +624.35%]
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe
read_parallel/2x4.00 KiB                                                                             
                        time:   [4.8852 µs 4.9041 µs 4.9234 µs]
                        thrpt:  [1.5496 GiB/s 1.5557 GiB/s 1.5617 GiB/s]
                 change:
                        time:   [-79.901% -79.423% -78.959%] (p = 0.00 < 0.05)
                        thrpt:  [+375.25% +385.99% +397.53%]
                        Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
  7 (7.00%) high mild
  3 (3.00%) high severe
read_parallel/4x4.00 KiB                                                                             
                        time:   [9.7690 µs 9.8990 µs 10.056 µs]
                        thrpt:  [1.5173 GiB/s 1.5414 GiB/s 1.5620 GiB/s]
                 change:
                        time:   [-72.366% -72.092% -71.797%] (p = 0.00 < 0.05)
                        thrpt:  [+254.58% +258.32% +261.87%]
                        Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) high mild
  2 (2.00%) high severe
read_parallel/8x4.00 KiB                                                                             
                        time:   [19.100 µs 19.196 µs 19.338 µs]
                        thrpt:  [1.5781 GiB/s 1.5898 GiB/s 1.5977 GiB/s]
                 change:
                        time:   [-72.428% -72.123% -71.818%] (p = 0.00 < 0.05)
                        thrpt:  [+254.83% +258.72% +262.69%]
                        Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
  4 (4.00%) high mild
  5 (5.00%) high severe
read_parallel/16x4.00 KiB                                                                             
                        time:   [39.659 µs 40.190 µs 40.809 µs]
                        thrpt:  [1.4956 GiB/s 1.5187 GiB/s 1.5390 GiB/s]
                 change:
                        time:   [-72.519% -72.135% -71.789%] (p = 0.00 < 0.05)
                        thrpt:  [+254.47% +258.88% +263.88%]
                        Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
  4 (4.00%) high mild
  4 (4.00%) high severe
read_parallel/1x256 KiB time:   [77.360 µs 77.683 µs 78.134 µs]                                    
                        thrpt:  [3.1246 GiB/s 3.1428 GiB/s 3.1559 GiB/s]
                 change:
                        time:   [-86.407% -85.792% -85.081%] (p = 0.00 < 0.05)
                        thrpt:  [+570.27% +603.83% +635.70%]
                        Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
  4 (4.00%) high mild
  2 (2.00%) high severe
read_parallel/2x256 KiB time:   [155.53 µs 156.24 µs 157.16 µs]                                    
                        thrpt:  [3.1069 GiB/s 3.1252 GiB/s 3.1395 GiB/s]
                 change:
                        time:   [-67.560% -65.088% -62.245%] (p = 0.00 < 0.05)
                        thrpt:  [+164.86% +186.43% +208.26%]
                        Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
  2 (2.00%) high mild
  6 (6.00%) high severe
read_parallel/4x256 KiB time:   [310.14 µs 311.55 µs 313.63 µs]                                    
                        thrpt:  [3.1138 GiB/s 3.1345 GiB/s 3.1488 GiB/s]
                 change:
                        time:   [+1.7588% +2.8055% +3.6721%] (p = 0.00 < 0.05)
                        thrpt:  [-3.5420% -2.7289% -1.7284%]
                        Performance has regressed.
Found 6 outliers among 100 measurements (6.00%)
  2 (2.00%) high mild
  4 (4.00%) high severe
read_parallel/8x256 KiB time:   [625.29 µs 628.75 µs 633.04 µs]                                    
                        thrpt:  [3.0853 GiB/s 3.1064 GiB/s 3.1235 GiB/s]
                 change:
                        time:   [+14.939% +16.192% +17.278%] (p = 0.00 < 0.05)
                        thrpt:  [-14.732% -13.936% -12.998%]
                        Performance has regressed.
Found 5 outliers among 100 measurements (5.00%)
  3 (3.00%) high mild
  2 (2.00%) high severe
Benchmarking read_parallel/16x256 KiB: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 6.3s, enable flat sampling, or reduce sample count to 60.
read_parallel/16x256 KiB                                                                             
                        time:   [1.2432 ms 1.2454 ms 1.2477 ms]
                        thrpt:  [3.1307 GiB/s 3.1366 GiB/s 3.1421 GiB/s]
                 change:
                        time:   [+23.394% +24.422% +25.719%] (p = 0.00 < 0.05)
                        thrpt:  [-20.458% -19.628% -18.959%]
                        Performance has regressed.
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) high mild
  3 (3.00%) high severe
read_parallel/1x4.00 MiB                                                                            
                        time:   [370.72 µs 393.42 µs 418.51 µs]
                        thrpt:  [9.3337 GiB/s 9.9290 GiB/s 10.537 GiB/s]
                 change:
                        time:   [-91.491% -90.780% -89.936%] (p = 0.00 < 0.05)
                        thrpt:  [+893.65% +984.56% +1075.3%]
                        Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
read_parallel/2x4.00 MiB                                                                            
                        time:   [699.05 µs 731.39 µs 765.43 µs]
                        thrpt:  [10.207 GiB/s 10.682 GiB/s 11.176 GiB/s]
                 change:
                        time:   [-86.223% -85.254% -84.153%] (p = 0.00 < 0.05)
                        thrpt:  [+531.02% +578.14% +625.85%]
                        Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
Benchmarking read_parallel/4x4.00 MiB: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 7.0s, enable flat sampling, or reduce sample count to 50.
read_parallel/4x4.00 MiB                                                                             
                        time:   [1.3546 ms 1.4003 ms 1.4503 ms]
                        thrpt:  [10.773 GiB/s 11.159 GiB/s 11.535 GiB/s]
                 change:
                        time:   [-73.507% -72.655% -71.859%] (p = 0.00 < 0.05)
                        thrpt:  [+255.35% +265.70% +277.46%]
                        Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
  4 (4.00%) high mild
  3 (3.00%) high severe
read_parallel/8x4.00 MiB                                                                             
                        time:   [2.6054 ms 2.6677 ms 2.7339 ms]
                        thrpt:  [11.430 GiB/s 11.714 GiB/s 11.995 GiB/s]
                 change:
                        time:   [-84.060% -83.634% -83.251%] (p = 0.00 < 0.05)
                        thrpt:  [+497.05% +511.04% +527.35%]
                        Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
  11 (11.00%) high mild
read_parallel/16x4.00 MiB                                                                             
                        time:   [5.7254 ms 5.9243 ms 6.1384 ms]
                        thrpt:  [10.182 GiB/s 10.550 GiB/s 10.916 GiB/s]
                 change:
                        time:   [-81.815% -81.157% -80.444%] (p = 0.00 < 0.05)
                        thrpt:  [+411.36% +430.70% +449.92%]
                        Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild
read_parallel/1x16.0 MiB                                                                             
                        time:   [4.9469 ms 5.0086 ms 5.0812 ms]
                        thrpt:  [3.0750 GiB/s 3.1196 GiB/s 3.1586 GiB/s]
                 change:
                        time:   [-71.778% -69.117% -66.114%] (p = 0.00 < 0.05)
                        thrpt:  [+195.11% +223.80% +254.34%]
                        Performance has improved.
Found 16 outliers among 100 measurements (16.00%)
  7 (7.00%) high mild
  9 (9.00%) high severe
read_parallel/2x16.0 MiB                                                                            
                        time:   [9.4514 ms 9.5511 ms 9.6658 ms]
                        thrpt:  [3.2331 GiB/s 3.2719 GiB/s 3.3064 GiB/s]
                 change:
                        time:   [-67.711% -67.285% -66.846%] (p = 0.00 < 0.05)
                        thrpt:  [+201.63% +205.67% +209.70%]
                        Performance has improved.
Found 12 outliers among 100 measurements (12.00%)
  6 (6.00%) high mild
  6 (6.00%) high severe
read_parallel/4x16.0 MiB                                                                            
                        time:   [20.675 ms 21.108 ms 21.565 ms]
                        thrpt:  [2.8982 GiB/s 2.9610 GiB/s 3.0230 GiB/s]
                 change:
                        time:   [-58.880% -57.951% -56.996%] (p = 0.00 < 0.05)
                        thrpt:  [+132.54% +137.82% +143.19%]
                        Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild
read_parallel/8x16.0 MiB                                                                            
                        time:   [41.821 ms 42.589 ms 43.399 ms]
                        thrpt:  [2.8803 GiB/s 2.9350 GiB/s 2.9889 GiB/s]
                 change:
                        time:   [-59.677% -58.862% -58.061%] (p = 0.00 < 0.05)
                        thrpt:  [+138.44% +143.09% +148.00%]
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high mild
Benchmarking read_parallel/16x16.0 MiB: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 8.3s, or reduce sample count to 50.
read_parallel/16x16.0 MiB                                                                            
                        time:   [81.599 ms 82.285 ms 83.045 ms]
                        thrpt:  [3.0104 GiB/s 3.0382 GiB/s 3.0637 GiB/s]
                 change:
                        time:   [-62.364% -61.928% -61.502%] (p = 0.00 < 0.05)
                        thrpt:  [+159.75% +162.66% +165.70%]
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe

s3 not set, ignore
memory not set, ignore
write_once/4.00 KiB     time:   [16.288 µs 18.290 µs 20.398 µs]                                 
                        thrpt:  [191.50 MiB/s 213.57 MiB/s 239.83 MiB/s]
                 change:
                        time:   [-66.359% -61.598% -56.247%] (p = 0.00 < 0.05)
                        thrpt:  [+128.55% +160.41% +197.26%]
                        Performance has improved.
write_once/256 KiB      time:   [24.205 µs 24.414 µs 24.596 µs]                                
                        thrpt:  [9.9259 GiB/s 10.0000 GiB/s 10.086 GiB/s]
                 change:
                        time:   [-85.870% -84.485% -83.028%] (p = 0.00 < 0.05)
                        thrpt:  [+489.19% +544.55% +607.73%]
                        Performance has improved.
write_once/4.00 MiB     time:   [271.07 µs 285.15 µs 302.31 µs]                                
                        thrpt:  [12.921 GiB/s 13.699 GiB/s 14.410 GiB/s]
                 change:
                        time:   [-92.053% -91.125% -90.005%] (p = 0.00 < 0.05)
                        thrpt:  [+900.55% +1026.8% +1158.4%]
                        Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
  5 (5.00%) high mild
  6 (6.00%) high severe
write_once/16.0 MiB     time:   [2.6174 ms 2.7269 ms 2.8419 ms]                                 
                        thrpt:  [5.4981 GiB/s 5.7300 GiB/s 5.9696 GiB/s]
                 change:
                        time:   [-81.641% -80.406% -79.121%] (p = 0.00 < 0.05)
                        thrpt:  [+378.94% +410.37% +444.71%]
                        Performance has improved.

s3 not set, ignore
memory not set, ignore

@Xuanwo
Copy link
Member

Xuanwo commented Jul 29, 2022

Bravo!

@Xuanwo Xuanwo merged commit b609cde into apache:main Jul 29, 2022
@PsiACE PsiACE deleted the nuclei branch July 29, 2022 12:55
Xuanwo added a commit that referenced this pull request Aug 2, 2022
This reverts commit b609cde.

Signed-off-by: Xuanwo <[email protected]>
Xuanwo added a commit that referenced this pull request Aug 2, 2022
* Revert "feat: try to support epoll (#478)"

This reverts commit b609cde.

Signed-off-by: Xuanwo <[email protected]>

* Fix build

Signed-off-by: Xuanwo <[email protected]>

* Format

Signed-off-by: Xuanwo <[email protected]>
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.

2 participants