Presumably a month's worth of points is a very large number. The query takes a long time because it's potentially scanning millions of points across at least 4 and possibly more shards.
Use a continuous query to pre-calculate your MIN() and MAX() values on an hourly or daily basis and store those values in a new measurement. Then issue the SPREAD() call to that downsampled data rather than the raw data. On Wed, Jun 29, 2016 at 9:42 AM, Mike Michel <[email protected]> wrote: > Hi, > > i am ingesting docker traffic data from prometheus to influxdb and every > month i want to calculate the traffic per user for all containers with > following query: > > > SELECT SPREAD(value) FROM container_network_receive_bytes_total WHERE user = > 'tim' AND interface = 'eth0' AND time >= '2016-03-01T00:00:00Z' AND time < > '2016-03-31T00:36:00Z' GROUP BY id" > > > This query takes around 15 seconds no matter how much RAM or CPU i add to > the vm. Moving to SSD did also not really help. Traffic is a counter, this > is why i use spread to get the difference between the first and last seen > value for every container (group by id) seen during a month. > > Is there a better way to query or any settings i can do to influxdb to > speed this up? > > > Cheers, > > Mike > > -- > Remember to include the InfluxDB version number with all issue reports > --- > You received this message because you are subscribed to the Google Groups > "InfluxDB" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/influxdb. > To view this discussion on the web visit > https://groups.google.com/d/msgid/influxdb/71afcd9a-1d8e-47d5-9f55-fc92c3c67fea%40googlegroups.com > <https://groups.google.com/d/msgid/influxdb/71afcd9a-1d8e-47d5-9f55-fc92c3c67fea%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Sean Beckett Director of Support and Professional Services InfluxDB -- Remember to include the InfluxDB version number with all issue reports --- You received this message because you are subscribed to the Google Groups "InfluxDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/influxdb. To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/CALGqCvOa8-1aOgGw4r7i2izo_Ga52tTQ6mDyfh2ghvjfs1XoBA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
