Menu

Node.js Image Thumbnail Processing Times Out Before Object Storage Upload
📰

Node.js Image Thumbnail Processing Times Out Before Object Storage Upload

DEV Community: node·LinusHolm3764·about 13 hours ago
#Q3o6Ogte
#devtonodejs#devto#dev#upload#object
Reading 0:00
15s threshold

Thumbnail upload timeouts are usually diagnosed at the wrong boundary. The object store gets blamed, while the request is still decoding an oversized source image, allocating memory for a resize, or waiting for a slow encoder. Split the work into three measured stages: decode and resize, encode, then upload. Keep the upload out of the application response path, and use a direct multipart or presigned transfer for large originals.

The practical rule is simple: resize before the network, but do not make the web request own the whole resize-and-upload job. A queue worker can produce a 320px thumbnail, record each stage's duration, and upload the result with a bounded retry policy. That gives you a useful failure signal instead of one 30-second timeout.

Why does processing image thumbnails time out before upload?

Start with timestamps, not a new storage vendor. Log the source byte count, pixel dimensions, output byte count, decoder time, encoder time, and upload time.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.