Date:  10/17/2003 03:57:38 PM Msg ID:  001690
From:  Randy Petty Thread:  001670
Subject:  Re: sys(3050) with 2GB RAM
Is       =SYS(3050, 1, VAL(SYS(3050, 1)) / fwConfig.TotalChannels)
hard-coded into Foxweb? Is it configurable in 1.29C??
 
 
FoxWeb uses the following code to set the buffer size during startup:
 
=SYS(3050, 1, VAL(SYS(3050, 1)) / fwConfig.TotalChannels)
Essentially, what this does is it devides the default buffer size value by the total number of channels about to be started.
 
 
Below is a very informative response from the Foxite.com forum:
 

SYS(3050) deals with data buffers, not application memory.  VFP uses about 17mb of memory for itself.  When you run more than one instance of VFP the total application memory does not increase, just the instance count on the dll.  Each instance of the application does, however, have its own data memory space and it's that that's controlled by SYS(3050), not the basic application memory although all of these things compete for the memory that's available in the pot. 

 

Your problems do not sound like performance problems, but rather memory corruption problems.  It would be best if you could allocate memory so that nobody ever steps on someone else's memory and forces it out to virtual memory on disk which is where both system slowdown and corruption occur. 

 

The primary VFP application needs memory to run the queries and serve up the information to the Foxweb processes that are going to build the pages.  It should have sufficient memory to handle that task in both the foreground and background modes.  The Foxweb applications do not need much at all in the way of data buffers (which cover both data and variable memory) as they are not going after data at all, but rather massaging a relatively small set of data to make a presentation page to serve to the client application. It would be best if each process had the "sweet spot" amount of memory and that the total memory usage for all the processes were less than the total physical memory available on the machine for application usage.

 

Let's take your example of a single box running advanced server 2000 with two processors and 2 gb of memory.  I think that the Operating system will take the same amount of memory for a one and a two processor box.  This is actually easy to check.  Just do a "? sys(3050,1) in VFP and you will get the answer.  The default return for this is all memory on the machine not reserved for the OS.  It should give you a value of about 1.35gb of memory available for application use. 

 

The question then is, how do you best use that memory?  Let's start first with the core data server VFP application that's doing the data work.  You are right when you say that, beyond a certain point, incremental memory is of very little, if any value.  0.5gb is more than enough for almost everything that I've tested.  In fact, 256mb is almost as good as a half gig.  Let's stay with the half gig for the moment though.  You should explicitly issue this command with that amount of memory for both foreground (sys(3050,1,x) and background (sys(3050,2,x) processing.  (The default for background is only a quarter of the default foreground and this can cause some problems as things switch in and out of physical memory.  Remember, the goal is to set up the box so that we can have a static physical memory allocation and stay away from the dreaded VM.) 

 

Having taken out the 0.5gb for the basic VFP process we are no left with the foxweb processes.  You have six to eight instances running.  Let's just say ten to be on the safe side.  You have 0.86gb left after making the prime data server process allocation.  Ten processes gives you about 90 megs for each process.  Even assuming that each Foxweb instance takes it's own memory (on this I'm not sure but let's assume that to be on the safe side), this still leaves available for data for each of ten instances of Foxweb.  Again, to be on the safe side, I would limit each of the Foxweb processes using sys(3050,1) and sys(3050,2) to 64mb of memory each.  This leaves about 100mb of "safety" space for things like IIS and other small processes.  If you still have some problems, you can reduce the Foxweb processes to 48mb easily and probably not suffer any performance penalty at all.  Again, their work is not data table intensive, only the data server's work is. 

 

 

Malcolm Rubel

Director of Sales and Marketing

EPS Software Corp.

13810 Champion Forest Drive

Houston, TX 77069

mac@eps-software.com

www.eps-cs.com

917.226.4515

 

 

Sent by Randy Petty on 10/16/2003 07:01:40 AM:
Thanks for your response.  To take this a little further.  Our main "problem" server at the moment has only 1/2 GB Ram and runs one client.  Foxweb, IIS and the VFP 6 database are all one this one win2k server dedicated to this one client.  We won't be able to change our table layouts much in the short run.  The primary data table, admittedly poorly designed, has a record length of over 1900 characters with 800,000 records.  About 1.1 GB on disk. It also has over 40 indexes.
 
This is a poweredge DEll 4600 with 2 CPUs running around 2MHz.  Despite my urging we are still running 8 foxweb channels on foxweb 1.29C.   In task manager I see, at most, a foxweb channel using about 15MB of ram.   If you open VFP and check  sys(3050,1)  you get 342MB  available.  sys(3050,2) reports about 85MB available.
 
That brings up another point, would foxweb normally be operating in the foreground or background?  Don't see any buffering check box in this version of Foxweb.  We will probably be on sql server within 12-18 months but would really like to improve performance in the mean time.
 
From what you said below, is the foxweb startup buffer size limiting our foxweb channels to only around
15mb of ram?
 
Randy Petty
Sent by FoxWeb Support on 10/13/2003 10:23:55 AM:
I have never heard of VFP stability issues related to having too much physical memory in the system.  In fact, we have used VFP on servers with 2GB with no problems whatsoever.
 
FoxWeb uses the following code to set the buffer size during startup:
 
=SYS(3050, 1, VAL(SYS(3050, 1)) / fwConfig.TotalChannels)
Essentially, what this does is it devides the default buffer size value by the total number of channels about to be started.

FoxWeb Support Team
support@foxweb.com email

Sent by Randy Petty on 10/11/2003 12:16:51 PM:
 
We're still using VFP 6, both on Windows NT and Windows 2000 Advanced Server. After two of our production servers were upgraded to 2 GB Ram ( most have 1/2 GB) , some developers decided it was wise to add a call to sys(3050,1,600000000)
in some of our primary programs.

Generally the only thing running on our production servers is FoxWeb 1.29c which links the customer on the browser to the FoxPro data on the back end. ( typically about 5 Foxweb channels ) Why would we want to limit the amount of RAM Foxpro can use, especially when some of the tables are over 1GB in size? Some felt that FoxPro would crash without that sys command, and that VFP 6 was never designed to make use of that much RAM. If so, why buy the additional RAM?

Randy Petty