Reduce timeout to 45 seconds following analysis by Chris H-S:

"Failure is slower than success. So the longer a notification
takes to get a status, the more likely it is for that status
to be a failure anyway. This increases dramatically after 45 seconds.
The percentage of emails that go to delivered in less than 90 seconds
is 98.92%. To get to 99% we’d need to increase the timeout
to 178 seconds (3 minutes). We could still get 98.7% of notifications
by dropping the timeout to 45 seconds, and improve the experience
for notifications that are likely to fail by returning an error more quickly."
This commit is contained in:
Pea Tyczynska
2019-05-21 17:09:16 +01:00
parent 44ddd287b5
commit 934bcb919f
2 changed files with 3 additions and 4 deletions

View File

@@ -481,7 +481,7 @@ def get_service_verify_reply_to_address_partials(service_id, notification_id):
created_at_no_tz = notification["created_at"][:-6]
seconds_since_sending = (datetime.utcnow() - datetime.strptime(created_at_no_tz, '%Y-%m-%dT%H:%M:%S.%f')).seconds
if notification["status"] in FAILURE_STATUSES or (
notification["status"] in SENDING_STATUSES and seconds_since_sending > 90
notification["status"] in SENDING_STATUSES and seconds_since_sending > 45
):
verification_status = "failure"
form.email_address.data = notification['to']