Narcissus - Realtime visualizations of web server hits
What is this?
narcissus. It is a web application that visualizes web server hits
as they happen in real time.
- IP addresses converted to latitude/longitude, then streamed via WebSockets to polymaps.
- Realtime graphs of what countries are downloading what content with d3.
- Ømq (zeromq) on the backend.
- Fast. No polling.
You can see
narcissus running live at narcissus.rc.rit.edu.
The Research Computing department at the Rochester Institute of Technology runs
narcissus instance. It is pointed at their very active FOSS mirror. (That site is the highest-traffic site at RIT!)
Get the source from github.com.
There are three processes that make up narcissus:
- The web app that serves the initial map.
- The websocket server, a.k.a the Moksha Hub, that serves the realtime data stream
- The data collection script that feeds the Moksha Hub.
The Web App
Set up the WSGI app:
$ mkvirtualenv narc $ pip install narcissus.app
Grab a default config file:
$ wget https://raw.github.com/ralphbean/narcissus/develop/narcissus.app/development.ini
And start that development-grade web server:
You can also you apache with
mod_wsgi to serve this if you wanted to do it
The Moksha Hub
Assuming you're running the web app and the Moksha Hub on the same machine, you can share the virtualenv as well and just run:
$ workon narc $ pip install narcissus.hub $ ~/.virtualenvs/narc2/bin/moksha-hub
The Data Collection Script
Assuming you want to visualize the logs of a lighttpd server, you can run:
$ tail -f /var/log/lighttpd/access.log | \ narcissus-zeromq-source --targets=tcp://0.0.0.0:11987
The development.ini file tells the moksha-hub to connect
tcp://0.0.0.0:11987 from which it will start getting your raw
lighttpd logs. Those are then processed and stats are forwarded via
WebSockets to anyone viewing the web app.
Try us in
- Ralph Bean <firstname.lastname@example.org>
- Luke Macken <email@example.com>
- Lee Burton <firstname.lastname@example.org>