#[Critical] Load balancing endpoints have a payload limit of ~1MB

5 messages · Page 1 of 1 (latest)

austere shadow
#

The connection is killed by runpod for all request above ~1MB.

Here's how to reproduce it:

`#!/usr/bin/env python3
"""
FastAPI test server - JSON with base64 encoded image
"""

import asyncio
import base64
import logging
from fastapi import FastAPI, HTTPException
from fastapi.responses import JSONResponse
from pydantic import BaseModel
import uvicorn

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(name)

app = FastAPI()

class ImageRequest(BaseModel):
"""Request model with base64 encoded image"""
image: str
prompt: str = "test"

@app.post("/predict")
async def predict(request: ImageRequest):
"""
Accept JSON with base64 image, wait 5 seconds, return base64 image
"""
try:
# Decode base64 image
try:
image_bytes = base64.b64decode(request.image)
except Exception as e:
raise HTTPException(status_code=400, detail=f"Invalid base64 image data: {str(e)}")

    if len(image_bytes) == 0:
        raise HTTPException(status_code=400, detail="Image data is empty")
    
    logger.info(f"Received image: {len(image_bytes)} bytes, prompt: {request.prompt}")
    
    # Wait 5 seconds to simulate processing
    await asyncio.sleep(5)
    
    # Encode image back to base64
    image_b64 = base64.b64encode(image_bytes).decode('utf-8')
    
    return JSONResponse(
        content={
            "image": image_b64,
            "success": True
        },
        status_code=200
    )
    
except HTTPException:
    raise
except Exception as e:
    logger.error(f"Error processing request: {str(e)}")
    raise HTTPException(status_code=500, detail=f"Server error: {str(e)}")

@app.get("/ping")
async def health_check():
"""Health check endpoint"""
return {"status": "healthy"}

if name == "main":
uvicorn.run(app, host="0.0.0.0", port=8000)`

cedar lanternBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

tropic wadi
#

for staffs: is this meant to be (1mb limitation)?

ocean spindleBOT
tropic wadi
#

seems limiting for some use case