Ticket #3 (closed patch: fixed)

Opened 5 years ago

Last modified 11 months ago

Faster CGI graphs

Reported by: jo Assigned to: jo
Priority: high Milestone: Munin 1.4
Component: master Version:
Severity: normal Keywords:
Cc: None

Description

Right now the CGI graphs are drawn one at a time, reading all the configuration data for each graph drawn. This makes it very slow, especially when viewing a node with a lot of plugins.

Munin should support at least one method of keeping the config (and other information that can be kept) in memory between runs. This can be done through a lot of apache modules (e.g. fastcgi).

Attachments

munin-cgi-graph_fastcgi.diff (4.6 kB) - added by blueyed on 05/11/08 01:21:46.
Patch for munin-cgi-graph (Fixed patch, just called "rediff" on the previous one)
munin-cgi-graph_fastcgi.2.diff (11.8 kB) - added by do on 08/12/08 20:14:25.
fastscgi patch for trunk
munin-fastcgi-ticket3.diff (8.6 kB) - added by blueyed on 12/19/08 01:53:06.
Patch against SVN trunk as described in the previous comment
munin-cgi-graph (8.4 kB) - added by blueyed on 12/19/08 01:55:18.
For reference: my munin-cgi-graph (derived from the patch)
munin-graph (40.7 kB) - added by blueyed on 12/19/08 01:55:35.
For reference: my munin-graph (derived from the patch)

Change History

11/29/05 15:04:39 changed by ilmari

  • priority changed from normal to low.

10/30/06 00:06:37 changed by janl

  • milestone set to Munin 1.4.

10/30/06 00:07:03 changed by janl

  • keywords deleted.
  • priority changed from low to normal.
  • version deleted.
  • component changed from doc to server.
  • severity changed from blocker to normal.

06/14/07 01:16:53 changed by blueyed

The patch provides fastcgi support for munin-cgi-graph. However, it still just "exec"s munin-graph, when new images have to be generated - maybe that could be improved, too.

05/11/08 01:21:46 changed by blueyed

  • attachment munin-cgi-graph_fastcgi.diff added.

Patch for munin-cgi-graph (Fixed patch, just called "rediff" on the previous one)

07/28/08 14:44:39 changed by frieder

doesn't apply to current svn trunk

08/12/08 20:13:52 changed by do

Here is a new patch. I do not know whether it works with the semaphore stuff... it works for version 1.2.6 in Debian, though.

08/12/08 20:14:25 changed by do

  • attachment munin-cgi-graph_fastcgi.2.diff added.

fastscgi patch for trunk

12/19/08 01:51:08 changed by blueyed

I've reworked my initial patch and fixed the Last-Modified handling.

The current patch includes a patch to munin-graph, which includes a call to utime so the generated images contain the "last update" value. This can be used very effectively by munin-cgi-graph now.

The patch also reverts the "fix" for graph_usable introduced in ticket #499. Also, I had to change $IPC_KEY to 9340 (like in do's munin-cgi-graph_fastcgi.2.diff, otherwise semget failed). I'm not sure, if this semaphore handling is required after all (or does more harm than good, e.g. if IPC_KEY=9340 fails for others now).

I've also changed the HTTP_IF_MODIFIED_SINCE check, since the previous one did not take the field sent by the browser into account at all (it only triggered the check).

The patch changes the flow as follows: 1. if the graph is not usable (too old for the current time frame) or reload is forced (ctrl-f5) a new graph gets created 2. This will have the "last update" time (which graph_usable and $last_modified uses) 3. If the browser sends last-modified-since, it gets checked against the image's datetime and in case it's recent enough, a 304 gets sent. 4. Otherwise the image gets sent.

Please consider applying the patch to trunk, so that this (old) ticket can be closed finally.

I'm attaching a patch against trunk and the files as I'm using them (in a 1.2.x install), where munin-graph differs a lot, but munin-cgi-graph is quite the same as in trunk (with the patch).

Thanks.

12/19/08 01:53:06 changed by blueyed

  • attachment munin-fastcgi-ticket3.diff added.

Patch against SVN trunk as described in the previous comment

12/19/08 01:55:18 changed by blueyed

  • attachment munin-cgi-graph added.

For reference: my munin-cgi-graph (derived from the patch)

12/19/08 01:55:35 changed by blueyed

  • attachment munin-graph added.

For reference: my munin-graph (derived from the patch)

10/27/09 23:47:25 changed by janl

  • priority changed from normal to high.
  • type changed from enhancement to patch.

Pushing up the priority for this - will be in 1.4 if at all possible.

10/28/09 01:48:38 changed by janl

  • status changed from new to closed.
  • resolution set to fixed.

Patches adapted. Thanks a lot. In r2734.