Solved

Reduce CPU Utilization

Posted on 2011-09-13
10
618 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 
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
 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Stack 2x HP ProCurve 5406zl Switches 9 56
array not updating 8 43
Easiest intro into .NET CORE? 2 34
Sonicpoint ACi and PoE switch 3 7
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

710 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