You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

173 lines
6.0 KiB

  1. Benchmarks
  2. ======================
  3. Do we really need the benchmark? People always use benchmark to compare systems. But benchmarks are misleading. The resources, e.g., CPU, disk, memory, network, all matter a lot. And with Seaweed File System, single node vs multiple nodes, benchmarking on one machine vs several multiple machines, all matter a lot.
  4. Here is the steps on how to run benchmark if you really need some numbers.
  5. Unscientific Single machine benchmarking
  6. ##################################################
  7. I start weed servers in one console for simplicity. Better run servers on different consoles.
  8. For more realistic tests, please start them on different machines.
  9. .. code-block:: bash
  10. # prepare directories
  11. mkdir 3 4 5
  12. # start 3 servers
  13. ./weed server -dir=./3 -master.port=9333 -volume.port=8083 &
  14. ./weed volume -dir=./4 -port=8084 &
  15. ./weed volume -dir=./5 -port=8085 &
  16. ./weed benchmark -server=localhost:9333
  17. What does the test do?
  18. #############################
  19. By default, the benchmark command would start writing 1 million files, each having 1KB size, uncompressed. For each file, one request is sent to assign a file key, and a second request is sent to post the file to the volume server. The written file keys are stored in a temp file.
  20. Then the benchmark command would read the list of file keys, randomly read 1 million files. For each volume, the volume id is cached, so there is several request to lookup the volume id, and all the rest requests are to get the file content.
  21. Many options are options are configurable. Please check the help content:
  22. .. code-block:: bash
  23. ./weed benchmark -h
  24. Common Problems
  25. ###############################
  26. The most common
  27. I start weed servers in one console for simplicity. Better run servers on different consoles.
  28. For more realistic tests, please start them on different machines.
  29. .. code-block:: bash
  30. # prepare directories
  31. mkdir 3 4 5
  32. # start 3 servers
  33. ./weed server -dir=./3 -master.port=9333 -volume.port=8083 &
  34. ./weed volume -dir=./4 -port=8084 &
  35. ./weed volume -dir=./5 -port=8085 &
  36. ./weed benchmark -server=localhost:9333
  37. problem is "too many open files" error. This is because the test itself starts too many network connections on one single machine. In my local macbook, if I ran "random read" following writing right away, the error happens always. I have to run "weed benchmark -write=false" to run the reading test only. Also, changing the concurrency level to "-c=16" would also help.
  38. My own unscientific single machine results
  39. ###################################################
  40. My Own Results on Mac Book with Solid State Disk, CPU: 1 Intel Core i7 at 2.2GHz.
  41. .. code-block:: bash
  42. Write 1 million 1KB file:
  43. Concurrency Level: 64
  44. Time taken for tests: 182.456 seconds
  45. Complete requests: 1048576
  46. Failed requests: 0
  47. Total transferred: 1073741824 bytes
  48. Requests per second: 5747.01 [#/sec]
  49. Transfer rate: 5747.01 [Kbytes/sec]
  50. Connection Times (ms)
  51. min avg max std
  52. Total: 0.3 10.9 430.9 5.7
  53. Percentage of the requests served within a certain time (ms)
  54. 50% 10.2 ms
  55. 66% 12.0 ms
  56. 75% 12.6 ms
  57. 80% 12.9 ms
  58. 90% 14.0 ms
  59. 95% 14.9 ms
  60. 98% 16.2 ms
  61. 99% 17.3 ms
  62. 100% 430.9 ms
  63. Randomly read 1 million files:
  64. Concurrency Level: 64
  65. Time taken for tests: 80.732 seconds
  66. Complete requests: 1048576
  67. Failed requests: 0
  68. Total transferred: 1073741824 bytes
  69. Requests per second: 12988.37 [#/sec]
  70. Transfer rate: 12988.37 [Kbytes/sec]
  71. Connection Times (ms)
  72. min avg max std
  73. Total: 0.0 4.7 254.3 6.3
  74. Percentage of the requests served within a certain time (ms)
  75. 50% 2.6 ms
  76. 66% 2.9 ms
  77. 75% 3.7 ms
  78. 80% 4.7 ms
  79. 90% 10.3 ms
  80. 95% 16.6 ms
  81. 98% 26.3 ms
  82. 99% 34.8 ms
  83. 100% 254.3 ms
  84. My own replication 001 single machine results
  85. ##############################################
  86. Create benchmark volumes directly
  87. .. code-block:: bash
  88. curl "http://localhost:9333/vol/grow?collection=benchmark&count=3&replication=001&pretty=y"
  89. # Later, after finishing the test, remove the benchmark collection
  90. curl "http://localhost:9333/col/delete?collection=benchmark&pretty=y"
  91. Write 1million 1KB files results:
  92. Concurrency Level: 64
  93. Time taken for tests: 174.949 seconds
  94. Complete requests: 1048576
  95. Failed requests: 0
  96. Total transferred: 1073741824 bytes
  97. Requests per second: 5993.62 [#/sec]
  98. Transfer rate: 5993.62 [Kbytes/sec]
  99. Connection Times (ms)
  100. min avg max std
  101. Total: 0.3 10.4 296.6 4.4
  102. Percentage of the requests served within a certain time (ms)
  103. 50% 9.7 ms
  104. 66% 11.5 ms
  105. 75% 12.1 ms
  106. 80% 12.4 ms
  107. 90% 13.4 ms
  108. 95% 14.3 ms
  109. 98% 15.5 ms
  110. 99% 16.7 ms
  111. 100% 296.6 ms
  112. Randomly read results:
  113. Concurrency Level: 64
  114. Time taken for tests: 53.987 seconds
  115. Complete requests: 1048576
  116. Failed requests: 0
  117. Total transferred: 1073741824 bytes
  118. Requests per second: 19422.81 [#/sec]
  119. Transfer rate: 19422.81 [Kbytes/sec]
  120. Connection Times (ms)
  121. min avg max std
  122. Total: 0.0 3.0 256.9 3.8
  123. Percentage of the requests served within a certain time (ms)
  124. 50% 2.7 ms
  125. 66% 2.9 ms
  126. 75% 3.2 ms
  127. 80% 3.5 ms
  128. 90% 4.4 ms
  129. 95% 5.6 ms
  130. 98% 7.4 ms
  131. 99% 9.4 ms
  132. 100% 256.9 ms
  133. How can the replication 001 writes faster than no replication?
  134. I could not tell. Very likely, the computer was in turbo mode. I can not reproduce it consistently either. Posted the number here just to illustrate that number lies. Don't quote on the exact number, just get an idea of the performance would be good enough.