Skip to content

Reduce memory and s3 costs#274

Merged
devinmatte merged 1 commit intomainfrom
ntt/performance
Jan 7, 2026
Merged

Reduce memory and s3 costs#274
devinmatte merged 1 commit intomainfrom
ntt/performance

Conversation

@devinmatte
Copy link
Member

Motivation

Max memory used by NTT is around 192mb, so we don't need to be paying for 256. Reducing to 220 so we have some headroom still without going too far over

https://app.datadoghq.com/serverless/aws/lambda?fromUser=false&group=&panel_end=1767631532770&panel_paused=false&panel_start=1765039532770&panel_tab=metrics&sp=%5B%7B%22p%22%3A%7B%22entityId%22%3A%22aws-lambda-functions%2Bntt-apihandler-hxdxktd0wizd%2Bus-east-1%2B473352343756%22%7D%2C%22i%22%3A%22lambda-panel%22%7D%5D&start=1767627360000&end=1767630960000&paused=false

We also are currently uploading empty s3 files for lines with 0 new trains or 0 sightings of new trains. We can stop doing that

Changes

  • Drops memory demand to 220 from 256
  • Checks if we have seen new trains before uploading a new train file to s3 (reducing s3 calls)
  • Adds a type hint because I noticed it

Testing Instructions

@github-actions github-actions bot added the backend Change to backend code label Jan 5, 2026
@devinmatte devinmatte merged commit 427018e into main Jan 7, 2026
4 checks passed
@devinmatte devinmatte deleted the ntt/performance branch January 7, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Change to backend code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants