On Feb 6, 2018, at 2:00 PM, Miguel Gonzalez wrote:

> Is there a way to make the processes running in 4D Server not taking
> too much resources?
> I know that this is for the processes to finish quickly when send to the 
> server.
> 
> My problem is that this behaviour reduce notably the performance on
> the 4D clients.
> Is there some 4D parameter that it gives more priority to the clients
> than the server.
> 
> We are using 4D Server v12.6 and the OS is windows server 2008 R2


So I am assuming you are talking about “Stored Procedures” running on 4D 
Server. Yes, you can slow them down and reduce the load on 4D Server. We call 
it “throttling”. (Remove foot from the throttle pedal.)

To do this, add DELAY PROCESS(Current process;$delayTicks_l) in different 
places. This will cause the process to pause for a short time and take zero 
server CPU resources. Then it wakes up and resumes execution. 

The value of $delayTicks_l can be set to 1 so it is delayed for only 1/60 of a 
second. Or can be set to a higher value. You have to decide how slow you want 
things to run.

Usually Stored Procedures that hog the CPU are looping through records or doing 
some repetitive task. So put DELAY PROCESS in the loop so that it does one 
iteration of the loop, pause for a short time and then resume.

Example:

For ($i;1;Records in selection([table]))
   [table]field:=DoSomething
   SAVE RECORD([table])
   NEXT RECORD([table])
   DELAY PROCESS(Current process;2)
End for

Tim
        
Tim Nevels 
[email protected] <mailto:[email protected]>
Innovative Solutions
785-749-3444



**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to