Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/aiofastnet/constants.py: 89%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

9 statements  

1# After the connection is lost, log warnings after this many write()s. 

2LOG_THRESHOLD_FOR_CONNLOST_WRITES = 5 

3 

4# Seconds to wait before retrying accept(). 

5ACCEPT_RETRY_DELAY = 1 

6 

7SSL_TIMEOUT_DEFAULTS = { 

8 # Number of seconds to wait for SSL handshake to complete 

9 # The default timeout matches that of Nginx. 

10 "ssl_handshake_timeout": 60.0, 

11 # Number of seconds to wait for SSL shutdown to complete 

12 # The default timeout mimics lingering_time 

13 "ssl_shutdown_timeout": 30.0 

14} 

15 

16SSL_BIO_SIZE_DEFAULTS = { 

17 # Static size for the incoming SSL BIO 

18 # This is the size of the buffer that we pass to the recv syscall 

19 # The bigger it is the more we can read from kernel RCVBUF with a single syscall 

20 # But it also increases the memory footprint per client 

21 "ssl_incoming_bio_size": 16 * (16 * 1024 + 64), 

22 

23 # Static size for the outgoing SSL BIO 

24 # Indicates how much encrypted data is accumulated before we call `send` syscall 

25 # Having extra 64 bytes prevents scenarios when we send almost complete TLS record. 

26 # It is not great for the latency. 

27 "ssl_outgoing_bio_size": 16 * (16 * 1024 + 64) 

28} 

29 

30DATA_RECEIVED_MAX_SIZE = 256 * 1024 

31DATAGRAM_RECEIVED_MAX_SIZE = 64 * 1024 

32 

33# See https://github.com/tarasko/aiofastnet/issues/62 

34# Limit the amount read before returning to the event loop. This gives 

35# protocols that wake an async consumer from data_received() a chance to 

36# process queued data and prevents one busy connection from starving others. 

37MAX_READ_BYTES_PER_CYCLE_HINT = DATA_RECEIVED_MAX_SIZE 

38 

39EXC_INFO_ATTR = '_aiofastnet_extra_info'