peturba
3rd November 2008, 17:12
This function (renice) (http://www.baanboard.com/baanboard/showpost.php?p=126653&postcount=33) takes the process ID number and a new "nice value" (or basis priority). It changes the process's nice value to the new given value.

Interesting. So is it possible to change the priority of a process? But how to determine the proper process id (PID) during execution of the object?

Regs

pet

george7a
3rd November 2008, 17:20
Hi,

I have moved your question to a new thread.

The process id of the current running script is stored in the predefined variable called "pid".

To know other PIDs you will have to use the pstat() function (http://www.baanboard.com/programmers_manual_baanerp_help_functions_processes_pstat).

I hope it helps,

- George

peturba
4th November 2008, 09:44
Excellent, I'll discuss this with our programmer who's looking for a possibility to speed up a selfmade session.

Thx

pet

george7a
4th November 2008, 09:52
To speed up a session you better take a look at the code and check where you can change it so it will be more efficient.

You might be interested to check the performance DLL thread (http://www.baanboard.com/baanboard/showthread.php?t=28569)

- George

peturba
4th November 2008, 13:11
Yes. I think it'll be necessary. Our programmer tested the "renice" function and it seems that the priority is being controlled by the OS (Solaris 9), no matter what priority is given to the PID of the executed session...

Regs

pet

george7a
4th November 2008, 13:34
The renice changes the priority of the wanted (sub) process in the client connection and does not the priority of the whole bshell process on the server side.

You can see the nice value when you go to the shell, type "ps" and check the NI column. I have tested before and it does work, here is a screen shot of the test (attached).

The renice function does the same as in the attachment, but from within the script. It is tested in Baan IV, and it works.

I hope this explains it.

- George

peturba
4th November 2008, 14:24
Yes. It works, but the command prstat on Unix still shows that the process has a nice value of '0'. So can it be understood as changing the priority of the running bshell processes only - what does not affect the execution of processes on the server?

Greets

pet

george7a
4th November 2008, 15:12
Description of prstat:
The prstat utility iteratively examines all active processes
on the system and reports statistics based on the selected
output mode and sort order. prstat provides options to exam-
ine only processes matching specified PIDs, UIDs, CPU IDs,
and processor set IDs.

"renice" changes the priority of the sub process that is in the client. one bshell process can have many sub processes on the client. Check the attachment that I have posted before, all these active processes on the client are 1 process on the server.

The predefined variable "pid" gives you the client process ID, if you want the bshell's PID you can use the bshell.pid function (http://www.baanboard.com/programmers_manual_baanerp_help_functions_processes_bshell_pid).

renice function does not change the priority of the bshell process (at operating system level), it changes the priority of the client's sub process.

- George

peturba
4th November 2008, 15:46
Thanks for the detailed explanation. In the shell only the processes can be displayed of the currently logged in user. Is there a possibility to show the processes belonging to all users? When you say "it changes the priority of the client's sub process" does it mean that the changes doesn't affect the bshell processes of the other users? Thus, it would only be helpful if one starts several sessions and wants to priorize which of the sessions should run faster... I even don't know how this is possible because normally starting processes through sessions avoids the execution of other processes until the one process has ended.

Regs

pet

george7a
4th November 2008, 16:09
When you say "it changes the priority of the client's sub process" does it mean that the changes doesn't affect the bshell processes of the other users? Thus, it would only be helpful if one starts several sessions and wants to priorize which of the sessions should run faster

As I understand, it should be helpful to prioritize a specific session from the others. I am not sure how will this affect the bshell server process.

I even don't know how this is possible because normally starting processes through sessions avoids the execution of other processes until the one process has ended For example if you are printing a large item report from item data and in the same you are printing a large customer report. You can prioritize the item report.

Is there a possibility to show the processes belonging to all users?
The bshcmd6.1 command can be used to do so. There is an example for it here:
http://www.baanboard.com/baanboard/showpost.php?p=106192&postcount=3

- George

Hitesh Shah
4th November 2008, 16:59
I think renice is also valid command for solaris . U can change the priority from 0 to 19 (19 being the least) for very heavy processes in prstat -a . Just check the man pages for the same.

peturba
4th November 2008, 17:39
Thanks. Maybe trying the performance dll will be the best choice...

Greets

Pet