Sending scalable data to Mixpanel - Mixpanel
Inside Mixpanel

Sending scalable data to Mixpanel

Suhail Doshi

If you want to log data from your backend, you need to do it in a non-blocking way and you want it to be efficient. You could do it with CURL, but that wouldn’t really be efficient.

Enter beanstalkd, a fast, distributed, in-memory workqueue service. You can push your data to beanstalkd and use another service to process them and ping the Mixpanel api server. This lets you take care of everything in the background in a really efficient way.

We’ve put together some packages that will help you in getting started. These contain all the dependencies for beanstalkd, as well as a processing script and client libraries for PHP and Python. To download a package, enter the following command in your shell:


git clone git://


git clone git://

As you can see, these repos contain a fair number of packages.

Included projects (not made by Mixpanel)


Once you’ve downloaded a package, you have everything you need to be up and running. Before you install the dependencies, take a quick look at what you’ve downloaded. The files you will be working with are: or logger.php

  • This is the file you will be adding to your project.

  • Acts as the beanstalkd consumer; can be run as a daemon. You only need to run it.

beanstalkd (after installation)

  • This file is generated once you install beanstalkd. You can move it anywhere to install.


To run an install script that takes care of everything:

sudo sh


1. Install simplejson

cd simplejson-2.0.9
sudo python install

2. Install PyYAML

cd ../PyYAML-3.08

sudo python install

1. Install libevent

cd ../libevent-1.4.7-stable
sudo ./configure && make
sudo make install
sudo make verify

2. Install beanstalkd

cd ../beanstalkd-1.2
sudo ./configure && make

This will create a ‘beanstalkd’ file. To install, copy this file anywhere you

3. Install pybeanstalk

cd ../pybeanstalk-0.11.1
sudo python install

Once these are installed, you can begin to integrate Mixpanel metrics into
your application.

Get the latest from Mixpanel
This field is required.