forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Serve] Async Router (ray-project#6873)
- Loading branch information
Showing
15 changed files
with
680 additions
and
496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from ray.experimental import serve | ||
from ray.experimental.serve.constants import DEFAULT_HTTP_ADDRESS | ||
import requests | ||
import time | ||
import pandas as pd | ||
from tqdm import tqdm | ||
|
||
serve.init(blocking=True) | ||
|
||
|
||
@serve.route("/noop") | ||
def noop(_): | ||
return "" | ||
|
||
|
||
url = "{}/noop".format(DEFAULT_HTTP_ADDRESS) | ||
while requests.get(url).status_code == 404: | ||
time.sleep(1) | ||
print("Waiting for noop route to showup.") | ||
|
||
latency = [] | ||
for _ in tqdm(range(5200)): | ||
start = time.perf_counter() | ||
resp = requests.get(url) | ||
end = time.perf_counter() | ||
latency.append(end - start) | ||
|
||
# Remove initial samples | ||
latency = latency[200:] | ||
|
||
series = pd.Series(latency) * 1000 | ||
print("Latency for single noop backend (ms)") | ||
print(series.describe(percentiles=[0.5, 0.9, 0.95, 0.99])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.