Many applications transform files: thumbnails for uploaded photos, PDFs of invoices and reports, converted documents, transcoded video, imported spreadsheets. These jobs are heavy, slow and sometimes dangerous (files from users can be malformed or malicious). Running them properly in the background keeps your application responsive and your server safe.
The Processing Pipeline
upload ─▶ validate (size, type) ─▶ store original ─▶ enqueue job
│
worker: fetch ─▶ process (sandboxed, time/memory limits) ─▶ store result
│
update status ─▶ notify user
Never process large files inside the web request; return quickly with a job ID and let the client poll or receive a notification (see our workers guide).
Tools by File Type
| Task | Common tools | Resource profile |
|---|---|---|
| Image resize and convert | libvips, ImageMagick, sharp | Fast; libvips uses little memory |
| Video and audio | FFmpeg | CPU-heavy, multi-threaded |
| HTML to PDF | Headless Chromium (Puppeteer, Playwright), wkhtmltopdf alternatives | Memory-heavy per browser |
| Office documents | LibreOffice headless | Memory-heavy, slow start |
| OCR | Tesseract, OCRmyPDF | CPU-heavy |
| CSV and Excel imports | Streaming parsers in your language | Memory depends on streaming vs loading |
Concurrency and Resources
- Run about one CPU-heavy job per vCore; more just makes each job slower.
- Measure peak memory per job type and cap concurrency so total memory fits.
- Use separate queues for fast and slow jobs, so thumbnails are not stuck behind video encodes.
- Reuse long-starting tools (a pool of browsers or a LibreOffice server) rather than starting one per job.
See our heavy CPU workloads guide for using all cores efficiently.
Untrusted Files
File parsers have a long history of vulnerabilities, and users can upload crafted files. Protect the server:
- Validate type by content, not just extension; enforce size limits.
- Run processing in containers or as a dedicated low-privilege user, with no access to application secrets.
- Apply timeouts and memory limits per job (for example systemd or container limits).
- Configure ImageMagick security policies to disable risky coders you do not need.
- Scan uploads for malware where files are shared with other users.
- Never pass filenames from users directly into shell commands.
Temporary and Durable Storage
Use a dedicated temporary directory on fast local NVMe for working files and clean it after every job, including failed ones. Store originals and results in durable storage (the application's storage directory or object storage), referenced by the database. Monitor disk space; failed jobs leaving temporary files behind are a classic way to fill a disk.
Progress and Failures
Record job status (queued, processing, done, failed) with error messages users can act on ("this PDF is password-protected"). Retry transient failures, not invalid files. Notify users when long jobs finish.
Large Data Imports
For CSV and Excel imports, stream rows rather than loading whole files, validate and report errors per row, import in batches inside transactions, and make imports resumable so a failure at row 90,000 does not restart from zero.
Sizing
| Workload | Suggested plan |
|---|---|
| Thumbnails, small PDFs, CSV imports | 2 vCores / 8 GB |
| PDF rendering, OCR, document conversion | 4 vCores / 16 GB |
| Video transcoding, bulk OCR | 8–16 vCores, or a dedicated worker server |
Common Mistakes
- Processing in the web request and timing out on large files.
- Unlimited concurrency exhausting memory.
- Processing untrusted files with full application privileges.
- Temporary files never cleaned up.
In Short
Queue every file, process in sized and sandboxed workers with the right tool, clean temporary storage, store results durably and tell users what happened.
Example: A Real Estate Listing Platform
A property portal accepts photos, floor plans and brochures from agents. Uploads go to a temporary area with size and type checks, then a job is queued per file. A thumbnail queue uses libvips to produce several sizes and WebP versions within seconds; a slower queue renders brochure PDFs to preview images and runs OCR on scanned floor plans. Workers run in containers with memory limits and no access to the main database credentials. The portal runs on a 4 vCore / 16 GB VPS, with concurrency capped at three slow jobs so the site stays fast during bulk uploads.
Monitoring
Track queue depth and wait time per queue, job duration and failure rate by file type, peak memory per job, and free space in the temporary directory. Alert when queues grow faster than they drain or when a job type starts failing more than usual, which often signals a new kind of file your tools do not handle.
Next Steps
List the file types you process, choose a tool for each, move processing into queued workers with limits, then measure memory and time per job to set concurrency and choose a plan.
Retries and Idempotency
Workers crash, servers restart and jobs get delivered twice. Design each job so running it again is harmless: write results to a deterministic location keyed by the file ID and job type, check whether a result already exists before starting, and update status atomically when finished. Separate transient failures (a timeout reaching storage) from permanent ones (a corrupt file) so the queue retries the first kind with backoff and marks the second as failed with a clear message.
Output Formats and Delivery
Choose output formats that suit their use: WebP or AVIF with JPEG fallback for web images, H.264 MP4 for broad video compatibility, PDF/A where documents must be archived long term. Serve processed files through the web server or a CDN with long cache headers, and use signed or authorised URLs for private files.
SkyRainCloud Plans for This Workload
File processing is CPU- and memory-bound per job. Light image and CSV work fits 2 vCores / 8 GB; PDF rendering, OCR and video need 4–8 vCores with enough RAM for parallel jobs, or a separate worker server.
AMD EPYC 7C13 VPS
Dedicated KVM vCores on AMD EPYC 7C13 (up to 3.70 GHz) with DDR4 ECC memory, NVMe SSD and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — AMD | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Websites, small APIs, bots, staging and VPN servers | Order |
| VPS 2 — AMD | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,299/month | WooCommerce, Node.js/Python backends, Docker Compose stacks, CI runners | Order |
| VPS 3 — AMD | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,499/month | Production databases, high-traffic sites, multi-container apps | Order |
| VPS 4 — AMD | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,899/month | Large production workloads, SaaS platforms, analytics, in-memory caches | Order |
Intel Xeon Platinum 8269CY VPS
KVM VPS on Intel Xeon Platinum 8269CY (up to 3.80 GHz Turbo) with DDR4 ECC memory, NVMe SSD, full root access and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — Intel | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Business websites, small apps, scheduled jobs and bots | Order |
| VPS 2 — Intel | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,169/month | Business software, mid-size databases, several sites on one server | Check stock |
| VPS 3 — Intel | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,249/month | ERP/CRM stacks, heavier databases, multiple production apps | Check stock |
| VPS 4 — Intel | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,299/month | High-memory workloads and consolidated production servers | Check stock |
Prices are monthly in INR as listed on the SkyRainCloud store (verified 2026-11-14). Stock and final pricing are shown on the product page at checkout.