User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 373,101 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,743 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 267 | Replies: 4
Reply
Join Date: Sep 2007
Posts: 1,054
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Storing Views and File information

  #1  
Mar 17th, 2008
I was wondering, I am doing my best to eliminate a lot of Database queries that are unneeded in order to increase performance. However, this is a tough task as each solution has its own drawback which I then have to compare to see which ones would be better performers, under which circumstances.

Without getting this too complex, I will let you know what I am asking.

I was wondering which would be more costly in terms of CPU usage, resources taken, etc. All in efforts to increase the amount of requests the server can take at a time, and to decrease the amount of time it takes to process each request.

Currently I am logging each view into a database. This means that if I have 20,000 views in that day over so many different files, that's 20,000 queries to the database to change the amount of "views". This I am reconstructing.

What I am planning on doing is putting the views in an xml file along with all information regarding that file. Along with this, views need to be updated in the database as well, lets say every 2 - 4 hours, depending on the time and load of the server at the time.

I will be logging each view on each category on each file. This means that I have roughly 82,000 files that are being viewed. I need to log the amount of views that each file takes within a 2-4 hour period. Every 2-4 hours, the file is put into an archive, and a new one is created with a value of zero.

So here are the options, and please let me know what you think of each:
1. I can update the xml file, along with a txt file that just includes the amount of views. At the interval times, the txt file can be read, and the value can be inserted into the corresponding record in the database. The bonus of this option is that the xml file will be read and bound to the page. After this has happened, a request will be made with certain information to a page that will update the xml file and the txt file behind the scenes. This means only one file is used to read from for each user.

2. I can have the database tapped for views, which will update the views at the same time. This means less server load, but is are pointless database taps.

3. I can store all views in a certain xml file, read through, retrieve the value, display it, update the file with the new views. The problem I see with this one is that every user then uses two files for some information. However, I can quickly upload the entire file to the database for quick updating. (This might be better as it will take less time on the database server than the others).
Thank you for any help. You can offer other suggestions as well. I gotta run, so I am cutting this short. Thanks again!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Posts: 1,054
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Storing Views and File information

  #2  
Mar 18th, 2008
In case any of you are wondering, I will be updating only the files that have been accessed within that time period. This will be done by another file, most likely txt, but possibly xml. This file will contain the name and location of the file. Then, when the time comes to upload, it will read through the file, line by line, and substitute in the filename and location to further commands, which will update the according file to the database.
Reply With Quote  
Join Date: Sep 2007
Posts: 1,054
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Storing Views and File information

  #3  
Mar 18th, 2008
I think I will just update the xml file and the txt file. Then when the time comes, I will read the information from the text file (which are just views), and add them to the database. An example of this would be:

txt file:
117

UPDATE tblname SET views=views+@views WHERE rowid=@id

Any suggestions are still welcome! Thank you.
Reply With Quote  
Join Date: Aug 2005
Location: Ohio
Posts: 204
Reputation: plazmo is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 16
plazmo's Avatar
plazmo plazmo is offline Offline
Posting Whiz in Training

Re: Storing Views and File information

  #4  
Mar 18th, 2008
What are you logging in the database, is it just page views?
If so just turn on IIS logging and download IIS Log Parser http://www.logparser.com

You can query the log parser and make it update a log table. Just have a scheduled task run the update once a day.
Reply With Quote  
Join Date: Sep 2007
Posts: 1,054
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Storing Views and File information

  #5  
Mar 18th, 2008
I'll look into it. Currently the server is on a host where I cannot manage any settings on the SQL server, so I am not sure if that will work.

In about 4 months I will be moving it to a highly secured and private server, where I have control, completely, and just pay for the bandwidth and equipment rental.

But until then, I'll have to improvise. But I will keep this in my future enhancements file

Thank you.
I answer pm's.
I answer questions.
I answer quickly.
I answer.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP.NET Marketplace
Thread Tools Display Modes

Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 5:12 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC