Repository navigation
Cmdline arg -to changes http read timeout from current 600sec default - #18279
Conversation
There was a problem hiding this comment.
the fix is correct but the comment is wrong: TTFT refers to time it takes from sending request to first token generated. it is made of:
- time to read HTTP body
- time to parse the request and do any pre-processing like tokenizer
- time to wait for the LLM inference to start, stop, etc
- time to send back the HTTP request
set_read_timeout is simply the timeout for reading HTTP body. it has nothing to do with LLM
There was a problem hiding this comment.
this won't work as-is because there is also a timeout imposed by the model instance in server-http.cpp
instead, please set the set_read_timeout and set_write_timeout according to the input params (do NOT hard-code it to 90 days)
llama.cpp/tools/server/server-http.cpp
Lines 105 to 106 in 147a521
Edit: for client cli, the set_write_timeout use be set to params.timeout_read (reversed to server)
ngxson
left a comment
There was a problem hiding this comment.
keep the code vertically aligned
|
@ngxson I changed the comment, changed the title, and --timeout is now used. From your comment, hopefully I didn't get the sense backwards for cli. Tell me if I did and I'll fix it. Should there be a different solution for this? That timeout is for communications. Processing time shouldn't affect this timeout at all, but it does. We essentially have a watchdog with a time too long for stop and unload to be responsive, and too short for slow hardware. I think we need:
|
Yeah, that sux. Sry 'bout that. It looked ok before it got to github. Spacing fixed. |
d49cd26 to
5c037f5
Compare
|
--- Testing ---
|
…c default (#18279) * Prevent crash if TTFT >300sec, boosted to 90 days * server : allow configurable HTTP timeouts for child models * server : pass needed timeouts from params only --------- Co-authored-by: Greg Slocum <[email protected]>
…c default (ggml-org#18279) * Prevent crash if TTFT >300sec, boosted to 90 days * server : allow configurable HTTP timeouts for child models * server : pass needed timeouts from params only --------- Co-authored-by: Greg Slocum <[email protected]>
…c default (ggml-org#18279) * Prevent crash if TTFT >300sec, boosted to 90 days * server : allow configurable HTTP timeouts for child models * server : pass needed timeouts from params only --------- Co-authored-by: Greg Slocum <[email protected]>
…c default (ggml-org#18279) * Prevent crash if TTFT >300sec, boosted to 90 days * server : allow configurable HTTP timeouts for child models * server : pass needed timeouts from params only --------- Co-authored-by: Greg Slocum <[email protected]>
…c default (#18279) * Prevent crash if TTFT >300sec, boosted to 90 days * server : allow configurable HTTP timeouts for child models * server : pass needed timeouts from params only --------- Co-authored-by: Greg Slocum <[email protected]>
…c default (ggml-org#18279) * Prevent crash if TTFT >300sec, boosted to 90 days * server : allow configurable HTTP timeouts for child models * server : pass needed timeouts from params only --------- Co-authored-by: Greg Slocum <[email protected]>
llama-server has a hard-coded HTTP timeout of 300 seconds (the http library default). If the prompt and input files take longer than this timeout to process, the connection times out and is dropped, the WebUI gets out of sync, etc.
It is easy to exceed 300 (or 600) seconds on consumer hardware.
This PR reads the --timeout (-to) command-line argument. The default for --timeout is 600 seconds, twice as long as the http library's 300 seconds. The value of --timeout always overwrites the http library's default now. As a result, twice as long is now available by default. More is often needed though.
Huge timeouts can now be set with --timeout, circumventing this failure.
Note: Model unloading won't complete if cli->send() is active. A huge --timeout can make unloading impractical.