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 QPS/TPS reporting #400

Open
mpetri opened this issue Jun 1, 2020 · 4 comments
Open

Support QPS/TPS reporting #400

mpetri opened this issue Jun 1, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@mpetri
Copy link

mpetri commented Jun 1, 2020

Describe the solution you'd like
The bitfunnel paper contained some additions to the partitioned_elias_fano codebase which allowed measuring queries per second with multiple threads. see here: https://github.com/BitFunnel/partitioned_elias_fano/blob/master/Runner/QueryLogRunner.cpp#L56

It would be nice in addition to reporting the metrics by queries if pisa could provide such a multi threaded QPS benchmark tool.

Additional context

In practice one would be interested in metrics such as "if my p95 requirement is 100ms, how much QPS can I achieve with this index and this hardware configuration"

@mpetri mpetri added the enhancement New feature or request label Jun 1, 2020
@JMMackenzie
Copy link
Member

@amallia @elshize @mpetri

I am thinking about this at the moment. Do we want to try to use TBB to facilitate the multi threading, or should we try to follow the example from the BitFunnel experiments (they seem to roll their own thread synchronization so they avoid timing the overhead of spooling up threads prior to processing). I suspect we can make a simple one-function addition to the queries binary to allow threads.

I know that evaluate_queries does parallel processing but it uses the tbb::parallel_for approach which might add some overhead to the timings? Not entirely sure...

@elshize
Copy link
Member

elshize commented Jun 10, 2020

@JMMackenzie When you're talking about overhead, do you mean the overhead of setting up thread pool and such, or also overhead of starting each thread?

If I understand correctly, the goal is this: given a set of queries and a number of threads, run the queries in the specified order and report the query throughput. Is this correct?

If this is the case, we could spin up a number of workers that would wait on a concurrent queue for a query in a loop. This way we could measure even in different modes:

  • begin to end,
  • each execution separately,
  • report data for each query: time of arrival, time finished (so also latency)

I personally think that measuring just the query processing without any synchronization is a bit unfair, because concurrent execution always will have overhead over sequential. But as I said, we can have different ways of measuring if we really want.

@JMMackenzie
Copy link
Member

@JMMackenzie When you're talking about overhead, do you mean the overhead of setting up thread pool and such, or also overhead of starting each thread?

Right, I mean starting each thread.

If I understand correctly, the goal is this: given a set of queries and a number of threads, run the queries in the specified order and report the query throughput. Is this correct?

I agree, this is the goal.

If this is the case, we could spin up a number of workers that would wait on a concurrent queue for a query in a loop. This way we could measure even in different modes:

* begin to end,

* each execution separately,

* report data for each query: time of arrival, time finished (so also latency)

I personally think that measuring just the query processing without any synchronization is a bit unfair, because concurrent execution always will have overhead over sequential. But as I said, we can have different ways of measuring if we really want.

Okay, I agree and I am in favor of your suggested approach. I think we have capacity to do this via TBB right?

@elshize
Copy link
Member

elshize commented Jun 11, 2020

Yes, I believe TBB should do just fine. There are two concurrent queues: one unbounded and one bounded. Since currently all queries are loaded to memory at the beginning anyway, we don't need to bound the queue.

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

No branches or pull requests

3 participants