Re: Issues with Cacti running very long rrdtool commands

Ryan Garland <[email protected]> Thu, 23 Oct 2014 11:09:15 -0700
Newsgroups gmane.network.cacti.user
Message-ID <CAOHB+0g9jBUa28We_Btc_eN4sA63N8+eMiiboM95P6q1GnxPAQ@mail.gmail.com>
If it was an OS limitation, wouldn't the same command fail when run
manually at the command line?  Our arg max is quite high.

root@netmon100:/usr/local/cacti# getconf ARG_MAX
2097152

I found this thread posted by somebody last year describing the exact same
issue, but with no resolution:

http://forums.cacti.net/viewtopic.php?f=2&t=50123

I also confirmed that PHP's memory_limit is listed as 4096M in Cacti
(increased from 128M during testing), but that also did not solve the
problem.

This is fairly easy to reproduce - select 1000 data sources (of the same
type) and create an aggregate graph w/ legends using the aggregate plugin
and see if the graph draws.  I am curious whether anyone is able to get
this to work, and if so, how?

If it is not possible to work around this when rrdtool is called via Cacti,
we will have to look into other tools to graph this aggregate data and I
really don't want to do that.  Cacti has served us very well for many years.

Ryan

On Thu, Oct 23, 2014 at 10:19 AM, Gandalf <[email protected]> wrote:

> This is IMHO a restriction of the underlying OS. At least it is known,
> that some
> of those have a restriction like that
> Reinhard
>
> Am 23.10.2014 um 07:51 schrieb Ryan Garland:
> > To follow up on this, I did some tests with the graph that is failing vs
> > the graph that is working by adding:
> >
> > print strlen($command_line);
> >
> > inside the following function in rrd.php:
> >
> > function rrdtool_execute
> >
> > The graph that fails has a string length of 131104, the graph that
> succeeds
> > has a string length of 130864.  So, it would seem as though we are
> running
> > into a 131072 limitation.
> >
> > Any ideas how we can get around this, or get Cacti to run the command as
> if
> > it were at the command prompt which does not seem to have such a
> limitation?
> >
> > Cheers,
> >
> > Ryan
> >
> > On Wed, Oct 22, 2014 at 9:47 PM, Ryan Garland <[email protected]> wrote:
> >
> >> I believe I am running into a character limit for the commands that
> >> rrdtool can successfully run.
> >>
> >> I currently have a stacked aggregate graph with 1376 line items (3/4 of
> >> which are the Legend lines).  This graph renders just fine, and with
> Debug
> >> mode turned on, after the long rrdtool command, rrdtool returns "OK".
> The
> >> character count of the command (including any white space) of this
> command
> >> is 132961.  (Yes, I know that's a lot - I have my reasons :))
> >>
> >> However, as soon as I add a new line item to the graph, the graph no
> >> longer renders, and with Debug mode turned on, rrdtool does not return
> OK
> >> -- it merely shows nothing.  The character count of this command is
> 133204.
> >>
> >> Here's the kicker:  When the failing rrdtool command is manually ran at
> >> the system's command prompt, the command succeeds.  It seems that only
> >> within Cacti does the rrdtool command not work.
> >>
> >> I have done a lot of research and found some seemingly related
> information
> >> ( such as http://www.mail-archive.com/[email protected]/msg05522.html )
> >> which discusses command length limitations by the OS / kernel, limiting
> to
> >> 131072 MAX_ARG_STRLEN, but:
> >>
> >> 1) this number is slightly lower than the length of the full rrdtool
> >> command that is succeed, and
> >> 2) if that was the problem, the command should not succeed when manually
> >> run at the command prompt
> >>
> >> So what is Cacti doing when it runs rrdtool that could be limiting the
> >> command length?  Does anyone have any suggestions as to how to resolve
> this
> >> apparent limitation?
> >>
> >> Any help is appreciated.  Software versions listed below.
> >>
> >> Cacti Version 0.8.8a
> >> PHP Version 5.3.10-1ubuntu3.14
> >> Ubuntu Version 12.04
> >> RRDTool Version 1.4.x
> >>
> >> Ryan
> >>
> >
> ------------------------------------------------------------------------------
> > _______________________________________________
> > cacti-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/cacti-user
> >
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> cacti-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cacti-user
>
------------------------------------------------------------------------------