--- language: - en license: mit tags: - mcp - benchmark - gradio - fastmcp - api-performance pretty_name: MCP Server Benchmark Results size_categories: - n<1K --- # 🔬 Gradio vs FastMCP Benchmark Report **Generated:** 2026-03-04T10:26:47.242725 **Total scenarios:** 12 ## Executive Summary - **echo**: Gradio wins (151.4 vs 126.2 RPS, 1.2x difference) - Gradio best config: concurrency_limit=1.0 - **async_sleep**: Gradio wins (126.6 vs 43.9 RPS, 2.88x difference) - Gradio best config: concurrency_limit=1.0 ## Throughput (Requests/Second) | | ('fastmcp', 'mcp_streamable') | ('gradio', 'mcp_streamable') | |:--------------------|--------------------------------:|-------------------------------:| | ('async_sleep', 1) | 17.54 | 16.57 | | ('async_sleep', 10) | 43.87 | 126.56 | | ('echo', 1) | 126.23 | 54.28 | | ('echo', 10) | 75.02 | 151.45 | ## Latency p50 (ms) | | ('fastmcp', 'mcp_streamable') | ('gradio', 'mcp_streamable') | |:--------------------|--------------------------------:|-------------------------------:| | ('async_sleep', 1) | 62.46 | 62.939 | | ('async_sleep', 10) | 146.304 | 78.523 | | ('echo', 1) | 7.506 | 0 | | ('echo', 10) | 115.045 | 62.953 | ## Gradio concurrency_limit Scaling How does Gradio's throughput change as concurrency_limit increases? | | 1.0 | |:--------------------|-------:| | ('async_sleep', 1) | 8.425 | | ('async_sleep', 10) | 64.665 | | ('echo', 1) | 27.14 | | ('echo', 10) | 77.105 | ## Protocol Overhead: HTTP API vs MCP Comparing latency of the same tool called via REST API vs MCP protocol: | | mcp_streamable | |:---------------------------|-----------------:| | ('fastmcp', 'async_sleep') | 104.382 | | ('fastmcp', 'echo') | 61.2755 | | ('gradio', 'async_sleep') | 2104.85 | | ('gradio', 'echo') | 1050.52 | ## Error Rates All scenarios completed with 0% error rate. ✅ ## Resource Usage | server | ('mean', 'avg_cpu_pct') | ('mean', 'avg_memory_mb') | ('mean', 'peak_memory_mb') | ('max', 'avg_cpu_pct') | ('max', 'avg_memory_mb') | ('max', 'peak_memory_mb') | |:---------|--------------------------:|----------------------------:|-----------------------------:|-------------------------:|---------------------------:|----------------------------:| | fastmcp | 0 | 5.655 | 5.66 | 0 | 5.67 | 5.67 | | gradio | 0 | 4.955 | 4.955 | 0 | 5.68 | 5.68 | ## Benchmark Charts ![Throughput Comparison](plots/throughput_comparison.png) ![Latency Comparison](plots/latency_comparison.png) ![Gradio Concurrency Limit Scaling](plots/gradio_cl_scaling.png) ![Protocol Overhead](plots/protocol_overhead.png) ## Methodology - Both servers use identical tool implementations (imported from shared_tools.py) - Each scenario runs in an isolated server subprocess - Warmup period excluded from measurements - Load generated by async httpx workers (not external tools) - MCP tests use full protocol lifecycle (initialize → call_tool) - System metrics sampled every 1s via psutil --- *Benchmarks generated by [mcp-server-bench](https://github.com/Mandark-droid/mcp-server-bench)*