Aggregate the data, instead of reporting every 5 second report ever X amount of minutes. Unless the graph is HUGE the users won't be able to notice that the data has been aggregated. If the need to drill down onto seconds just re render the chart with that data set (filter data for example that day).
A data point every 5 seconds for a month is about half a million points. Assuming that your axis length is about 1000 pixels then, if plotted directly, each pixel will need to display about 500 points. Rather cluttered at best and not very informative to users.
A few years ago when I was dealing with data in these quantities we (that is the team I was working with) actually plotted 3 lines on each chart. We broke the time period into about 500 fixed width periods and then for each period we calculated the average, the minimum and the maximum value and plotted these as three lines on one chart using 3 different colours using the mid value of each period for the X value. Very very effective and very very fast since computing the average, min and max is very quick.
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.