bryancall opened a new pull request, #14027:
URL: https://github.com/apache/trafficserver/pull/14027

   With the OpenSSL QUIC backend, a connection kept the OpenSSL object for 
every stream it had opened until the connection was freed. After HTTP/3 deleted 
a finished stream, `_process_openssl_streams` skipped its entry but never 
removed it, so each event walked every stream the connection had ever served 
and did a linear `find_stream` for each one. The cost of an event grew with the 
number of requests on the connection, and finished streams kept their OpenSSL 
stream objects until close.
   
   This frees the stream object and drops the entry once HTTP/3 has deleted the 
stream. HTTP/3 deletes a stream only once each direction it has is done (the 
peer's FIN read, ours handed to OpenSSL), and `SSL_free` does not reset a 
stream part that was already concluded, so OpenSSL still delivers what it has 
buffered. Streams that HTTP/3 does not delete, such as ones the peer resets, 
are still held until the connection closes, as before.
   
   #14017, still open, also changes when HTTP/3 deletes request streams. The 
two touch different code and merge cleanly. This change does not depend on it: 
it releases the OpenSSL stream object behind whatever stream HTTP/3 deletes, 
and relies only on HTTP/3 deleting a stream once each of its directions is 
done. With #14017 applied and this fix left out, the new test still fails with 
44 objects held.
   
   The new Uranium test sends 40 requests one after another on a single 
connection, then reads the number of stream objects still held when the 
connection is freed. That count is logged only by the OpenSSL backend, so the 
test runs only there. With the count logged and the fix left out, 44 objects 
remained and the test fails; with the fix, 4 remain (the control streams on 
both sides and the client's QPACK streams).
   
   Measured on master with h2load over HTTP/3 (32 connections, tuned config), 
two interleaved rounds of three runs each. Each figure is the mean of the two 
round medians; the spread is how far the two rounds of the same build differ.
   
   | | master | + this change | round-to-round spread |
   |---|---|---|---|
   | 1 KB to origin | 5,940 req/s | 6,357 req/s (+7%) | 1.4% / 0.9% |
   | 1 KB cache hit | 7,932 req/s | 8,814 req/s (+11%) | 2.5% / 0.2% |
   | 1 MB | unchanged | unchanged | |
   
   HTTP/2 1 KB on the same setup, which this change cannot affect, moved 0.4%.
   
   The gain is small on master because all QUIC traffic runs on one thread that 
is mostly idle waiting for its next poll. When that limit is removed, the 
stream walk becomes the main cost: in a prototype that spreads QUIC across all 
network threads, this change took 1 KB requests from 42k to 199k per second.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to