Throttle code causes rate limit warnings

Created on 9 May 2024, 6 months ago
Updated 28 June 2024, 5 months ago

Problem/Motivation

When throttling is enabled, amazon_ses attempts to calculate the allowed send rate for email and calls usleep() after sending in order to not exceed the configured maximum send rate for the AWS account.

Unfortunately, `getSleepTime()` calls the `getSendQuota()` function for each mail, which calls the `getAccount()` function, which hits the AWS API endpoint each time. However, Amazon says that endpoint is rate limited to 1 hit per second.

This results in errors logged, although the emails *do* all get sent without issue.

Steps to reproduce

Install amazon_ses and send a few hundred emails in a batch. Look at the logs.

Proposed resolution

Cache the results of getSendQuota for a while, so the endpoint doesn't get hit for each email.

Remaining tasks

Code change.

User interface changes

Nah.

API changes

Nah.

Data model changes

Nah.

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia cafuego

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024