mivbinfotech
asked on
Reduce CPU Utilization
Dear EE Members
We developed project in Visual Studio 2010 C#.net, to download and upload the thousand files through sftp and update the log the with file name, time stamp and path details for every file in the SQL 2005 database. we are using three timers first one for upload process file, second one for download the process file and third one for download the log file, each timer will access the SQL Database when sending and receiving the file. During this all process CPU Utilization is going more then 80%. How we can reduce this CPU Utilization.
Thanks
We developed project in Visual Studio 2010 C#.net, to download and upload the thousand files through sftp and update the log the with file name, time stamp and path details for every file in the SQL 2005 database. we are using three timers first one for upload process file, second one for download the process file and third one for download the log file, each timer will access the SQL Database when sending and receiving the file. During this all process CPU Utilization is going more then 80%. How we can reduce this CPU Utilization.
Thanks
There are a lot of component that can waste CPU on your process.
- Sftp - What is your Provider ?
- Update database only 1 time per file ?
- Have you any method to query remote Directory ?
. Net 2.0 includes a class to transfer files over Ftp.
It supports also listfiles on remote directory, but when you need also exact dates and sizes it is a bad option (WebRequestMethods.Ftp.GetFileSize and WebRequestMethods.Ftp.GetDateTimestamp very slow).
- Sftp - What is your Provider ?
- Update database only 1 time per file ?
- Have you any method to query remote Directory ?
. Net 2.0 includes a class to transfer files over Ftp.
It supports also listfiles on remote directory, but when you need also exact dates and sizes it is a bad option (WebRequestMethods.Ftp.GetFileSize and WebRequestMethods.Ftp.GetDateTimestamp very slow).
If you are using a Gb NIC and putting lots of data on the wire you will drive CPU high.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Follow eeRoot's link or buy a code profiler to get a breakout of where your code spends the most time, rather than even educated guesses. And I'll add to the guesses that it could be context switching if you have too many threads, or if sql is local it could be the sql.
ASKER
solved
ASKER
solved
If someone helped, give them points.
http://stackoverflow.com/questions/27610/how-to-add-simple-tracing-in-c