views:

44

answers:

2

I'm generating reports on the fly using the great SpreadSheetGear tool. At first things were great because the reports were simple and done in under 1 second. Now I'm at more complex reports and they are taking about 30 seconds up to 1 minute. This isn't a problem, we just throw up an activity image and let the user wait, fine by us.

The problem I've found is when two users come to the site.

  1. User 1 comes to the site
  2. User 1 runs a report that takes 30 seconds.
  3. User 2 comes to the site
  4. User 2 waits until user 1 report is done then the page loads.

The report running for User 1 hangs up the site until it's done. What is going on and how can I fix this?

+2  A: 

You don't share any details on what the code looks like, but it sounds like you should look into making asynchronous pages. In short the trick is to move heavy work off the threads from the thread pool, which is used to serve page requests. By moving the heavy work to other threads, the thread pool thread can be returned to the pool quickly in order to serve other incoming requests.

Then it's more a matter of how much work the machine producing the reports can take.

Fredrik Mörk
I thought each page would come off a thread in the pool. We will have concurrent users but I doubt it would be more than 15 at a time. The server is hardly utilized so I'm trying to run the reports live.
Clint Davis
I've actually looked at asynchronous pages but the code on that page has the exact same problem. If I run the code locally and load two pages with that exact code, if the first page is running the second will not load until the first is done.
Clint Davis
A: 

How often does the report data change? If for example you were using SQL Server, you could have a stored procedure to create the report data to a table and have the stored procedure run as a SQL Server Agent job. Set the job to run a frequently as you want the data updated. This should speed up your pages considerably.

Sounds like you may have both requests on the same thread?

DaveB
Some data changes monthly, some daily, some to the minute. We use the SSG tool to push out Excel reports because that is what our users want.
Clint Davis