How do I handle rate limit errors?
Hi Emil S., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> đź‘‹
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
Based on the knowledge sources, here's how to handle rate limit errors in Mixpanel: When you encounter rate limit errors (HTTP 429 status code) from Mixpanel's APIs, you should implement an exponential backoff with jitter strategy. Here's the recommended approach: 1. For the Ingestion API:
- Start with a backoff of 2 seconds
- Double the backoff time until reaching 60 seconds
- Add 1-5 seconds of jitter (random variation)
- Use 10-20 concurrent clients sending 2K events per batch for optimal results
- Use gzip compression with Content-Encoding: gzip
to reduce network usage
- Don't retry 400 errors as they indicate validation issues that won't resolve with retries
Import Events documentation2. For other APIs (Query API, Raw Data Export API):
- Spread your queries over a longer period of time
- Consolidate multiple queries into a single query where possible
Rate Limits documentation3. For Google PubSub integration:
- Configure PubSub to perform exponential backoff if the function times out
- For non-retryable errors (400), enqueue messages to a dead-letter-queue for later inspection
Google PubSub documentationRemember that different Mixpanel APIs have different rate limits:
- Ingestion API: 2GB uncompressed JSON/minute or ~30k events/second
- Query API: 5 concurrent queries and 60 queries/hour
- Raw Data Export API: 100 concurrent queries, 60 queries/hour, and 3 queries/second
- GDPR API: 1 request per secondFor enterprise customers who need higher limits for one-time backfills, you can contact your sales representative with your project_id and use case.Virtual Network Computing - VNC
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.