Commit Graph

24 Commits

Author SHA1 Message Date
Pankaj Garg 43ff65ece9
Use single send socket in UdpTpuConnection (#26105) 2022-06-21 14:56:21 -07:00
Lijun Wang 29b597cea5
Connection pool support in connection cache and QUIC connection reliability improvement (#25793)
* Connection pool in connection cache and handle connection errors

1. The connection not has a pool of connections per address, configurable, default 4
2. The connections per address share a lazy initialized endpoint
3. Handle connection issues better, avoid race conditions
4. Various log improvement for help debug connection issues
2022-06-10 09:25:24 -07:00
Jon Cinque 79a8ecd0ac
client: Remove static connection cache, plumb it instead (#25667)
* client: Remove static connection cache, plumb it instead

* Add TpuClient::new_with_connection_cache to not break downstream

* Refactor get_connection and RwLock into ConnectionCache

* Fix merge conflicts from new async TpuClient

* Remove `ConnectionCache::set_use_quic`

* Move DEFAULT_TPU_USE_QUIC to client, use ConnectionCache::default()
2022-06-08 13:57:12 +02:00
Jon Cinque 67a11ce4b1
client: Add nonblocking udp client and connection trait (#25775)
* client: Add nonblocking udp client

* Address feedback
2022-06-06 19:28:31 +02:00
ryleung-solana 1ca5c3a7bd
Switch to using enum-dispatch to switch between UDP and Quic (#24713) 2022-05-26 11:21:16 -04:00
ryleung-solana b857528a03
Implement updating the connection cache stats in the client (#25308) 2022-05-19 15:29:27 -04:00
Lijun Wang 81d9a7585d
Add make_connection metrics (#25280)
* Add metrics for open_uni

* Added metrics for make_connection

* measure make_connection success or fail
2022-05-18 13:23:29 -07:00
Lijun Wang 196de1c043
Refactor make_connection (#25225)
1. Move logics related to creating endpoint, creating new connection and retry 0rtt connections into a wrapper construct QuicNewConnection to put the logic together.
2. get_or_add_connection: logic is much simplified to allow manage the connection cache -- the QUIC connection is lazy constructed. get_or_add_connection should no longer be a global hotspot.
3.  Per connection stats update is moved out of get_or_add_connection to avoid bad connection impacting good connections.
2022-05-16 11:13:18 -07:00
Lijun Wang abd4ef889e
Fixed a race condition where in multiple thread environment that wasteful (#25176)
Duplicate and useless connections are being created which overloads the server and cause unreliable
connections on the client side.
2022-05-14 15:02:13 -07:00
Brennan Watt 301a655f06
Enable 0rtt (#25055)
* Enable 0rtt connections
2022-05-10 09:44:07 -07:00
Pankaj Garg b4c3b66f1a
Replace HashMap and Vec with IndexMap in connection cache (#24967) 2022-05-04 12:38:03 -07:00
Pankaj Garg 3dad27d84d
Optimize connection cache eviction logic (#24911)
* Optimize connection cache eviction logic

* add eviction count and timing to metrics

* use swap_remove
2022-05-03 02:27:40 +00:00
Pankaj Garg de027a895b
Use RwLock instead of Mutex in QUIC connection cache (#24857)
* Use RwLock instead of Mutex in QUIC connection cache

* replace LruCache with HashMap

* fix tests

* fix tests

* refactor

* add cache eviction for a random connection on reaching upperbound

* cleanup
2022-05-02 13:02:49 -07:00
Pankaj Garg 21ee012c18
Add some timing measure for get_connection() (#24814)
* Add some timing measure for get_connection()

* fix build issue
2022-04-29 09:58:01 -07:00
sakridge b64791ef79
Add packets and batches sent to quic client stats (#24442) 2022-04-20 13:59:54 +02:00
sakridge 1b7d1f78de
Implement QUIC connection warmup service for future leaders (#24054)
* Increase connection timeouts

* Bump quic connection cache to 1024

* Use constant for quic connection timeout and add warm cache service

* Fixes to QUIC warmup service

* fix check failure

* fixes after rebase

* fix timeout test

Co-authored-by: Pankaj Garg <pankaj@solana.com>
2022-04-15 12:09:24 -07:00
ryleung-solana 8cfc010b84
Send async quic batch of txs (#24298)
Add an interface send_wire_transaction_batch_async to TpuConnection to allow for sending batches without waiting for completion

Co-authored-by: Anatoly Yakovenko <anatoly@solana.com>
2022-04-14 22:20:34 -04:00
sakridge e7fcda1424
Quic client stats (#24195)
* Add metrics to connection-cache to measure cache hits and misses

* Add congestion stats

* Add more client stats

* Review comments

Co-authored-by: Ryan Leung <ryan.leung@solana.com>
2022-04-13 05:04:40 +02:00
anatoly yakovenko 474080608a
Async send for send transaction service (#24265)
* async send
2022-04-12 07:15:59 -07:00
ryleung-solana a38bd4acc8
Use LRU in connection-cache (#24109)
Switch to using LRU for connection-cache
2022-04-06 10:58:32 -04:00
ryleung-solana 8b72200afb
Thin client quic (#23973)
Change thin-client to use connection-cache
2022-03-31 15:47:00 -04:00
ryleung-solana 82945ba973
Optimize TpuConnection and its implementations and refactor connection-cache to not use dyn in order to enable those changes (#23877) 2022-03-24 11:40:26 -04:00
Lijun Wang ae76fe2bd7
Made connection cache configurable. (#23783)
Added command-line argument tpu-use-quic argument.
Changed connection cache to return different connections based on the config.
2022-03-21 09:31:37 -07:00
ryleung-solana 9b46f9b2da
Quic Connection Cache (#23598)
Add a connection cache to allow add modules that send data to get or create connections (e.g. for quic) associated with a certain SocketAddr
2022-03-15 18:16:35 -04:00