473,404 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Tracking High Volume of Impressions

Hello,

Did anyone have some experience with the following:

1) Need to track high volume of impressions - 20,000,000+ per day
2) Backend is SQL Server 2000
3) Webfarm of IIS with ASP.NET
4) Need to track the data as follows:
DATE, TIME (resolution should be 1 hour), ID, NUMBER OF IMPRESSIONS, SOME
OTHER COUNTS
05/01/2004, 13:00, 123adfc1234, 34567, ...
05/01/2004, 13:00, 444adfc1234, 567, ...
05/01/2004, 13:00, 222adfc1234, 67, ...
05/01/2004, 14:00, 123adfc1234, 32012, ...
....

I want to avoid hitting the database as much as possible. I would like to
accumulate the summary data somewhere else and only hit the database every
few minutes.

If I use an in-memory DataTable on the webfarm, I am worried about threads
locking each other when updating it.

I am thinking I need some kind of an shared MemoryStream which will server
as a buffer with minimal locking. This buffer would be used by a background
thread (how to PROPERTLY do this in ASP.NET?) to generate the DataTable
which will be kept in Application scope. Once every X minutes that DataTable
would be committed to backend SQL server.

While the background thread processes the MemoryStream a new one would need
to be immediatelly available to the tracking web servers.

Another solution I was thinking about was TCP/IP Remoting or even stateless
UDP packets sent to a central server that would be listening for them and
updating an DataTable object. However, I am worried that all those requests
will be too much for a DataTable object to process.

Thanks in advance,
Arsen
Nov 18 '05 #1
2 1361
How about microsoft message queue (MSMQ)?

--
Andrew J. Kelly SQL MVP
"Arsen V." <ar****************@emergency24.com> wrote in message
news:uD**************@tk2msftngp13.phx.gbl...
Hello,

Did anyone have some experience with the following:

1) Need to track high volume of impressions - 20,000,000+ per day
2) Backend is SQL Server 2000
3) Webfarm of IIS with ASP.NET
4) Need to track the data as follows:
DATE, TIME (resolution should be 1 hour), ID, NUMBER OF IMPRESSIONS, SOME
OTHER COUNTS
05/01/2004, 13:00, 123adfc1234, 34567, ...
05/01/2004, 13:00, 444adfc1234, 567, ...
05/01/2004, 13:00, 222adfc1234, 67, ...
05/01/2004, 14:00, 123adfc1234, 32012, ...
...

I want to avoid hitting the database as much as possible. I would like to
accumulate the summary data somewhere else and only hit the database every
few minutes.

If I use an in-memory DataTable on the webfarm, I am worried about threads
locking each other when updating it.

I am thinking I need some kind of an shared MemoryStream which will server
as a buffer with minimal locking. This buffer would be used by a background thread (how to PROPERTLY do this in ASP.NET?) to generate the DataTable
which will be kept in Application scope. Once every X minutes that DataTable would be committed to backend SQL server.

While the background thread processes the MemoryStream a new one would need to be immediatelly available to the tracking web servers.

Another solution I was thinking about was TCP/IP Remoting or even stateless UDP packets sent to a central server that would be listening for them and
updating an DataTable object. However, I am worried that all those requests will be too much for a DataTable object to process.

Thanks in advance,
Arsen

Nov 18 '05 #2
Hi Arsen:

I wouldn't use a DataTable, but hand craft a small class with strongly
typed properties to hold information for each impression.

For a container, you could chose an ArrayList, and Add an object for
each impression. You will need threads to acquire a lock before adding
an object reference to the list.

I wouldn't keep the list in Application state, as this only adds to
additional locks (Application Get and Set use a reader / writer lock).
Instead, I'd keep it encapsulated away as a static field inside of a
class devoted to managing these impressions.

One way to kick off a background thread periodically is to start a
System.Threading.Timer in Application_OnStart in global.asax. The
timer will periodically "fire" at an interval you define call a method
on thread from the thread pool.

Last bit of advice:

Design everything so that the final implementation is hidden. Abstract
everything so that you can easily switch from non-cached impressions
to cached impressions to whatever else might fit the best. Then start
with the simple case where the impression is not stored in a list at
all but sent directly to the database. From there, do some stress
testing and make some improvements to meet the performance goals. With
some up front planning you'll be able to devise an interface where
switching to using a collection and a periodical background thread
won't require any changes in the application code. In other words,
start simple but design for flexibility.

Make any sense?

HTH,

--
Scott
http://www.OdeToCode.com
On Mon, 21 Jun 2004 10:55:30 -0500, "Arsen V."
<ar****************@emergency24.com> wrote:
Hello,

Did anyone have some experience with the following:

1) Need to track high volume of impressions - 20,000,000+ per day
2) Backend is SQL Server 2000
3) Webfarm of IIS with ASP.NET
4) Need to track the data as follows:
DATE, TIME (resolution should be 1 hour), ID, NUMBER OF IMPRESSIONS, SOME
OTHER COUNTS
05/01/2004, 13:00, 123adfc1234, 34567, ...
05/01/2004, 13:00, 444adfc1234, 567, ...
05/01/2004, 13:00, 222adfc1234, 67, ...
05/01/2004, 14:00, 123adfc1234, 32012, ...
...

I want to avoid hitting the database as much as possible. I would like to
accumulate the summary data somewhere else and only hit the database every
few minutes.

If I use an in-memory DataTable on the webfarm, I am worried about threads
locking each other when updating it.

I am thinking I need some kind of an shared MemoryStream which will server
as a buffer with minimal locking. This buffer would be used by a background
thread (how to PROPERTLY do this in ASP.NET?) to generate the DataTable
which will be kept in Application scope. Once every X minutes that DataTable
would be committed to backend SQL server.

While the background thread processes the MemoryStream a new one would need
to be immediatelly available to the tracking web servers.

Another solution I was thinking about was TCP/IP Remoting or even stateless
UDP packets sent to a central server that would be listening for them and
updating an DataTable object. However, I am worried that all those requests
will be too much for a DataTable object to process.

Thanks in advance,
Arsen


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Irmen de Jong | last post by:
Hi, Things like Twisted, medusa, etc.... that claim to be able to support hundreds of concurrent connections because of the async I/O framework they're based on.... can someone give a few...
4
by: YeeCN | last post by:
Hi, I need to write an application that requires HUGH volume of number crunching (tens of billions of calculations). Speed is the single most important factor for me. I am wondering is .NET...
3
by: etienno | last post by:
Hi, what would be the best way to transfert high volume data (100 tables, 500Meg each) between DB2/AS400 to Sybase? Thanks Etienne. Montreal
2
by: Arsen V. | last post by:
Hello, Did anyone have some experience with the following: 1) Need to track high volume of impressions - 20,000,000+ per day 2) Backend is SQL Server 2000 3) Webfarm of IIS with ASP.NET 4)...
1
by: Muddassir | last post by:
hi everybody I am writing an application for tracking files and directory changes I used FindFirstChangeNotification FindNextChangeNotification FindCloseChangeNotification...
5
by: Ron Mexico | last post by:
I have written a graphing engine (very similar to what BigCharts.com offers). Basically, it's an ASPX page that accepts parameters and calls back-end business objects (dlls) to create a graph. ...
0
by: mwhalber | last post by:
Hi, I am developing an application which highlights changes in streaming data (i.e. market changes.) I have developed this initially using the BackColor and ForeColor settings on the relevant...
1
by: Tommaso Caldarola | last post by:
I need to transfer big files (up to 10 Gb), now I'm using IIS via Remoting with chunk of bytes (up to 500Kb). In the following article: Middle-Tier Hosting: Enterprise Services, IIS, DCOM, Web...
2
by: =?Utf-8?B?RGFtZW9u?= | last post by:
Hi - I am attempting to write lines to a file at high volume, multiple threads. Here is my scenario: (initial "WriteToFile" object created via a parent multithreaded process, which receives...
1
by: Ted | last post by:
I have cross posted this to comp.lang.c++ and to sci.math.num- analysis in the belief that the topic is of interest to some in both groups. I am building my toolkit, in support of my efforts in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.