Graphite 0.9.10 fails to display SVG format when running under mod_wsgi

Asked by Jared Curtis on 2012-06-08

I recently moved my graphite deployment from the development server to running on mod_wsgi within Apache. Since then the only problem I can find is that format=svg seems to hang, while all other format types render instantly. I've searched my logs and I can't find anything that can be related to this issue. Does anyone have any suggestions?

Here's my apache vhost config

<VirtualHost *:80>
  ServerName graphite.....
  ServerAdmin graphite@....
  DocumentRoot /opt/graphite/conf

  WSGIDaemonProcess graphite user=apache group=apache threads=25
  WSGIProcessGroup graphite
  WSGIScriptAlias / /opt/graphite/conf/graphite.wsgi

  <Directory /opt/graphite/www/wsgi-scripts>
    Order allow,deny
    Allow from all

Question information

English Edit question
Graphite Edit question
No assignee Edit question
Last query:
Last reply:
Michael Leinartas (mleinartas) said : #1

I've seen the same thing under mod_wsgi and have been unable to determine the cause. Strangely, if I let it time out completely, subsequent requests will work for some time..

I've been unable to reproduce this with gunicorn or uWSGI so you may try running those if you have a need for SVG rendering.

Jared Curtis (jared-w00ttech) said : #2

I may try out uWSGI but I would of course prefer to stay with mod_wsgi, everything else I have it running under that framework.

Any idea on how to disable SVG as the default render format within the dashboard?

Michael Leinartas (mleinartas) said : #3

SVG is only used when format=svg is set explicitly in the url - neither the dashboard nor the composer will set this, both leave the format parameter unset (resulting in the default of format=png). Are you seeing problems with the dashboard renders hanging as well?

Daniel Lawrence (dannyla) said : #4

I just ran into this problem, I enabled a quick fix to get this working on my system.

/webapp/graphite/render/ line 479

 # LP199778 - svgData = svgData.replace('</g><g data-header','<g data-header',1) + "</g>"
 svgData = svgData.replace('</g><g data-header','<g data-header',1)

The change that i made was just to remove ' + </g>' from the 479

Michael Leinartas (mleinartas) said : #5

Awesome, a clue!

With this I'll try and dig a bit deeper and see if I can figure out why/where this is hanging when running under mod_wsgi.

Michael Leinartas (mleinartas) said : #6

Oops, didnt mean to mark this as answer proposed..

Anyway, I filed a bug here based on this:

Can you help with this problem?

Provide an answer of your own, or ask Jared Curtis for more information if necessary.

To post a message you must log in.