Stack Matrix Hub (9)
API Platform GraphQL & REST Serialization RSS in Sylius 2.x
Bound Symfony Serializer normalization depth, pagination caps, and FrankenPHP heap growth across headless Sylius /api/v2 endpoints.
45-85 MB serialization spike · itemsPerPage<=30 · Cache metadata in Redis
Why Nested Taxon & Variant JSON-LD Graphs Spike PHP Memory
Headless Sylius 2.x storefronts querying /api/v2/shop/products with deep normalization groups hydrate nested ProductOptionValue, TaxonTranslation, and ProductImage objects into associative arrays before JSON encoding, adding 45 to 85 MB transient RSS per concurrent request.
Tightening Pagination, Groups & Serializer Metadata Cache
Cap API Platform maximum_items_per_page at 30, enforce strict serialization groups on collection endpoints, and store serializer class metadata in Redis/APCu so FrankenPHP threads avoid repeated reflection scans.
Measured Thresholds & Configuration
| API Payload Configuration | Transient RSS Spike | P95 Latency (FrankenPHP) | Risk Level |
|---|---|---|---|
| itemsPerPage=100 + Deep Nested Groups | +110 - 160 MB / req | 420 - 780 ms | High OOM risk under burst |
| itemsPerPage=30 + Scoped Shop Groups | +32 - 54 MB / req | 65 - 115 ms | Balanced storefront API |
| GraphQL Persisted Query + Redis Cache | +18 - 28 MB / req | 28 - 55 ms | Optimal headless edge tier |