[stgt] tgtd memory usage

Степан Фёдоров stepan.fedorov at clodo.ru
Fri Apr 1 08:53:09 CEST 2011


Each target has one real LUN:

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
0 targets ~1Gb:
root     19675  0.1  9.7 1247120 1198808 ?     SLs  Mar30   4:51 /usr/sbin/tgtd

1 target:
root     19675  0.1  9.7 1247120 1198808 ?     SLsl Mar30   4:51 /usr/sbin/tgtd

10 targets:
root     19675  0.1  9.7 1542176 1199096 ?     SLsl Mar30   4:51 /usr/sbin/tgtd

20 targets:
root     19675  0.1  9.7 1870016 1199416 ?     SLsl Mar30   4:51 /usr/sbin/tgtd

30 targets:
root     19675  0.1  9.7 2197856 1199736 ?     SLsl Mar30   4:51 /usr/sbin/tgtd

40 targets:
root     19675  0.1  9.7 2525696 1200056 ?     SLsl Mar30   4:51 /usr/sbin/tgtd

50 targets:
root     19675  0.1  9.7 2853536 1200376 ?     SLsl Mar30   4:51 /usr/sbin/tgtd

100 targets:
root     19675  0.1  9.7 4492736 1201976 ?     SLsl Mar30   4:52 /usr/sbin/tgtd

200 targets:
root     19675  0.1  9.7 7771136 1205176 ?     SLsl Mar30   4:52 /usr/sbin/tgtd

400 targets:
root     19675  0.1  9.8 14327936 1211576 ?    SLsl Mar30   4:56 /usr/sbin/tgtd

This 14327936, is more than memory physically installed on this node
(12Gb), and i don't know what will happen, if tgtd will try to use all
of this memory.

So, we can see increasing VSZ field by about 30Mb per one LUN.

2011/3/31 Or Gerlitz <ogerlitz at mellanox.com>:
> Or Gerlitz wrote:
>
> Hi Stepan, The iser code would allocate memory only when sessions (iser
> connections) are established, there's a global pool of size 1GB
> which is allocated on the 1st establishment, and later ~3MB per session,
> where a session accounts to iscsi target (not lun).
>
> Stepan, we made a check here to validate the observations from the code
> inspecting, and it seems that each (target + one session) consumes about
> 4MB, so there are 700KB over the 3.3MB we saw from the code, e.g allocated
> by the IB libraries, or other areas in tgt,
> etc.
>
> Each target has one null lun, the per-target column is memory increased per
> one target from previous allocation
>
>     targets               mem                     per-target
>
>          1                     1230068                1230068
>
>          2                     1234116                4048
>
>          4                     1242100                3992
>
>          8                     1258260                4040
>
>         16                   1289792                3941
>
>         32                   1353416                3976
>
>         64                   1480664                3976
>
>
>
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list