在这篇博客中,我将讨论如何确定是否启动了足够多的osl_server_processes;在未来的博客中讨论如何确定max_open_servers的值是否正确。
OSL服务器的数量是影响使用OSL的应用程序性能的主要因素!
有足够的osl_server进程运行是什么意思?这意味着当一个事务从另一个模块或系统中到达时,总有一个osl_server是空闲的,可以用来处理该事务。这意味着永远不会出现所有的osl_server进程都在处理事务的情况。
osl_server进程的调度方式是后进先出,所以最后一个完成事务的osl_server进程就是下一个调度的进程。这意味着最早的time_last_run是所有服务器同时忙碌的最后一次。如果时间是在最近一两天,你可能需要更多的服务器。如果时间是在系统启动的时候,你可能不需要。中间的任何时间都要根据时间的久远程度以及你是否能忍受OSL时不时的慢速来判断。图1显示了显示几个osl_server进程的time_last_run所需的命令。
as:process -process_name osl_server1; match time_last_run; dump_pte。
使用非运行中的进程。
当前进程为52,第8D82E500步,Overseer.System (osl_server1)
在8D82E500处的PTE为Overseer.System(osl_server1)。
time_last_run: 00000000 01834C2E(09-07-20 15:36:51.31266)
as:process -process_name osl_server2; match time_last_run; dump_pte。
使用非运行中的进程。
当前进程为53,第8D872000步,Overseer.System (osl_server2)
在8D872000处的PTE为Overseer.System(osl_server2)
time_last_run: 00000002 462972DC(09-07-22 08:54:17.46376)
as:process -process_name osl_server3; match time_last_run; dump_pte。
使用非运行中的进程。
当前进程是54,第8D874000步,Overseer.System (osl_server3)
在8D874000处的PTE为Overseer.System(osl_server3)
time_last_run: 00000000 0183947E(09-07-20 15:36:51.59513)
.. . .
作为:进程 -process_name osl_server6; match time_last_run; dump_pte
使用非运行中的进程。
当前进程为57,第8D87B440步,Overseer.System (osl_server6)
在8D87B440处的PTE为Overseer.System(osl_server6)。
time_last_run: 00000000 01DBF96A(09-07-20 15:38:19.98936)
作为:
|
图1 - 显示time_last_run的时间 |
本帖最后的宏osl_server_times.cm创建了一个名为osl_server_times.(date)的文件,里面有一个排序的time_last_run时间列表。它还会在终端窗口中显示该文件。它假设osl_server进程的名字是osl_serverN。如果不是,你可以提供自己的基本名称。它假设所有的进程都有一个共同的基本名称,这就是它所匹配的。第一次列出的时间是所有服务器同时运行的最后时间。 登录时间告诉你进程是什么时候启动的,通常它们也会在同一时间启动,也就是系统启动的时间。
例1显示了一个有6个osl_server进程运行的模块。这6个进程在系统启动后都有一些使用,但根据最后的运行时间,可能与启动时的恢复有关。在系统启动后的两天时间里,只有两个进程被使用过。除非系统启动并准备好处理新的事务所需的时间有问题,否则我不会给这个模块添加更多的进程。
osl_server_times.cm 于 09-07-22.15:27:10 在 %phx_vos#m16 上运行。
time_last_run CPU登录时间进程
名号
09-07-20 15:36:51.31266 / 0.87 / 09-07-20 15:33:49 / osl_server1 / 52
09-07-20 15:36:51.31484 / 1.32 / 09-07-20 15:33:50 / osl_server5 / 56
09-07-20 15:36:51.59513 / 0.81 / 09-07-20 15:33:49 / osl_server3 / 54
09-07-20 15:38:19.98936 / 2.51 / 09-07-20 15:33:50 / osl_server6 / 57
09-07-22 08:54:17.46376 / 1.59 / 09-07-20 15:33:49 / osl_server2 / 53
09-07-22 15:26:35.14511 / 2.77 / 09-07-20 15:33:49 / OSL_server4 / 55
|
例1 - 所有进程都有一些CPU时间,但不需要增加更多的时间。 |
在例子 2 中,模块运行了 40 个 osl_server 进程。13个进程在7个月前模块启动后就没有再运行过,所以它们也有很多进程在运行。
osl_server_times.cm 在 %XXXXX#m1 上运行,时间为 11-03-21.15:33:01。
time_last_run CPU登录时间进程
名号
10-08-01 07:45:02.68817 / 0.02 / 10-08-01 07:45:02 / osl_server1 / 84
10-08-01 07:45:06.45556 / 0.00 / 10-08-01 07:45:06 / osl_server2 / 85
10-08-01 07:45:10.47752 / 0.00 / 10-08-01 07:45:10 / osl_server3 / 86
10-08-01 07:45:14.51074 / 0.00 / 10-08-01 07:45:14 / osl_server4 / 87
10-08-01 07:45:18.53199 / 0.00 / 10-08-01 07:45:18 / osl_server5 / 89
10-08-01 07:45:22.62286 / 0.01 / 10-08-01 07:45:22 / osl_server6 / 92
10-08-01 07:45:26.67370 / 0.01 / 10-08-01 07:45:26 / osl_server7 / 93。
10-08-01 07:45:30.70518 / 0.00 / 10-08-01 07:45:30 / osl_server8 / 94。
10-08-01 07:45:38.26467 / 0.02 / 10-08-01 07:45:34 / osl_server9 / 95。
10-08-01 07:45:38.77099 / 0.01 / 10-08-01 07:45:38 / osl_server10 / 96。
10-08-01 07:45:42.80245 / 0.01 / 10-08-01 07:45:42 / osl_server11 / 97。
10-08-01 07:45:46.82534 / 0.00 / 10-08-01 07:45:46 / osl_server12 / 98。
10-08-01 07:45:50.85063 / 0.00 / 10-08-01 07:45:50 / osl_server13 / 99。
11-03-18 14:33:15.59938 / 9514.24 / 10-08-01 07:46:15 / osl_server19 / 105
11-03-18 14:43:22.17904 / 30208.59 / 10-08-01 07:46:19 / osl_server20 / 106
11-03-18 14:45:00.93608 / 19494.54 / 10-08-01 07:45:58 / osl_server15 / 101
11-03-18 19:29:54.04067 / 37248.83 / 10-08-01 07:46:55 / osl_server25 / 111
11-03-20 00:19:10.75480 / 28961.64 / 10-08-01 07:46:10 / osl_server18 / 104
11-03-20 04:13:02.01803 / 667.23 / 10-08-01 07:45:54 / osl_server14 / 100
11-03-20 07:51:16.66950 / 40151.59 / 10-08-01 07:46:51 / osl_server24 / 110
11-03-20 08:10:21.71397 / 16944.88 / 10-08-01 07:46:02 / osl_server16 / 102
11-03-20 08:12:03.16114 / 39066.37 / 10-08-01 07:46:23 / osl_server21 / 107.
11-03-20 08:12:56.92729 / 37474.92 / 10-08-01 07:46:31 / osl_server23 / 109
11-03-20 08:12:56.94239 / 6425.76 / 10-08-01 07:46:06 / osl_server17 / 103
11-03-20 08:12:59.07991 / 33316.21 / 10-08-01 07:46:27 / osl_server22 / 108
11-03-20 08:13:03.05792 / 0.02 / 11-03-20 08:12:59 / osl_server26 / 2317
11-03-20 08:13:16.25518 / 0.02 / 11-03-20 08:13:06 / osl_server28 / 2319
11-03-20 08:13:16.25527 / 0.01 / 11-03-20 08:13:03 / osl_server27 / 2318
11-03-20 08:13:21.60688 / 0.02 / 11-03-20 08:13:16 / osl_server30 / 2321
11-03-20 08:19:09.81250 / 0.15 / 11-03-20 08:13:20 / osl_server31 / 2322
11-03-20 08:50:04.73651 / 0.45 / 11-03-20 08:13:30 / osl_server33 / 2324
11-03-20 21:02:34.17459 / 68.30 / 11-03-20 08:50:49 / osl_server39 / 2406
11-03-21 15:20:20.30186 / 170.07 / 11-03-20 08:50:55 / osl_server40 / 2407
11-03-21 15:32:56.10295 / 211.96 / 11-03-20 08:50:45 / osl_server38 / 2405
11-03-21 15:32:56.10362 / 124.29 / 11-03-20 08:13:10 / osl_server29 / 2320
11-03-21 15:32:59.99746 / 202.52 / 11-03-20 08:13:24 / osl_server32 / 2323
11-03-21 15:33:01.02978 / 175.24 / 11-03-20 08:13:37 / OSL_server35 / 2326
11-03-21 15:33:01.35322 / 211.63 / 11-03-20 08:13:33 / osl_server34 / 2325
11-03-21 15:33:01.38417 / 201.76 / 11-03-20 08:50:38 / osl_server36 / 2403
11-03-21 15:33:01.46699 / 194.44 / 11-03-20 08:50:41 / osl_server37 / 2404
|
例子2 - 一些进程自启动以来没有运行过,不需要添加更多的进程。 |
最后这个例子显示了一个需要更多osl_servers的情况。该模块正在运行20台服务器,而所有20台服务器从宏运行到使用不到24小时。
osl_server_times.cm 在 %XXXXX#m11 上运行,时间为 11-03-21.15:49:03。
time_last_run CPU登录时间进程
名号
11-03-20 18:37:18.97851 / 3079.12 / 10-09-10 08:04:38 / osl_server / 56
11-03-20 18:37:18.97999 / 5044.43 / 10-09-10 08:04:37 / osl_server / 48
11-03-20 18:37:22.37568 / 2485.06 / 10-09-10 08:04:37 / osl_server / 51
11-03-20 18:37:26.99446 / 3637.60 / 10-09-10 08:04:37 / osl_server / 52
11-03-20 18:37:26.99464 / 3329.56 / 10-09-10 08:04:38 / osl_server / 62
11-03-20 18:38:04.86495 / 3556.72 / 10-09-10 08:04:37 / osl_server / 54
11-03-20 18:38:48.53218 / 2509.57 / 10-09-10 08:04:38 / OSL_server / 63
11-03-20 18:39:06.44256 / 3434.27 / 10-09-10 08:04:39 / osl_server / 67
11-03-20 18:39:06.44291 / 4478.29 / 10-09-10 08:04:38 / osl_server / 64
11-03-20 18:39:06.45211 / 2918.82 / 10-09-10 08:04:37 / osl_server / 49
11-03-20 18:39:06.45213 / 3131.79 / 10-09-10 08:04:37 / osl_server / 53
11-03-21 03:00:35.69830 / 2477.28 / 10-09-10 08:04:38 / osl_server / 58
11-03-21 03:00:35.74118 / 3411.54 / 10-09-10 08:04:38 / osl_server / 59
11-03-21 03:00:36.86657 / 3225.85 / 10-09-10 08:04:38 / osl_server / 61
11-03-21 12:14:28.10003 / 2897.49 / 10-09-10 08:04:38 / osl_server / 60
11-03-21 12:14:28.10185 / 3983.01 / 10-09-10 08:04:38 / osl_server / 57
11-03-21 15:07:43.19355 / 2736.61 / 10-09-10 08:04:37 / osl_server /50
11-03-21 15:12:11.08222 / 2892.31 / 10-09-10 08:04:38 / osl_server / 66。
11-03-21 15:12:13.61254 / 4489.65 / 10-09-10 08:04:38 / osl_server / 65
11-03-21 15:48:52.71038 / 3601.19 / 10-09-10 08:04:38 / OSL_server / 55
|
例3--需要更多服务器的案例 |
你可以通过编辑、编译和安装两个配置文件来增加(或减少)OSL服务器的数量。这些改变将在下次重启时发生。 控制 OSL 服务器数量的调整参数是 new_modules.tin 和 new_backbone_systems.tin 中的 max_open_servers 值。模块_start_up使用max_open_servers值来计算要启动的osl_server进程数量。如果模块不是桥接模块,它将启动 2 * max_open_servers;如果是桥接模块,它将启动 4 * max_open_servers。
通过在module_start_up.cm中设置ADDITIONAL_OSL_SERVERS值,你可以启动更多的OSL_server进程,而不是默认的2或4倍的max_open_servers值。你也可以直接从命令行启动更多的进程而不需要重启。start_more_osl_servers.cm 宏,也在这篇文章的结尾,让启动更多进程变得很容易。
如果你有太多的osl_server进程在运行,你可以停止它们,但是如果你真的需要它们,它们将不复存在。一般来说,运行额外的osl_server进程并不会消耗大量的资源,但是如果你想停止额外的进程,你不应该使用stop_process命令。但是如果你想停止额外的进程,你不应该使用stop_process命令。osl_server进程有一个开关,告诉它在完成当前事务后优雅地终止。这个名为stop_sw的开关是一个短项,应该设置为-1,见图2。
作为:进程 -process_name osl_server1。
使用非运行中的进程。
当前进程为52,第8D82E500步,Overseer.System (osl_server1)
as: set_word stop_sw -1
地址从到
000730F4 0000 FFFF
作为:
|
图2 - 停止OSL_server进程 |
因为只有在当前事务完成后,进程才会终止,所以应该设置在最后运行的进程中。
& osl_server_times starts here & & osl_server_times.cm & version 1.0 09-07-10 & version 1.1 09-07-17 check to make sure that the data is on the & expected line of output, if not adjust down 1 line & and correct parsing for process name & version 1.2 09-07-20 added a parameter for matching the osl_server & process name instead of assuming that the name & will be osl_server & version 1.3 10-06-23 added &echo so macro can be used as started & process. Note be sure that the name of the started & process does not match the name of the osl_server & processes or macro will abort. For example, & osl_serverN for the osl_server processes and & osl_server_times for the process running this & macro will cause the macro to abort. & version 1.4 11-03-21 cleaned up some comments prior to publication & & Noah Davids Stratus CAC [email protected] & & &begin_parameters MATCH match_name:string,required,=osl_server &end_parameters & & &echo no_input_lines no_command_lines no_macro_lines & &set_string PD (process_dir) &set_string PL &PD&>process_list &set_string LR &PD&>last_run &set_string LI &PD&>login &set_string CPU &PD&>cpu & &set_string TABLE &PD&>osl_server_times & & & Create a new file or write over an existing file attach_default_output &TABLE& detach_default_output & & &attach_input analyze_system & & & build a file containing a list of all the osl_server processes ..attach_default_output &PL& match &MATCH&; who ..detach_default_output & & & The first line has an "as: " prompt before the output which has to be & stripped. Also the process name is name is in () which gives the & command processor problems since it thinks it is a command function & so translate the ()s to []. Finally translate spaces to underscores so & I don't have to keep using the quote command function. &set LINECOUNT 1 &set_string LINE &+ (ltrim (substr (translate &+ (contents &PL& &LINECOUNT& -hold) '[]' '()') 4)) &set_string LINE (translate (quote &LINE&) '_' ' ') & & & LOOP until we hit a line that is just the as: prompt &while X&LINE&X ^= Xas:X & & & The first space will delimit the process number &set I (calc (index &LINE& '_') - 1) &set PROCESS (substr &LINE& 1 &I&) & & & Look for the [] characters, everything between them is the process name &set I (calc (index &LINE& '[') + 1) &set J (calc (index &LINE& ']') - &I&) &set_string NAME (substr &LINE& &I& &J&) & & & create a temporary file and put the output of the analyze_system & request dump_pte in it. We match on time_last_run so there is only a & few lines in the output file ..attach_default_output &LR&&PROCESS& process &PROCESS& match 'time_last_run' ; dump_pte ..detach_default_output & & ..attach_default_output &LI&&PROCESS& match 'login' ; dump_pte ..detach_default_output & & ..attach_default_output &CPU&&PROCESS& match 'cpu_time:' ; dump_pte ..detach_default_output & & & The time is in line 4. Even though the time is in ()s we don't have & to translate because we are going to extract out the time before the & command processor has a chance to get confused &if (substr (contents &LR&&PROCESS& 4) 2 4) = 'time' &then &set_string LRTIME (substr (contents &LR&&PROCESS& 4) 45 23) &else &do &set_string LRTIME (substr (contents &LR&&PROCESS& 5) 45 23) ..display_line ..display_line process &PROCESS& last run shifted by 1 line &end & & & Now get the login time &if (substr (contents &LI&&PROCESS& 2) 2 5) = 'login' &then &set_string LITIME (substr (contents &LI&&PROCESS& 2) 36 17) &else &do &set_string LITIME (substr (contents &LI&&PROCESS& 3) 36 17) ..display_line ..display_line process &PROCESS& login time shifted by 1 line &end & & & Finally get the CPU time &if (substr (contents &CPU&&PROCESS& 2) 2 3) = 'cpu' &then &set_string CPUTIME (translate &+ (contents &CPU&&PROCESS& 2) '[]' '()') &else &do &set_string CPUTIME (translate &+ (contents &CPU&&PROCESS& 3) '[]' '()') ..display_line ..display_line process &PROCESS& cpu time shiffed by 1 line &end &set_string CPUTIME (translate (quote &CPUTIME&) '_' ' ') &set I (calc (index &CPUTIME& '[') + 1) &set_string CPUTIME (substr &CPUTIME& &I&) &set I (calc (index &CPUTIME& '_') - 1) &set_string CPUTIME (substr &CPUTIME& 1 &I&) & & & Now add a line to our table time - process name - process number ..attach_default_output &TABLE& -append ..display_line &LRTIME& / &CPUTIME& / &LITIME& / &NAME& / &PROCESS& ..detach_default_output & & & increment the line count, read another line from the process list and & translate the ()'s and spaces &set LINECOUNT (calc &LINECOUNT& + 1) &set_string LINE (translate (contents &PL& &LINECOUNT& -hold) '[]' '()') &set_string LINE (translate (quote &LINE&) '_' ' ') &end & & & exit analyze_system quit & & & The table has a bunch of lines that are nothing but as: prompts. The & sort -duplicate_path gets rid of all but the first as: line and also & sorts the rest of the lines so that the process last run longest ago & is first. sort &TABLE& -duplicates_path &PD&>extra & & & use line_edit to remove the as: prompt from the table and also add & column headers &set_string H &+ osl_server_times.cm run on (current_module) at (date).(time) &attach_input line_edit &TABLE& -no_keystrokes -no_backup -no_verbose insert &H& time_last_run CPU login time process name number . change * !as: ! ! * write quit &detach_input & & & copy the table out of the process_dir and into the current dir. &set_string DT (date) copy_file &TABLE& osl_server_times.&DT& -delete display_file osl_server_times.&DT& & & osl_server_times ends here |
图3 - osl_server_times.cm |
& start_more_osl_servers starts here
&
& start_more_osl_servers.cm
& version 1.0 09-07-21
&
& Noah Davids Stratus CAC [email protected]
&
&
&begin_parameters
BASE base_name:string,required,=osl_server
START starting_index:number,required
END ending_index:number,required
&end_parameters
&
&
& ********** If this is a bridge module, the -super switch should be
& ********** given to each osl_server process.
& ********** Redirect the output of the osl_admin request to a temp file
&
attach_default_output (process_dir)>foo
osl_admin -quit -request_line 'get i_am_bridge'
&set bridge (command_status)
detach_default_output
&
&if &bridge& ^= 0
&then &set OPTS (string -super -syserr)
&else &set OPTS (string -syserr)
&
&
& ********** Use a loop to start the desired number of servers.
&
&set COUNT &START&
&label LOOP
&
&set OUT &BASE&&COUNT&.out
&set CMD (string osl_server &$OPTS& -server_suffix &COUNT&)
&
&
& ********** If it exists, save the old output file.
&
&if (exists &OUT&) ^= 0
&then !rename -delete &OUT& *.old
&
&
& ********** Create a new output file and turn on implicit locking. This
& ********** will allow the file to be displayed while the osl_server is
& ********** still running.
&
!create_file &OUT&
!set_implicit_locking &OUT& on
!start_process &$CMD& -privileged -output_path &OUT& -priority 9 &+
-process_name &BASE&&COUNT&
&
&
& ********** Loop back around until enough osl_server processes have
& ********** been started.
&
&set COUNT &COUNT& + 1
&
&if &COUNT& <= &END&
&then &goto LOOP
&
&
& start_more_osl_servers ends here
|
图4 - start_more_osl_servers.cm |