Solved

Reduce CPU Utilization

Posted on 2011-09-13
10
612 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

13 Experts available now in Live!

Get 1:1 Help Now