diff options
author | Michael Brown <mcb30@ipxe.org> | 2019-08-16 21:42:49 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2019-08-16 22:19:50 +0100 |
commit | d8a1958ba5e83fcd0eabbf2c4f95231b02af33d7 (patch) | |
tree | 6eefeb77623e6e9d5286607a5b3160f648a90c43 /src/include/ipxe/peerblk.h | |
parent | 02b26de9634dcf793f4edef0b33ea71e34fceee6 (diff) | |
download | ipxe-d8a1958ba5e83fcd0eabbf2c4f95231b02af33d7.tar.gz |
[peerdist] Limit number of concurrent raw block downloads
Raw block downloads are expensive if the origin server uses HTTPS,
since each concurrent download will require local TLS resources
(including potentially large received encrypted data buffers).
Raw block downloads may also be prohibitively slow to initiate when
the origin server is using HTTPS and client certificates. Origin
servers for PeerDist downloads are likely to be running IIS, which has
a bug that breaks session resumption and requires each connection to
go through the full client certificate verification.
Limit the total number of concurrent raw block downloads to ameliorate
these problems.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/peerblk.h')
-rw-r--r-- | src/include/ipxe/peerblk.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/include/ipxe/peerblk.h b/src/include/ipxe/peerblk.h index 6fc9172f6..f16f207b0 100644 --- a/src/include/ipxe/peerblk.h +++ b/src/include/ipxe/peerblk.h @@ -111,6 +111,10 @@ struct peerdist_block { struct peerdisc_client discovery; /** Current position in discovered peer list */ struct peerdisc_peer *peer; + /** Block download queue */ + struct peerdist_block_queue *queue; + /** List of queued block downloads */ + struct list_head queued; /** Retry timer */ struct retry_timer timer; /** Number of full attempt cycles completed */ @@ -124,6 +128,26 @@ struct peerdist_block { unsigned long attempted; }; +/** PeerDist block download queue */ +struct peerdist_block_queue { + /** Download opening process */ + struct process process; + /** List of queued downloads */ + struct list_head list; + + /** Number of open downloads */ + unsigned int count; + /** Maximum number of open downloads */ + unsigned int max; + + /** Open block download + * + * @v peerblk PeerDist block download + * @ret rc Return status code + */ + int ( * open ) ( struct peerdist_block *peerblk ); +}; + /** Retrieval protocol block fetch response (including transport header) * * @v digestsize Digest size |