How severe does this issue affect your experience of using Ray?
- High: It blocks me to complete my task.
Issue
Hello!
I have a really simple ray pipeline consisting of two applications but the time duration is very puzzling to me.
I have a service that takes 10 seconds to run:
@serve.deployment()
class SlowThing:
def do_it(self, foo: Foo) -> str:
logger.info(f"{foo.i} Start Request")
duration = 0
start = time.time()
while duration < 10:
duration = time.time() - start
print("HI")
# sleep(10)
logger.info(f"{foo.i} Done Request")
return foo.a.upper()
I am calling this from another service:
@serve.deployment()
@serve.ingress(app)
class HttpEntrypointService:
def __init__(self):
self.i =0
@app.get("/")
async def root(self, http_request:HttpRequest):
self.i += 1
i = self.i
start = time.time()
logger.info(f"{i} Got request")
foo_handle: DeploymentHandle = get_app_handle("slow_thing")
foo = Foo(a=http_request.video_path, i=i)
answer = await foo_handle.do_it.remote(foo)
duration = time.time() - start
logger.info(f"{i} Sending response {duration}")
return answer
If I send a single request to the service, it completes in 10 seconds.
If I send 5 requests to the service, I would expect that it would behave like this:
Time 0s Send 5 requests to service
Time 10s 1st request returns
Time 20s 2nd request returns
Time 30s 3rd request returns
Time 40s 4th request returns
Time 50s 5th request returns
But instead this happens:
Time 0s Send 5 requests to service
Time 10s 1st request returns
Time 20s
Time 30s
Time 40s
Time 50s 2nd, 3rd, 4th, 5th request returns
It seems like no request is able to complete while there is any pending work.
If I submit 10 requests, it takes 100 seconds before any request is returned:
Time 0s Send 5 requests to service
Time 10s 1st request returns
...
Time 100s 2nd, ..., 10th request returns
Logs:
Am I doing something obvious wrong?
(Note: Crossposted on slack