Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Killing Servers With Music Graphing

Killing Servers With Music Graphing

A talk I gave at Oxford Geek Night 7

Andrew Godwin

June 25, 2008
Tweet

More Decks by Andrew Godwin

Other Decks in Programming

Transcript

  1. killing servers with
    music graphing
    Andrew Godwin
    www.aeracode.org
    (or, how I learned to stop worrying
    and love the load averages)

    View Slide

  2. last.fm profile history visualiser

    View Slide

  3. August
    July
    May
    2007
    June
    Cascada
    Mika
    Mika
    Mika
    Anda in
    Anda in
    Black Mesa Source
    D.H.T.
    D.H.T.
    DJ Sammy
    DJ Sammy
    DJ S a mmy
    Faithless
    Hybrid
    Hybrid
    Hybrid
    Hybrid
    The Postal Service
    T h e P o sta l S e rv ice
    Chicane
    Chicane
    Chicane
    Chicane
    Robert Miles
    Robert Miles
    Milk Inc.
    Milk Inc.
    ATB
    ATB
    Nightwish
    Nightwish
    Nightwish
    Groove Coverage
    William Orbit
    William Orbit
    William Orbit
    William Orbit
    Moby
    Moby
    S y lv e r
    Novaspace
    Sash!
    S a sh
    !
    Ha n s Z imme r
    Murray Gold
    Clint Mansell

    View Slide

  4. svg
    downloader
    lastgraph
    pdf
    renderer
    lastgraph
    (graphication)
    amazon s3
    user

    View Slide

  5. last.fm's API: 1 request per second
    Each user: ~50 requests
    This is fine if you're only getting a user a minute...
    Solution?
    Ask them nicely to let y ou have 10 per second.
    Worry about getting a user every few seconds.

    View Slide

  6. I have live graphing (simpler ones made on the fly)
    This hurts CPUs
    I don't have many CPUs
    Solution?
    Get more CPUs

    View Slide

  7. I was using mod_python
    So, a Python interpreter per Apache process
    I don't have that much memory
    Solution?
    Use FastCGI. Or buy more memory.

    View Slide

  8. (which may or may not work)

    View Slide

  9. Andrew Godwin
    www.aeracode.org

    View Slide