Directory Server Resource Kit の一部として提供されている makeldif コマンドとサンプルファイルを使用すれば、1K バイトから 1M バイトまでのサイズのサンプル LDIF ファイルを作成できます。makeldif コマンドの使用方法を示す例については、『Sun Java System Directory Server Enterprise Edition 6.3 Installation Guide』の「To Install Directory Server Enterprise Edition 6.3 From Zip Distribution」を参照してください。
次の各ファイル内のエントリは、実際の配備時に使用するエントリ数よりは少なめかもしれません。
| $ du -h /var/tmp/* 57M /var/tmp/100k.ldif 5.7M /var/tmp/10k.ldif 573M /var/tmp/1M.ldif | 
これらのファイル内のエントリの例を、次の LDIF に示します。
dn: uid=Aartjan.Aalders,ou=People,dc=example,dc=com objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson givenName: Aartjan sn: Aalders cn: Aartjan Aalders initials: AA uid: Aartjan.Aalders mail: Aartjan.Aalders@example.com userPassword: trj49xeq telephoneNumber: 935-748-6699 homePhone: 347-586-0252 pager: 906-399-8417 mobile: 452-898-9034 employeeNumber: 1000004 street: 64197 Broadway Street l: Lawton st: IN postalCode: 57924 postalAddress: Aartjan Aalders$64197 Broadway Street$Lawton, IN 57924 description: This is the description for Aartjan Aalders.
まず、ディスク上で 5.7M バイトを占有する 10k.ldif の内容をインポートすることで、サイジングを始めます。
| $ dsadm stop /local/ds Server stopped $ dsadm import -i /local/ds /var/tmp/10k.ldif dc=example,dc=com … | 
デフォルトのインデックス作成では、10k.ldif により、インスタンスファイルのサイズが 72M バイト - 53M バイト、つまり 19M バイトだけ増加します。
| $ du -hs /local/ds 72M /local/ds | 
さらに別の 5 つの属性にもインデックスを付けると、サイズが約 7M バイト増加します。
| $ dsconf create-index dc=example,dc=com employeeNumber street st \ postalCode description $ dsconf reindex dc=example,dc=com … ## example: Finished indexing. Task completed (slapd exit code: 0). $ du -hs /local/ds 79M /local/ds | 
デフォルトのキャッシュ設定でメモリーサイズを監視すると、サフィックスからエントリキャッシュへまだ何も読み込まれていなければ、サーバープロセスは約 170M バイトのメモリーを占有し、そのヒープサイズは約 56M バイトになります。
| $ dsadm start /local/ds
Server started: pid=8482
$ pmap -x 8482
…
         Address     Kbytes        RSS       Anon     Locked Mode   Mapped File
0000000000437000      61348      55632      55380          - rw---    [ heap ]
…
---------------- ---------- ---------- ---------- ----------
        total Kb     178444     172604      76532          - | 
次に、キャッシュに情報を格納してから pmap コマンドの出力を再度確認すると、ヒープが約 10M バイトだけ増加し、プロセスの合計サイズもそれと同じだけ増加しています。
| $ ldapsearch -D cn=Directory\ Manager -w - -p 1389 -b dc=example,dc=com \
 objectclass=\* > /dev/null
Enter bind password:
$ pmap -x 8482
…
         Address     Kbytes        RSS       Anon     Locked Mode   Mapped File
…
0000000000437000      70564      65268      65024          - rw---    [ heap ]
…
---------------- ---------- ---------- ---------- ----------
        total Kb     187692     182272      86224          - | 
この数値を、デフォルトインデックス作成の場合と比較してみましょう。
| $ dsconf delete-index dc=example,dc=com employeeNumber street st \
 postalCode description
$ dsconf reindex dc=example,dc=com
…
## example: Finished indexing.
Task completed (slapd exit code: 0).
$ dsadm stop /local/ds
 Server stopped
$ dsadm start /local/ds
 Server started: pid=8541
$ ldapsearch -D cn=Directory\ Manager -w - -p 1389 -b dc=example,dc=com \
 objectclass=\* > /dev/null
Enter bind password:
$ pmap -x 8541
…
         Address     Kbytes        RSS       Anon     Locked Mode   Mapped File
…
0000000000437000      70564      65248      65004          - rw---    [ heap ]
…
---------------- ---------- ---------- ---------- ----------
        total Kb     187680     182240      86192          - | 
エントリ数がわずか 10,000 件であれば、デフォルトのキャッシュサイズを変更しないでください。
| $ dsconf get-server-prop | grep cache db-cache-size : 32M import-cache-size : 64M $ dsconf get-suffix-prop dc=example,dc=com | grep entry-cache-size entry-cache-size : 10M | 
デフォルトのエントリキャッシュはサイズが小さいため、エントリ数がわずか 10,000 件であっても、情報が格納されると間違いなく、キャッシュが完全にいっぱいになります。エントリが完全に収まるキャッシュのサイズを確認するには、エントリキャッシュサイズをある大きな値に設定し、データをインポートし直してから、キャッシュに情報を格納します。
| $ dsconf set-suffix-prop dc=example,dc=com entry-cache-size:2G
$ dsadm stop /local/ds
Server stopped
$ dsadm import -i /local/ds /var/tmp/10k.ldif dc=example,dc=com
…
$ dsadm start /local/ds
Server started: pid=8806
$ ldapsearch -D cn=Directory\ Manager -w - -p 1389 -b dc=example,dc=com \
 objectclass=\* > /dev/null
Enter bind password:
$ pmap -x 8806
…
         Address     Kbytes        RSS       Anon     Locked Mode   Mapped File
…
0000000000437000     116644     109996     109780          - rw---    [ heap ] | 
ここでは、10,000 件のエントリが、約 55M バイト (110 - 55) のエントリキャッシュメモリーを占有しています。