Mitchman10


We have a non-programmer... a statistician in our office. He has written a data munching program in foxpro. The data resides on a file server.

I have never seen this, but his program causes CPU Utilization to go over 70% on this server. It dose lots of scans, calculating, and then lots of ole automation to populate word docs, excel docs, and create pdf.

Any thoughts on tips or tricks to reduce CPU utilization

Anyone know a way to limit how much of the server CPU a speciific user is allowed to use

This is a wierd one i know.. but he made the server crash three times yesterday!

Thanks




Re: Foxpro Code crashing windows 2003 server

Naomi Nosonovsky


Check the following links:

http://www.news2news.com/vfp/ function=263

http://www.news2news.com/vfp/ function=701

http://fox.wikis.com/wc.dll Wiki~MemoryManagement

And this thread in UT http://www.universalthread.com/wconnect/wc.dll 2,15,881972

(I now will quote the answer by Sergey Berezniker from this thread):

It's known that Visual FoxPro has sometimes that problem on PC's with 1Gb memory or more and limiting the buffer size fixes it. You can try to limit the size of Visual FoxPro buffers.

SYS(3050, 1, 512*1024*1024)
SYS(3050, 2, 512*1024*1024)

Also try to call SYS(1104) after command that process large tables. It clears memory cache and buffers.

=================================================================================






Re: Foxpro Code crashing windows 2003 server

Mitchman10

Naomi

Thanks for your answer. That is some great stuff you gave me.

I still remain confused. The tips you gave me are great for memory management, but I do not understand how these steps would alleviate CPU Utilization on the file server.

A client opens a file, say it is t:\data\myfile. T is a mapped network drive on the server. I run a replace all statement on it. Now what I think I have learned from remote desktop is that internally VFP sends the entire data file down to the local client to do this work. What we have found is our remote users must use remote desktop to control an in-house machine... but since VFP is not client server it is too slow any other way.

Now since I thought all the work was being done on the client machine I am very confused as to why the data munching is causing the SERVER to have high CPU Utilization.

Is this a config.fpw issue Is there something I need there to tell the server to make the work area be on the local C drive

Mitch






Re: Foxpro Code crashing windows 2003 server

Naomi Nosonovsky

Regarding your last question, yes, put TMPFILES = c:\MyTempDir into config.fpw (Check

Special Terms for Configuration Files)

As far as where replace happens - on the client or on the server I'm not sure 100% myself. I think this may depend on various factors.





Re: Foxpro Code crashing windows 2003 server

AndyKr

>>Now since I thought all the work was being done on the client machine I am very confused as to why the data munching is causing the SERVER to have high CPU Utilization.

It depends on the setting of the temporary files location - if this is on the server all VFP intermediate files (cursors and temporary table) for ALL users will be created on the server. This would explain why your server is having high CPU utilization. By setting the temporary file location to the user's workstation (see Config Terms) you not only remove the load from the server, but you will also speed things up dramatically (local writes are much faster than network writes).