vesoft-inc / nebula

A distributed, fast open-source graph database featuring horizontal scalability and high availability
https://nebula-graph.io
Apache License 2.0
10.73k stars 1.2k forks source link

Enable AutoFDO for Nebula Graph #4636

Open lipzhu opened 2 years ago

lipzhu commented 2 years ago

Introduction Hi Nebula Graph dev team,

We are working on the performance evaluation of Nebula Graph in Intel's ICX server, and found the metrics of front-end bound is high(LIB), for example, the Go2Step scenarior, the front-end bound of storaged process is ~32% and even more higher. Then we did some experiments for the front-end bound issue, like enabling AutoFDO, and found the Go2Step beanchmark performance can increase ~7%(Both the avg/P(95) latency). The next, we are going to apply the AutoFDO to all scenariors in nebula bench, do you have comments or suggestions ? P.S. The test result is based on the version of release-3.1 branch of Nebula Graph in Intel(R) Xeon(R) Platinum 8380 CPU.

wey-gu commented 2 years ago

Wow, amazing @lipzhu, welcome to the community!

Would you mind sharing the change via PR, or explaining specific changes in this thread?

lipzhu commented 2 years ago

@wey-gu, sorry for the later response, we just reproduce the performance increase in master by enabling the AutoFDO. And the best result is found in FindShortestPath scenario, it can increase 10+%. In general it has 2 major steps:

  1. Collect the perf data for different processes (graphd, metad, storaged), in our test environment, we use the 5 bench scenario to generate the perf data(maybe in production env, it can be TopN query), and merge the perf data into a single gcov file, you can achieve this by https://github.com/google/autofdo
  2. Compile the nebula package with the gcov which generated by 1st step with the option -fauto-profile=/path/xxx.gcov

References: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/45290.pdf

lipzhu commented 2 years ago

I can draft a document to describe the details to enable the AutoFDO for Nebula.

wey-gu commented 2 years ago

Dear @lipzhu ,

I am impressed by AutoFDO's performance gain, and especially, by your efforts/work on this.

It's really awesome, plz allow my silly question, regarding the perf data(gcov file), which I think would be crucial to be prepared(on which scenarios), is it possible that certain other scenarios could suffer from performance regression on this optimization? Or, it's considered as a general optimization(that is, we should expect no perf regression for all types of queries).

And, looking forward to your documentation, could we publish it to the nebulagraph blog when it's done?(also, if possible, we would like to invite you to the community meeting for sharing things about this work, too)

Thanks!

lipzhu commented 2 years ago

Hi @wey-gu ,

is it possible that certain other scenarios could suffer from performance regression on this optimization?

Maybe, but I rarely saw this situation, some scenarios didn't benefit from the AutoFDO binary. And Google have a paper(I paste in previous comments) to describe the situation(e.g. they collect profile data from a AutoFDO binary) they saw the regressions, and the impact is small compared with the performance gain, this maybe the reason they widely use the AutoFDO in their products.

wey-gu commented 1 year ago

@lipzhu, would you mind reaching us via mail(with an address that we could send to) so that we could share with you some contributor souvenirs and the certificate?

wey.gu(at)vesoft.com cc @lisahui

Thanks!