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

support Etcd as meta engine #1638

Merged
merged 23 commits into from
Apr 2, 2022
Merged

support Etcd as meta engine #1638

merged 23 commits into from
Apr 2, 2022

Conversation

davies
Copy link
Contributor

@davies davies commented Mar 23, 2022

This PR support Etcd as meta engine.

the meta-url should be

etcd://host1:port,host2:port,host3:port/prefix?cert=/path/to/cert 

Parameters for TLS:

cacert=/path/to/file
cert=/path/to/file
key=/path/to/file
server-name=xxx
insecure-skip-verify=1

@davies davies marked this pull request as draft March 23, 2022 15:13
@davies
Copy link
Contributor Author

davies commented Mar 23, 2022

The performance of etcd without --unsafe-no-fsync

Summary:
  Total:	2.7779 secs.
  Slowest:	0.1099 secs.
  Fastest:	0.0003 secs.
  Average:	0.0278 secs.
  Stddev:	0.0277 secs.
  Requests/sec:	35.9980

Response time histogram:
  0.0003 [1]	|
  0.0112 [14]	|∎∎∎∎∎∎∎∎
  0.0222 [66]	|∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  0.0332 [2]	|∎
  0.0441 [2]	|∎
  0.0551 [0]	|
  0.0660 [0]	|
  0.0770 [2]	|∎
  0.0880 [3]	|∎
  0.0989 [8]	|∎∎∎∎
  0.1099 [2]	|∎

Latency distribution:
  10% in 0.0010 secs.
  25% in 0.0185 secs.
  50% in 0.0195 secs.
  75% in 0.0206 secs.
  90% in 0.0919 secs.
  95% in 0.0946 secs.
  99% in 0.1099 secs.

@solracsf
Copy link
Contributor

What about ?

sudo ionice -c2 -n0 -p `pgrep etcd`

@codecov-commenter
Copy link

codecov-commenter commented Mar 24, 2022

Codecov Report

Merging #1638 (2755e16) into main (f55ba44) will increase coverage by 0.05%.
The diff coverage is 78.04%.

@@            Coverage Diff             @@
##             main    #1638      +/-   ##
==========================================
+ Coverage   61.70%   61.76%   +0.05%     
==========================================
  Files         134      135       +1     
  Lines       22721    22924     +203     
==========================================
+ Hits        14020    14159     +139     
- Misses       7126     7169      +43     
- Partials     1575     1596      +21     
Impacted Files Coverage Δ
pkg/meta/tkv_etcd.go 77.77% <77.77%> (ø)
pkg/meta/tkv_prefix.go 96.61% <80.00%> (+0.18%) ⬆️
pkg/meta/tkv.go 76.55% <100.00%> (+0.02%) ⬆️
pkg/vfs/reader.go 81.56% <0.00%> (-3.11%) ⬇️
pkg/chunk/cached_store.go 77.32% <0.00%> (-1.19%) ⬇️
pkg/meta/sql.go 67.13% <0.00%> (ø)
pkg/meta/sql_lock.go 74.67% <0.00%> (+2.59%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f55ba44...2755e16. Read the comment docs.

@davies davies marked this pull request as ready for review March 24, 2022 10:11
@davies
Copy link
Contributor Author

davies commented Mar 24, 2022

What about ?

sudo ionice -c2 -n0 -p `pgrep etcd`

no ionice in macOS . I have test etcd with default options in Linux, it works well.

@SandyXSD
Copy link
Contributor

Benchmarks of TiKV vs ETCD (both have 3 nodes with an SSD backend):

TiKV

goos: linux
goarch: amd64
pkg: github.com/juicedata/juicefs/pkg/meta
cpu: Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz
BenchmarkTKV/mkdir-4         	     624	   1930961 ns/op
BenchmarkTKV/mvdir-4         	     537	   2265382 ns/op
BenchmarkTKV/rmdir-4         	     470	   2453943 ns/op
BenchmarkTKV/readdir_10-4    	     913	   1467893 ns/op
BenchmarkTKV/readdir_1k-4    	     148	   7942530 ns/op
BenchmarkTKV/mknod-4         	     633	   1980034 ns/op
BenchmarkTKV/create-4        	     604	   1941095 ns/op
BenchmarkTKV/rename-4        	     546	   2248436 ns/op
BenchmarkTKV/unlink-4        	     517	   2316809 ns/op
BenchmarkTKV/lookup-4        	    1384	    855186 ns/op
BenchmarkTKV/getattr-4       	    2636	    423620 ns/op
BenchmarkTKV/setattr-4       	     856	   1600443 ns/op
BenchmarkTKV/access-4        	    2758	    426041 ns/op
BenchmarkTKV/setxattr-4      	     916	   1259769 ns/op
BenchmarkTKV/getxattr-4      	    3541	    410169 ns/op
BenchmarkTKV/removexattr-4   	     710	   1694803 ns/op
BenchmarkTKV/listxattr_1-4   	    3356	    416820 ns/op
BenchmarkTKV/listxattr_10-4  	    2686	    432606 ns/op
BenchmarkTKV/link-4          	     746	   1561034 ns/op
BenchmarkTKV/symlink-4       	     751	   1816562 ns/op
BenchmarkTKV/newchunk-4      	  813643	      1599 ns/op
BenchmarkTKV/write-4         	     592	   2032517 ns/op
BenchmarkTKV/read_1-4        	13819200	        83.72 ns/op
BenchmarkTKV/read_10-4       	15336248	        77.55 ns/op
PASS
ok  	github.com/juicedata/juicefs/pkg/meta	49.437s

ETCD

goos: linux
goarch: amd64
pkg: github.com/juicedata/juicefs/pkg/meta
cpu: Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz
BenchmarkTKV/mkdir-4         	     594	   2247327 ns/op
BenchmarkTKV/mvdir-4         	     424	   2797362 ns/op
BenchmarkTKV/rmdir-4         	     415	   2873579 ns/op
BenchmarkTKV/readdir_10-4    	     754	   1670520 ns/op
BenchmarkTKV/readdir_1k-4    	      64	  18056631 ns/op
BenchmarkTKV/mknod-4         	     535	   2261128 ns/op
BenchmarkTKV/create-4        	     538	   2336013 ns/op
BenchmarkTKV/rename-4        	     376	   3206458 ns/op
BenchmarkTKV/unlink-4        	     441	   2939707 ns/op
BenchmarkTKV/lookup-4        	     860	   1385068 ns/op
BenchmarkTKV/getattr-4       	    1641	    697641 ns/op
BenchmarkTKV/setattr-4       	     722	   1586305 ns/op
BenchmarkTKV/access-4        	    1864	    624945 ns/op
BenchmarkTKV/setxattr-4      	    1459	    823831 ns/op
BenchmarkTKV/getxattr-4      	    1777	    708389 ns/op
BenchmarkTKV/removexattr-4   	     751	   1487221 ns/op
BenchmarkTKV/listxattr_1-4   	    4288	    283127 ns/op
BenchmarkTKV/listxattr_10-4  	    3648	    324412 ns/op
BenchmarkTKV/link-4          	     548	   2358875 ns/op
BenchmarkTKV/symlink-4       	     505	   2434128 ns/op
BenchmarkTKV/newchunk-4      	  714043	      1617 ns/op
BenchmarkTKV/write-4         	     454	   2483883 ns/op
BenchmarkTKV/read_1-4        	14152519	        81.26 ns/op
BenchmarkTKV/read_10-4       	14680340	        75.63 ns/op
PASS
ok  	github.com/juicedata/juicefs/pkg/meta	45.249s

@davies davies merged commit ce93bea into main Apr 2, 2022
@davies davies deleted the etcd branch April 2, 2022 05:36
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.

4 participants