Mixpanel Community Icon

On production mixpanel api request is hampering

·
·

On production mixpanel api request is hampering

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Hi PRASHANT P., 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

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    I understand you're experiencing issues with Mixpanel API requests in your production environment. This could be due to rate limiting, which Mixpanel enforces to maintain system integrity.According to the documentation, Mixpanel has specific rate limits for different APIs: - Ingestion API: 2GB of uncompressed JSON/minute or ~30k events per second (measured on a rolling 1-minute basis) Rate Limits - Query API: Maximum of 5 concurrent queries and 60 queries per hour - Raw Data Export API: Maximum of 100 concurrent queries, 60 queries per hour, and 3 queries per secondIf you're receiving 429 response codes, it means you've reached these rate limits. To resolve this, you could: 1. Spread your queries over a longer period 2. Consolidate multiple queries into a single query where possibleAdditionally, it's a best practice to set up separate projects for development and production environments to maintain data integrity: ```var productionHost = 'Your production Domain'; var devToken = 'Development Token'; var prodToken = 'Production Token';

    //If the hostname is anything other than your production domain, initialize the Mixpanel library with your Development Token

    if (window.location.hostname.toLowerCase().search(productionHost) < 0) { mixpanel.init(devToken); } else { mixpanel.init(prodToken); } ```This approach helps ensure your testing data doesn't contaminate your production environment <https://docs.mixpanel.com/docs/tracking-best-practices/developer-environments#separate-development-data|Separate Development Data>.For large data exports, consider using the approach described in the documentation where you can vary the date ranges and increments based on your data volume to manage API requests more efficiently Exporting varied length date ranges.

    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.