---
title: "Meta’s Full-stack HHVM optimizations for GenAI"
description: "Meta moved GenAI inference traffic, which is long-running, I/O-heavy and latency-sensitive, onto a dedicated HHVM web tenant with its own runtime tuning, cutting latency by 30%."
url: "https://swe.quest/articles/meta-s-full-stack-hhvm-optimizations-for-genai-8b3ab67200c60012"
canonical: "https://engineering.fb.com/2025/05/20/web/metas-full-stack-hhvm-optimizations-for-genai/"
source: "Meta Engineering"
published: "2025-05-20"
difficulty: "medium"
kind: "Case study"
reading_minutes: 4
tags: ["runtimes","performance","multi-tenancy","php","llms"]
---

# Meta’s Full-stack HHVM optimizations for GenAI

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2025-05-20, 4 min read, Case study. Original: [https://engineering.fb.com/2025/05/20/web/metas-full-stack-hhvm-optimizations-for-genai/](https://engineering.fb.com/2025/05/20/web/metas-full-stack-hhvm-optimizations-for-genai/)

## Summary

Meta moved GenAI inference traffic, which is long-running, I/O-heavy and latency-sensitive, onto a dedicated HHVM web tenant with its own runtime tuning, cutting latency by 30%. The isolated tier raises the usual 30-second request timeout and runs about 1,000 worker threads per host, sized by dividing host memory by the per-request memory limit, instead of a couple hundred. It also seeds the JIT cache with Jump-Start profiles from the main web tier and runs dummy warm-up requests to pre-fill config and service-discovery caches. Shadow traffic keeps the JIT cache covering code paths that open up later through real-time feature gating.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Runtimes & VMs](https://swe.quest/tags/runtimes.md) (Compilers & runtimes)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Multi-tenancy](https://swe.quest/tags/multi-tenancy.md) (Architecture & design)
- [PHP](https://swe.quest/tags/php.md) (Languages)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)

## Prerequisites

- JIT compilation basics ([easy posts on Compilers](https://swe.quest/tags/compilers.md?difficulty=easy))
- thread-per-request web servers

## Keywords

HHVM, Hack, Jump-Start, WWW

## Related posts

- [Boosting the performance of virtual machines with Jump-Start](https://swe.quest/articles/boosting-the-performance-of-virtual-machines-with-jump-start-e63dbfae46ebd497.md): Meta Engineering · 2021-03-03 · Easy · 3 min read · Compilers, Runtimes & VMs, Performance engineering, Deployment, PHP
  Jump-Start cuts JIT warm-up overhead in HHVM by having a small slice of the fleet collect profiling data during Facebook's phased rollout.
- [Meta’s Infrastructure Evolution and the Advent of AI](https://swe.quest/articles/meta-s-infrastructure-evolution-and-the-advent-of-ai-5db1ff27f9423ca7.md): Meta Engineering · 2025-09-29 · Easy · 17 min read · Datacenters, Model training, Hardware, Scaling, Distributed systems
  Meta's infrastructure grew from a LAMP stack with per-university databases to a global fleet of millions of machines.
- [How Meta trains large language models at scale](https://swe.quest/articles/how-meta-trains-large-language-models-at-scale-c827e36c67bd0ee6.md): Meta Engineering · 2024-06-12 · Easy · 6 min read · Model training, Networking, Hardware, Datacenters, Distributed systems
  Training LLMs at Meta shifted workloads from many small recommendation jobs to a few enormous GPU jobs, forcing changes across hardware, data center layout, reliability, networking and storage.
- [Run FLUX.1-dev three times faster](https://swe.quest/articles/run-flux-1-dev-three-times-faster-ae60b80e0a362206.md): Modal · 2025-06-18 · Medium · 9 min read · Inference & serving, Performance engineering, Python, Computer vision, Serverless
  FLUX.1-dev image generation on Modal drops from ~6.75s to under three seconds per 1024x1024 image.
- [2,000 robots walk into a shop...](https://swe.quest/articles/2-000-robots-walk-into-a-shop-197e6155a91a1c15.md): Shopify Engineering · 2026-02-27 · Hard · 8 min read · Inference & serving, AI agents, LLMs, Performance engineering, Hardware
  SimGym runs simulated A/B tests on Shopify storefronts by sending up to 2,000 concurrent LLM-driven shopper agents through Browserbase cloud browsers.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
