Solved

Reduce CPU Utilization

Posted on 2011-09-13
10
614 Views
Last Modified: 2013-11-27
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
0
Comment
Question by:mivbinfotech
10 Comments
 
LVL 22

Expert Comment

by:eeRoot
ID: 36529248
Is the app multi-threaded or able to make use of multiple CPU cores?  Is it a 32 bit or 64 bit app?  Is the app set up so you can throttle the number of files being processed simultaneously?  There are several options for debugging and tracing through code, I couldn't say which one would be the most useful to you, it depends on how you've structured the code.

http://stackoverflow.com/questions/27610/how-to-add-simple-tracing-in-c
0
 
LVL 15

Expert Comment

by:x77
ID: 36530474
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).
0
 
LVL 16

Expert Comment

by:SteveJ
ID: 36552550
If you are using a Gb NIC and putting lots of data on the wire you will drive CPU high.
0
 
LVL 2

Accepted Solution

by:
mivbinfotech earned 0 total points
ID: 37249654
what we did is we separated the SFTP processes and others, so SFTP works only when transferring files and the other relevant processes are separate,    

we have managed to cut CPU time by almost half
0
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 
LVL 21

Expert Comment

by:mastoo
ID: 37250354
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.
0
 
LVL 2

Author Closing Comment

by:mivbinfotech
ID: 37290363
solved
0
 
LVL 2

Author Comment

by:mivbinfotech
ID: 37268676
solved
0
 
LVL 16

Expert Comment

by:SteveJ
ID: 37269850
If someone helped, give them points.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now