bsp; 79 rt_sigaction .... ------ ----------- ----------- --------- --------- ---------------- 100.00 0.420259 1970 227 total
$ man shmdt ... shmdt() detaches the shared memory segment located at the address specified by shmaddr from the address space of the calling process. The to-be-detached segment must be currently attached with shmaddr equal to the value returned by the attaching shmat() call.
On a successful shmdt() call the system updates the members of the shmid_ds structure associated with the shared memory segment as follows:
shm_dtime is set to the current time. shm_lpid is set to the process-ID of the calling process. shm_nattch is decremented by one. If it becomes 0 and the segment is marked for deletion, the segment is deleted.
--//给人的感觉好像消耗在调用shmdt,实际上消耗的时间0.419648.也就是这样还是无法定位问题在那里.
$ strace -fTtt -e shmdt sqlplus -s -l / as sysdba Process 6046 attached [pid 6046] 08:41:55.548586 shmdt(0x7f2c41600000) = 0 <0.000036> quit 08:41:59.992835 shmdt(0x60000000) = 0 <0.000042> 08:41:59.992983 shmdt(0x68000000) = 0 <0.000042> 08:41:59.993097 shmdt(0x6c000000) = 0 <0.360175> 08:42:00.353446 shmdt(0x4ec000000) = 0 <0.037200> 08:42:00.390737 shmdt(0x560000000) = 0 <0.000026> Process 6046 detached --//我手工执行quit,可以发现shmdt调用发生在退出阶段,也就是不是它导致登陆缓慢.
$ ipcs -smt
------ Shared Memory Attach/Detach/Change Times -------- shmid owner attached detached changed 352092161 oracle Apr 10 17:26:09 Apr 10 17:26:17 Apr 10 17:09:55 352124930 oracle Apr 10 17:26:09 Apr 10 17:26:17 Apr 10 17:09:55 352157699 oracle Apr 10 17:26:09 Apr 10 17:26:18 Apr 10 17:09:55 352190469 oracle Apr 10 17:26:09 Apr 10 17:26:18 Apr 10 17:09:55 352223238 oracle Apr 10 17:26:09 Apr 10 17:26:18 Apr 10 17:09:55
------ Semaphore Operation/Change Times -------- semid owner last-op last-changed 310738944 oracle Wed Apr 10 17:11:33 2019 Wed Apr 10 17:11:33 2019 --//从执行时间看4.5秒并不是消耗在这里.
4.继续分析,排除调用 |