शिपिंग लेबल workload, एक paragraph में
हर order एक PDF बनाता है, हर PDF thermal printer पर एक बार print होता है, और अगर render slow है तो failure mode “page धीरे load हुआ” नहीं होता. Failure यह होता है कि warehouse pickup आपकी label-rendering API के पीछे queue में फंस जाता है. Shipping ऐसा workload है जहां p99 latency मुख्य product metric है, deterministic output जरूरी है क्योंकि reprints routine हैं, और barcode quality pixels में नहीं बल्कि GS1 X-dimension tolerances में मापी जाती है. यही तय करता है कि scanners पहली pass में label पढ़ेंगे या नहीं.
Headless-browser-based PDF stacks इन तीनों को साथ में संभालने में संघर्ष करते हैं: spike में cold-start cost compound होती है, छोटे thermal labels पर raster barcodes degrade होते हैं, और Chromium versions के बीच font rasterisation drift करता है. इसलिए “byte-identical reprint” संभव नहीं रह जाता.
gPdf क्यों fit बैठता है
4×6 thermal label छोटा होता है (203 dpi पर 576 × 864 pixels), element count low होता है (text blocks + 1-2 barcodes + optional carrier logo), और volume high होता है. Mid-size 3PL रोज 50,000 से 5,00,000 labels render कर सकता है. gPdf इसी workload के लिए built है. Renderer:
- Layout को एक बार compile करता है: page coordinates, font cascades और barcode geometry request time पर resolve होते हैं, browser layout engine के जरिए नहीं.
- हर barcode को vectorise करता है: modules सीधे PDF stream में draw होते हैं, इसलिए 30 mm-wide GS1-128 203 dpi या 600 dpi पर clean read होता है. आपकी side पर DPI-aware rasterisation logic नहीं चाहिए.
- NotoSans CJK + Latin embed करता है: वही payload Chinese carrier-name सही render करता है, बिना render container पर fonts provision किए.
हमारे reference workload में p99 flat 8 ms रहता है: EU-WEST पर ऊपर वाले sample के 1,000 invocations. इससे फर्क नहीं पड़ता कि single isolate ने एक label render किया है या 10,000 labels.
Volume + cost math
Typical mid-size 3PL लगभग 50,000 labels/day, यानी करीब 15 लाख labels/month operate करता है. Basic plan (US5/month for 100K pages, US0.00005 per page overage) पर calculation है:
1.5M pages × $0.00005 = $75.00 in overage
+ Basic plan base = $5.00
─────────────────────────────────────
total = $80.00 / month
यही workload Puppeteer-on-Lambda पर typical Lambda concurrency settings में US$200-400/month range में जाता है, peak के दौरान cold-start tax जोड़ने से पहले.
Black Friday: एक worked example
Peak spike वही workload है जहां edge rendering की value सबसे साफ दिखती है. मान लें किसी retail customer का Black Friday के पहले घंटे में normal label volume 200% हो जाता है: 60 minutes में 100,000 labels, average 1,700 labels/minute और peak bursts 5,000 labels/minute. यह एक single Cloudflare Workers region pool में complete होता है, cold-start tax के बिना. वही workload अगर average traffic के हिसाब से sized Puppeteer warm pool पर चले, तो burst-spawned containers पर 1.5-2.5 s cold starts आते हैं, और warehouse pickup desk हर delay महसूस करता है.
आगे क्या देखें
- ऊपर वाले label sample में इस्तेमाल हुआ हर field JSON Render API में cover है.
- Barcode geometry की deeper story के लिए GS1-128 precision post देखें.
- iText label pipeline replace कर रहे हैं? Logistics labels के लिए gPdf vs iText देखें, या 100K से 100M pages/month तक shipping-label TCO breakdown पढ़ें.
- Chromium-based stack से compare करना हो तो gPdf vs Puppeteer देखें.