NetTalk Central

Author Topic: Problem with generate several Graph  (Read 2220 times)

Matthew

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • Email
Problem with generate several Graph
« on: May 30, 2011, 04:43:12 AM »
Hello

I have a problem with generate a lot of graph in the same time.

My task:
I have netwebform, where is some button which display any graph on form.
I have window procedure to generate that graph using Insight Graphing template.

Each click of the button starts the window procedure to generate graph.

After some testing I've got really bad result of perofrmance of my web server. When I try to view a chart every for example 10 seconds with small amounts of data everything is ok. But when few users would like to view some chart in the same time with many data (for example 500 - 1000 data on XAxis), my web server stops responding and only first user see his chart.

Is it any way to get better performance to display chart? Maybe I could run this window procedure every time in new thread, but I don't know how to pass the p_web parameter to that thread, because there are functions to display any graph (p_web.CreateImage and p_web.ParseHTML).

So how to fast and correctly display graph to many user in the same time and not crash web server?

Regards,
Matthew

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: Problem with generate several Graph
« Reply #1 on: May 30, 2011, 09:33:21 PM »
Hi Matthew,

First - in your existing situation I doubt you are crashing the web server. More likely your graph is taking too long to generate, so the browser simply times out before receiving the reply.

Second - it's already running on multiple threads, so there's no advantage on that front.

There are a couple things you can do;

a) have a look at the graph itself. Why is it taking so long? Probably a factor of keys & filters, but I can't say for sure without an example. I suspect you will need to make an example for us to look at because chances are if you are making a mistake in the View, you're probably not noticing it.

b) if the graph is expected to take a while, because of the amount of data it is scanning, then you can pt a p_web.NoOp() command somewhere inside the graph generation so that the browser "keeps waiting".

Cheers
Bruce