1 Layered Queueing Netwrk Mdeling f Sftware Systems Building Security System (buffering) Murray Wdside 5201 Canal Building
Building Security System LQN-examples slide 2 Tw subsystems: CCTV strage, and dr access cntrl hpe t manage up t 100 cameras Cmpnents, shwn as UML with MARTE anntatins: SecurityCard Reader DrLck Actuatr Vide Camera Disk {PAcapacity=2} LAN <<PAhst>> ApplicCPU AccessCntrl Acces Cntrller VideAcquisitin Vide Cntrller AcquirePrc StrePrc Buffer {PAcapacity=$Nbuf} Buffer Manager <<PAhst>> DB_CPU Database
<<PApenLad>> {PAccurencePattern = ( pissn, 0.5, s ), PArespTime =(( req, percentile,95, (1, s )), ( pred, percentile, 95, $UserR)) } Dr Access Scenari 1. Pissn arrivals f Users 2/s <<PAcntext>> LQN-examples slide 3 User {PAextOp=(read, 1)} readcard User puts card thru reader enterbuilding CardReader DrLck admit (cardinf) Alarm mean, (1.8, ms ))} 3. Open dr r recrd alarm Requirement: 1 s respnse with 95% prbability mean, (1.8, ms ))} {PAdelay=( asmd, mean, (500, ms )), PAprb = 1} [OK] pendr() {PAprb = 0} [nt OK] alarm() mean, (1.8, ms ))} Access Cntrller Database {PAcapacity=10} mean, (0.3, ms ))} checkrights() mean, (0.2, ms ), PAprb=0.2} [need t lg?] lgevent() writeevent() Disk {PAcapacity=2} mean, (1.8, ms ))} getrights() mean, (1.5, ms )), PAprb = 0.4} readrights() [nt_in_cache] readdata() 2. Prcess card, check rights mean, (3, ms ))} writerec() 4. Write lg f events
CCTV capture scenari LQN-examples slide 4 <<PAcntext>> Vide Cntrller 1.Trigger camera read events (the N cameras were nt mdeled) 2. Put the image in a buffer, send t database *[$N] prconeimage(i) mean, (1.8, ms))} {PArep = $N} <<PAclsedLad>> {PAppulatin = 1, PAinterval =(( req, percentile,95, (1, s )), ( pred, percentile, 95, $Cycle)) } AcquirePrc {PAdemand =( asmd, mean, (1.5, ms )} getbuffer() <<GRMacquire>> allcbuf (b) mean, ($P * 1.5, ms )), PAextOp = (netwrk, $P)} getimage (i, b) mean, (0.9, ms ))} passimage (i, b) mean, (0.5, ms ))} BufferManager This bject manages the resurce Buffer mean, (0.5, ms ))} mean, (1.1, ms ))} streimage (i, b) <<GRMrelease>> releasebuf (b) StrePrc mean, (0.2, ms ))} freebuf (b) mean, (2, ms ))} stre (i, b) Database {PAcapacity=10} Buffer peratins: get release mean, ($B * 0.9, ms )),, PAextOp=(writeBlck, $B)} writeimg (i, b) 3. Stre image in database
The LQN Mdel LQN-examples slide 5 Shared Resurces Vide Capture subsystem Dr Access subsystem
Handling f Buffering Each buffer must be emptied befre it can be used fr anther camera Thus the buffer is a resurce that culd have a queue, which shuld be mdeled as the pseud-task Buffer Mdel fragment withut buffer Hw the buffer pl was mdeled LQN-examples slide 6 real task BufferManager and pseudtask Buffer frwarding call t a functin f BufferManager
Handling f Buffering (2) LQN-examples slide 7 The peratins that require hlding the buffer are executed by calls frm the buffer pl pseud-task Buffer separate frm the buffer manager task!! including the executin f the release peratin by the buffer manager assumes the manager has a dedicated thread fr release releasebuf is executed by streimage, r bufentry
Mdel Features LQN-examples slide 8 This mdel illustrates hw we can mdel lgical resurces (the buffer pl) the use f frwarding the use f secnd phase t imprve cncurrency (later)
Results #1 LQN-examples slide 9 Average Nrmalized Utilizatins Prb f Missing Deadline Respnse Time Ncam Cycle User (sec) AcqPrc Buffer StrePrc AppCPU Cameras Drs (sec) 10 0.327 0.127 0.960 0.9998 0.582 0.549 0 0.031 20 0.655 0.138 0.963 0.9999 0.582 0.545 0.0007 0.036 30 0.983 0.133 Table 1. Simulatin results fr the base case 0.964 0.9999 0.582 0.544 0.4196 0.038 40 1.310 0.129 0.965 0.9999 0.582 0.544 0.9962 0.034 Base case, ne buffer, s ne camera at a time Access-cntrl respnses are fine; the event rate was kept cnstant at 2/s. Camera plling becmes t slw between 20 and 30 cameras try adding mre buffers.
Results #2 cameras fixed at 40, vary the number f buffers NBuf LQN-examples slide 10 disappinting: the miss prbability levels ut abve 9% at abut 7 buffers. StrePrc is apparently the new bttleneck: try an additinal thread Average Prb f Missing Nrmalized Utilizatins Respnse Time Deadline NBuf Cycle User AcqPrc Buffer StrePrc AppCPU Cam s Drs (sec) (sec) 1 1.309 0.137 0.965 0.9999 0.583 0.544 0.9961 0.034 2 1.016 0.132 0.975 0.8762 0.800 0.702 0.5503 0.032 3 0.941 0.132 0.980 0.8235 0.893 0.756 0.2506 0.036 4 0.911 0.131 0.983 0.8042 0.936 0.782 0.1597 0.032 7 0.879 0.132 0.986 0.8136 0.984 0.810 0.0948 0.033 10 0.872 0.129 0.987 0.8437 0.995 0.817 0.0935 0.034
Results #3 LQN-examples slide 11 Success! Tw threads n StrePrc cmbined with 4 buffers brings the miss prbability dwn well within spec f 1 secnd fr each N. f Stre Prc Average Respnse Time Cycle (sec) 40 cameras, Nuser = 100 drs, Nbuf = 4 buffers User (sec) Nrmalized Utilizatins Prb f Missing Deadline AcqPrc Buffer StrePrc AppCPU Cam s Drs 1 0.911 0.131 0.983 0.8042 0.936 0.782 0.1597 0.032 2 0.756 0.137 0.946 0.5805 0.616 0.940 0.0022 0.035 3 0.743 0.139 0.932 0.5484 0.441 0.956 0.0015 0.039
Discussin LQN-examples slide 12 The saturated resurce is AppPrc making multiplicity = 2 allws 50 cameras The limitatin is nw at AcquirePrc, due t a lng service time the time it takes t stre the buffers is limiting multithreading alne is nt the answer T allw an earlier start n the next camera, we can put the calls frm AcquirePrc int phase 2, with multithreading early reply t VideCntrller mves the capture n t the next camera much earlier allws the cncurrent phase-2 Acquire tasks t run in parallel Other adjustments are als pssible
Results #4 LQN-examples slide 13 By using phase 2 at AcquirePrc and varius multiplicities we can get a capacity f 100 cameras. Even mre capacity can be fund with StrePrc. Anther explratin apprach: set multiplicities at inf and see if specified delays are feasible at all, and what mulitplicity is used (= utilizattin), then wrk dwn t specified delays. Multiplicity (Acquire, Buffer, Stre, App. CPU) 100 cameras, Nuser = 100 drs, Nbuf = 10 buffers Average Respnse Time Cycle (sec) User (ms) Acquire Prc Nrmalized Utilizatins Stre Prc Prb f Missing Deadline Buffer App Cam s Drs CPU 2, 4, 2, 2 1.250 0.133 0.988 0.923 0.886 0.710 0.9995 0.0332 2, 10, 6, 3 0.837 0.132 0.988 0.689 0.751 0.707 0.0057 0.0307 3, 10, 6, 3 0.768 0.134 0.983 0.895 0.910 0.769 0.0005 0.0352