본문으로 바로 가기

이 블로그 글에서는 충분한 수의 osl_server_processes가 실행되었는지 확인하는 방법을 다루겠습니다. 향후 블로그 글에서는 max_open_servers 값이 사용자의 환경에 적합한지 확인하는 방법에 대해 다룰 예정입니다.

OSL 서버의 수는 OSL을 사용하는 애플리케이션의 성능에 있어 중요한 요소입니다!

osl_server 프로세스가 충분히 실행 중이라는 것은 무엇을 의미할까요? 이는 다른 모듈이나 시스템에서 트랜잭션이 도착했을 때, 항상 유휴 상태이며 해당 트랜잭션을 처리할 수 있는 osl_server가 하나 이상 존재한다는 것을 의미합니다. 즉, 모든 osl_server 프로세스가 동시에 트랜잭션을 처리하고 있는 상황이 결코 발생해서는 안 된다는 뜻입니다.

osl_server 프로세스는 후입선출(LIFO) 방식으로 스케줄링되므로, 트랜잭션을 가장 최근에 완료한 osl_server 프로세스가 다음으로 스케줄링됩니다. 즉, 가장 이른 time_last_run 값은 모든 서버가 동시에 바빴던 마지막 시점을 의미합니다. 해당 시간이 지난 1~2일 이내라면 서버를 추가해야 할 가능성이 높습니다. 반면, 시스템 부팅 시점과 일치한다면 서버 추가가 필요하지 않을 것입니다. 그 중간 범위에 해당하는 경우, 해당 시점이 얼마나 오래 전인지, 그리고 가끔씩 발생하는 OSL 속도 저하를 감수할 수 있는지에 따라 판단해야 합니다. 그림 1은 여러 osl_server 프로세스의 time_last_run을 표시하는 데 필요한 명령어를 보여줍니다.

as:  process -process_name osl_server1; match time_last_run; dump_pte
실행 중이 아닌 프로세스를 사용합니다.
현재 프로세스는 52, ptep 8D82E500, Overseer.System (osl_server1)
Overseer.System (osl_server1)의 8D82E500에 있는 PTE;
time_last_run:          00000000 01834C2E (2020-09-07 15:36:51.31266)
as:  process -process_name osl_server2; match time_last_run; dump_pte
실행 중이지 않은 프로세스 사용.
현재 프로세스는 53, ptep 8D872000, Overseer.System (osl_server2)
Overseer.System (osl_server2)의 8D872000 위치에 있는 PTE;
time_last_run:          00000002 462972DC (2020-09-07 08:54:17.46376)
as:  process -process_name osl_server3; match time_last_run; dump_pte
실행 중이지 않은 프로세스 사용 중.
현재 프로세스는 54, PTE 8D874000, Overseer.System (osl_server3)
Overseer.System (osl_server3)의 8D874000 위치에 있는 PTE;
time_last_run:          00000000 0183947E (2020-09-07 15:36:51.59513)
. . . .
as:  process -process_name osl_server6; match time_last_run; dump_pte
실행 중이지 않은 프로세스 사용 중.
현재 프로세스는 57, ptep 8D87B440, Overseer.System (osl_server6)
Overseer.System (osl_server6)의 8D87B440에 있는 PTE;
time_last_run:          00000000 01DBF96A (2020-09-07 15:38:19.98936)
as:
그림 1 – time_last_run 표시

이 게시물의 마지막 부분에 있는 osl_server_times.cm 매크로는 time_last_run 시간을 정렬된 목록으로 담은 osl_server_times.(날짜)라는 파일을 생성합니다. 또한 터미널 창에 해당 파일을 표시합니다. 이 매크로는 osl_server 프로세스의 이름이 osl_serverN 형식이라고 가정합니다. 그렇지 않은 경우, 사용자가 직접 기본 이름을 지정할 수 있습니다. 이 매크로는 모든 프로세스가 공통된 기본 이름을 가지고 있다고 가정하며, 이를 기준으로 일치 여부를 확인합니다. 목록의 첫 번째 시간은 모든 서버가 동시에 실행된 마지막 시점입니다. 로그인 시간은 프로세스가 시작된 시점을 나타내며, 일반적으로 시스템이 부팅된 시점과 일치하여 프로세스들도 동시에 시작됩니다.

예제 1은 6개의 osl_server 프로세스가 실행 중인 모듈을 보여줍니다. 시스템 부팅 이후 6개 프로세스 모두 어느 정도 사용된 기록이 있지만, 마지막 실행 시간을 고려할 때 이는 부팅 과정 중 복구 작업과 관련이 있었을 가능성이 높습니다. 시스템 부팅 후 이틀 동안 실제로 사용된 프로세스는 단 두 개뿐입니다. 시스템이 부팅되어 새로운 트랜잭션을 처리할 준비가 되는 데 걸리는 시간에 문제가 없다면, 이 모듈에 프로세스를 추가하지 않을 것입니다.

osl_server_times.cm은 2022년 9월 7일 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
 2020-07-09 15:36:51.31484 / 1.32 / 2020-07-09 15:33:50 / osl_server5 / 56
 2020-09-07 15:36:51.59513 / 0.81 / 2020-09-07 15:33:49 / osl_server3 / 54
 2020-09-07 15:38:19.98936 / 2.51 / 2020-09-07 15:33:50 / osl_server6 / 57
 2009-07-22 08:54:17.46376 / 1.59 / 2009-07-20 15:33:49 / osl_server2 / 53
 2022-07-22 15:26:35.14511 / 2.77 / 2020-07-09 15:33:49 / osl_server4 / 55
예 1 – 모든 프로세스에 CPU 시간이 할당되어 있지만 추가로 할당할 필요는 없음

예제 2에서 모듈은 40개의 osl_server 프로세스를 실행 중입니다. 그중 13개는 7개월여 전 모듈이 시작된 이후로 한 번도 실행된 적이 없으므로, 여전히 많은 수의 프로세스가 실행되고 있는 셈입니다.

osl_server_times.cm은 2021년 11월 3일 15시 33분 01초에 %XXXXX#m1에서 실행됨

      마지막 실행 시간        CPU       로그인 시간           프로세스 이름    번호
                                                       이름    번호
 10-08-01 07:45:02.68817 / 0.02 / 10-08-01 07:45:02 / osl_server1 / 84
 2010-08-01 07:45:06.45556 / 0.00 / 2010-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
 2020-11-03 04:13:02.01803 / 667.23 / 2010-08-01 07:45:54 / osl_server14 / 100
 2020-11-03 07:51:16.66950 / 40151.59 / 2010-08-01 07:46:51 / osl_server24 / 110
 2020-11-03 08:10:21.71397 / 16944.88 / 2010-08-01 07:46:02 / osl_server16 / 102
 2020-11-03 08:12:03.16114 / 39066.37 / 2010-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
 2020-11-03 08:13:03.05792 / 0.02 / 2020-11-03 08:12:59 / osl_server26 / 2317
 2020-11-03 08:13:16.25518 / 0.02 / 2020-11-03 08:13:06 / osl_server28 / 2319
 2020-11-03 08:13:16.25527 / 0.01 / 2020-11-03 08:13:03 / osl_server27 / 2318
 2020-11-03 08:13:21.60688 / 0.02 / 2020-11-03 08:13:16 / osl_server30 / 2321
 2020-11-03 08:19:09.81250 / 0.15 / 2020-11-03 08:13:20 / osl_server31 / 2322
 2020-11-03 08:50:04.73651 / 0.45 / 2020-11-03 08:13:30 / osl_server33 / 2324
 2020-11-03 21:02:34.17459 / 68.30 / 2020-11-03 08:50:49 / osl_server39 / 2406
 2021-03-21 15:20:20.30186 / 170.07 / 2020-03-11 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
 2021-03-21 15:33:01.02978 / 175.24 / 2021-03-20 08:13:37 / osl_server35 / 2326
 2021-03-21 15:33:01.35322 / 211.63 / 2021-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
 2021-03-21 15:33:01.46699 / 194.44 / 2021-03-20 08:50:41 / osl_server37 / 2404
예 2 – 일부 프로세스는 부팅 이후 한 번도 실행된 적이 없으므로 추가할 필요가 없습니다.

이 마지막 예시는 더 많은 osl_server가 필요한 경우를 보여줍니다. 해당 모듈은 20개의 서버를 실행 중이며, 매크로가 실행된 지 24시간도 채 되지 않아 20개 서버 모두가 사용 중이었습니다.

osl_server_times.cm은 2021년 11월 3일 15:49:03에 %XXXXX#m11에서 실행됨

      마지막 실행 시간        CPU       로그인 시간           프로세스 이름    번호
                                                       이름    번호
 2020-03-11 18:37:18.97851 / 3079.12 / 2010-09-10 08:04:38 / osl_server / 56
 2020-03-11 18:37:18.97999 / 5044.43 / 2010-09-10 08:04:37 / osl_server / 48
 2020-03-11 18:37:22.37568 / 2485.06 / 2010-09-10 08:04:37 / osl_server / 51
 2020-03-11 18:37:26.99446 / 3637.60 / 2010-09-10 08:04:37 / osl_server / 52
 2020-03-11 18:37:26.99464 / 3329.56 / 2010-09-10 08:04:38 / osl_server / 62
 2020-03-11 18:38:04.86495 / 3556.72 / 2010-09-10 08:04:37 / osl_server / 54
 2020-03-11 18:38:48.53218 / 2509.57 / 2010-09-10 08:04:38 / osl_server / 63
 2020-03-11 18:39:06.44256 / 3434.27 / 2010-09-10 08:04:39 / osl_server / 67
 2020-03-11 18:39:06.44291 / 4478.29 / 2010-09-10 08:04:38 / osl_server / 64
 2020-03-11 18:39:06.45211 / 2918.82 / 2010-09-10 08:04:37 / osl_server / 49
 2020-03-11 18:39:06.45213 / 3131.79 / 2010-09-10 08:04:37 / osl_server / 53
 2021-03-21 03:00:35.69830 / 2477.28 / 2010-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
 2011-03-21 15:48:52.71038 / 3601.19 / 2010-09-10 08:04:38 / osl_server / 55
예 3 – 더 많은 서버가 필요한 경우

두 개의 구성 파일을 편집, 컴파일 및 설치하여 OSL 서버의 수를 늘리거나 줄일 수 있습니다. 이러한 변경 사항은 다음 재부팅 시 적용됩니다. OSL 서버의 수를 제어하는 튜닝 매개변수는 new_modules.tin 및 new_backbone_systems.tin 파일 내의 max_open_servers 값입니다. module_start_up은 max_open_servers 값을 사용하여 시작할 osl_server 프로세스 수를 계산합니다. 모듈이 브리지 모듈이 아닌 경우 2 * max_open_servers개를 시작하고, 브리지 모듈인 경우 4 * max_open_servers개를 시작합니다.

module_start_up.cm 파일에서 ADDITIONAL_OSL_SERVERS 값을 설정하면, max_open_servers 값의 기본값인 2 또는 4개보다 더 많은 osl_server 프로세스를 시작할 수 있습니다. 또한 시스템을 재부팅하지 않고도 명령줄에서 직접 프로세스를 추가로 시작할 수 있습니다. 이 글의 마지막 부분에 있는 start_more_osl_servers.cm 매크로를 사용하면 더 많은 프로세스를 쉽게 시작할 수 있습니다.

실행 중인 osl_server 프로세스가 너무 많다면 이를 중지할 수 있지만, 나중에 정말로 필요해질 때 해당 프로세스가 준비되어 있지 않을 수 있습니다. 일반적으로 여분의 osl_server 프로세스가 실행 중이라고 해서 상당한 양의 리소스를 소비하는 것은 아닙니다. 하지만 여분의 프로세스를 중지하고 싶다면 stop_process 명령어를 사용해서는 안 됩니다. osl_server 프로세스에는 현재 트랜잭션을 완료한 후 정상적으로 종료하도록 지시하는 스위치가 있습니다. stop_sw라는 이름의 이 스위치는 short 형이며 -1로 설정해야 합니다(그림 2 참조).

as:  process -process_name osl_server1\
실행 중이지 않은 프로세스를 사용합니다.\
현재 프로세스는 52번, ptep 8D82E500, Overseer.System (osl_server1)입니다.\
as:  set_word stop_sw -1\
주소      시작  종료\
000730F4  0000  FFFF\
as:
그림 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

 

© 2024 Stratus Technologies.