Solved

My Program Performance

Posted on 2014-02-17
2
281 Views
Last Modified: 2014-02-20
I'm looking for some suggestions to help me fix my problem.

I'm using Visual Studio 2010 SP1, C++ MFC code.

I have a program that makes hundreds of TCP/IP connections per second. The connections stay active for 1-4 seconds each and then are disconnected. On Windows Server 2003 the program can successfully handle around 300 connections/second.

I then tried to run the same program on a newer server (more CPUs, more memory, more horsepower) running Windows Server 2008. The program runs, but the main window (which displays the statistics for each connection) no longer updates. If I slow the rate down to under 50 connections/second then the display will update.

A little about the program design for the statistics display... Internally there is a std::map "qDA" that keeps track of everything going on with each connection. It is preloaded to 10,000 entries. Every second a timer hits that cycles through all 10,000 entries and counts up the statistics. It then updates screen values and finally does an UpdateData(FALSE) to show them on the main window.

I know that doesn't sound efficient, and I agree. Once I started getting display issues, I changed the design and took out the part where all 10,000 connections are cycled through and went to a PostMessage() design where only the connections that have changed state will be counted. Essentially this means that instead of 10,000 connections being cycled through each second, only 300 are (when running at 300 connections/second). Unfortunately, this didn't fix the problem.

What I'm looking for are ways that I can determine where my bottleneck is. I'm also interested in ideas on why my program runs fine on Windows Server 2003 but not on Windows Server 2008 (or Windows Server 2012, I tried that too).
0
Comment
Question by:goondoo27
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 39865308
>>What I'm looking for are ways that I can determine where my bottleneck is.

First of all: Have you tried running your code under the VS Profiler? This will usually give you a good indication where to look first.
0
 

Author Closing Comment

by:goondoo27
ID: 39873668
I had to upgrade to Visual Studio 2010 Premium and SP1. That was much more painful than it should have been. But it's now upgraded and I've run the VS Profiler. It pointed to a section of code that wasn't actually the problem. In the meantime, I did some theorizing and realized that I was doing a PostMessage() to the display thread when I didn't have to. It was happening two times the rate that I was running the program at. I changed the design and now it's working much much better.

Thank you for replying to me. Though the VS Profiler didn't fix my issue this time, I now have another tool to help me through these types of problems.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
A while back when OPSMGR 2012 was released we were very excited about getting it into our environment and upgrading our 2007 implementation,  we started our planning and we then proceeded with our implementation. All went as planned & our system …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

911 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