![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jan 2006
Posts: 2
Rep Power: 0
![]() |
VB.net SQL query load time
I have an VB.NET web app which performs a fairly complicated SQL query. It seems in the morning, the 1st time the page is loaded (and query executed) it takes up to 10-15 seconds to complete loading. Sometimes it even times out. However anytime after that, the page loads up (even from another computer) in about 4-5 seconds. Can someone explain the reason for this and how I might fix the load times in the morning?
Thanks |
|
|
|
|
|
#2 |
|
Programming Guru
![]() ![]() ![]() |
Is this a multi-user server, or just your workstation? Check the time that your program executes against any running services / processes that may be executing at the same time that could cause an increased load on the system.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() |
you could always turn up your timeout directive for scripts, untill you figure out what's doing it.
Like IR said, are you doing virus scans/backups/anything like that at the time you are trying to run the script...because if your box doesn't have enough cpu to go around it will be quite noticable.
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
what type of database are you using? is it on a server? do you reboot it in the morning or at night?
Sounds to me like the problem is at your database, not your code. I believe that when a database first does a query it indexes its stuff, making it faster for future queries of the same type. maybe that's what's going on when you first run it in the morning.
__________________
I have never let my schooling interfere with my education. -Mark Twain- Xbox live gamertag: melbolt |
|
|
|
|
|
#5 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
In addition to all the above, most modern operating systems use file cache. In the absence of steep competition, any file, once accessed, if not overly huge, will be much faster to access on subsequent uses. Disk access is twelvdy-four jillion times slower than memory access, thus the cache approach.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|