feat: add automatic high-volume handling for S3 storage adapter

- Configure AWS SDK with 500 max sockets (up from default 50)
- Add intelligent backpressure with pending operation tracking
- Implement dynamic batch sizing based on memory pressure
- Auto-reduce operations when heap usage exceeds 80%
- Gradually recover throughput when system stabilizes
- Track and respond to consecutive error patterns
- Fix S3 mock to not add ID to metadata objects
- Add backpressure to metadata save operations
- All changes are transparent - no configuration required
This commit is contained in:
David Snelling 2025-08-07 06:09:00 -07:00
parent 7fa67b55ab
commit 34c517d878
4 changed files with 169 additions and 29 deletions

View file

@ -175,8 +175,8 @@ function handlePutObject(command: any) {
const parsedBody = JSON.parse(bodyContent)
console.log(`Parsed JSON body:`, parsedBody)
// If this is a noun or verb, ensure it has an id property
if (Key.includes('/nouns/') || Key.includes('/verbs/')) {
// If this is a noun or verb (but NOT metadata), ensure it has an id property
if ((Key.includes('/nouns/') || Key.includes('/verbs/')) && !Key.includes('/metadata/')) {
if (!parsedBody.id) {
console.error(`Warning: Object ${Key} does not have an id property`)
// Add id property based on the key name
@ -255,8 +255,8 @@ function handleGetObject(command: any) {
const parsedBody = JSON.parse(bodyContent)
console.log(`Parsed JSON body for ${Key}:`, parsedBody)
// If this is a noun or verb, ensure it has an id property
if (Key.includes('/nouns/') || Key.includes('/verbs/')) {
// If this is a noun or verb (but NOT metadata), ensure it has an id property
if ((Key.includes('/nouns/') || Key.includes('/verbs/')) && !Key.includes('/metadata/')) {
if (!parsedBody.id) {
console.error(`Warning: Object ${Key} does not have an id property`)
// Add id property based on the key name