<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Overheads of large .DIR files? in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234490#M39907</link>
    <description>Hi John,&lt;BR /&gt;&lt;BR /&gt;From Mark's comment in the above link, note the following thing&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; Note that the create/dir command allows you&lt;BR /&gt;&amp;gt;&amp;gt; to allocate the space up front so you don't&lt;BR /&gt;&amp;gt;&amp;gt; have to endure the frequent extends for&lt;BR /&gt;&amp;gt;&amp;gt; directories expected to be very large.&lt;BR /&gt;&lt;BR /&gt;Apart from the Expand and Compress shuffle operation of the directory&lt;BR /&gt;file, this talks about moving directory file to some other location on&lt;BR /&gt;the disk.&lt;BR /&gt;When adding entries to directory file, if there is no contiguous space&lt;BR /&gt;(i.e. contiguous space after the current directory file location on the&lt;BR /&gt;disk) then the directory would be moved to some other location of the disk&lt;BR /&gt;where the contiguous space is available. By pre-allocating directory file&lt;BR /&gt;on the disk using the create command, this can be avoided.&lt;BR /&gt;you may want to try this out also.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; Are you sure about the lock ONLY being on the .DIR file during creates&lt;BR /&gt;&amp;gt;&amp;gt; and deletes? What about the changes to INDEXF.SYS and BITMAP.SYS?&lt;BR /&gt;&amp;gt;&amp;gt; Aren't there two locks, one for the directory and one for the volume?&lt;BR /&gt;&lt;BR /&gt;You are correct. When creating a file, a lot of other operations are&lt;BR /&gt;involved other than creating a directory entry for that file. Space needs&lt;BR /&gt;to be grabbed from the disk and so on. For these different set of locks&lt;BR /&gt;are used and some of them would block the activity on the entire volume.&lt;BR /&gt;&lt;BR /&gt;I was referring in particular to operation of adding/removing entries from&lt;BR /&gt;the directory files for which only the serialization lock on the directory&lt;BR /&gt;file is taken. This is where there is lot of scope for optimization and&lt;BR /&gt;reduce the amount of time taken.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; The other point about daily directories is that each is independent&lt;BR /&gt;&amp;gt;&amp;gt; and that a very large number of files created on one day won't continue&lt;BR /&gt;&amp;gt;&amp;gt; being a performance problem for the other 6 days.&lt;BR /&gt;Yes. Also as i said before, with smaller directories, XQP would not have to &lt;BR /&gt;do a lot of activity for Expand/Compress shuffle of the directory.&lt;BR /&gt;This would be a performance benefit.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Murali</description>
    <pubDate>Mon, 12 Apr 2010 02:39:30 GMT</pubDate>
    <dc:creator>P Muralidhar Kini</dc:creator>
    <dc:date>2010-04-12T02:39:30Z</dc:date>
    <item>
      <title>Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234483#M39900</link>
      <description>We have a situation where we create maybe 18,000 log files per day (the actual number varies depending on what's run) and these hese log files are held for 7 days.  The file names contain 28 characters, made up of an unchanging 11-character standard prefix, a 4-digit number (1 to 1999) that might cycle several times in 24 hours, an underscore character, the PID and the file type '.LOG'.  (Each filename is unique because these are log files for detached "slave" processes and yes, we have lots of those.) Any node in the cluster (2 to 4 machines) might create these log files. &lt;BR /&gt;&lt;BR /&gt;To date all these files have gone into one directory, making for some .DIR files that exceed 5000 blocks.  File creation is spread across the day and deletion, after 7 days, takes place around 4:00am when the system is quiet.&lt;BR /&gt;&lt;BR /&gt;I think we should move to a new log file directory each day (via a logical that rolls over at midnight driven within the image by a timer AST) and that we should use shorter file names (just "S_&lt;PID&gt;.LOG"). I believe that the overheads associated with file creation and deletion will be reduced if we go this way.&lt;BR /&gt;&lt;BR /&gt;My knowledge is based on the old performance "knee" at 127 blocks, after which point performance went downhill.  I understand performance was improved in VMS v7.3 but I can't find a good description of exactly what altered and what the implications are for inserting and removing file names.  In particular I can't find information about when disk I/O's are required (c.f. cache lookups), or about the splitting of blocks in .DIR files when inserting new files names.  My understanding is that a lock is taken out on the entire volume when the .DIR file is being modified, so I would like to minimise this lock time as well as the disk I/O time.&lt;BR /&gt;&lt;BR /&gt;In short ... &lt;BR /&gt;Q1 - what performance-related practices do you recommend for large numbers of files being created in a single directory, and why?&lt;BR /&gt;Q2 - exactly what changes were made in v7.3 and what, if any, performance "gotchas" still exist?  &lt;BR /&gt;&lt;BR /&gt;(And if you say that no changes are necessary to our current shema then please explain why.)&lt;BR /&gt; &lt;BR /&gt;&lt;/PID&gt;</description>
      <pubDate>Mon, 12 Apr 2010 01:05:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234483#M39900</guid>
      <dc:creator>John McL</dc:creator>
      <dc:date>2010-04-12T01:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234484#M39901</link>
      <description>Q1: don't do what is being done here?&lt;BR /&gt;Q2: big directories are n^2 data structures.  And stuff can fall out of cache.&lt;BR /&gt;&lt;BR /&gt;As for a more detailed answer, read this first:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=625667" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=625667&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hein and Mark Hopkins in particular describe this stuff in some detail over there.&lt;BR /&gt;&lt;BR /&gt;You could choose to fix this design flaw, or you could choose to reorganize the allocations (incremental additions are best added to the end of the directory; log files that sort alphabetically and increasing), or you can investigate what can be done to avoid creating the log files or such; addressing the environment holistically.&lt;BR /&gt;&lt;BR /&gt;As for removing the files, reverse delete (DCL or DFU or a program) will help with that aspect of performance.&lt;BR /&gt;&lt;BR /&gt;If this is the lowest of the low-hanging fruit for local performance, go for it.  &lt;BR /&gt;&lt;BR /&gt;Updating the application design might help, too; I've seen cases where revisiting or rethinking that can be beneficial; where the design is the "dead elephant in the room."&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Apr 2010 01:42:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234484#M39901</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2010-04-12T01:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234485#M39902</link>
      <description>Hi John,&lt;BR /&gt;&lt;BR /&gt;Directory file is a logically contiguous file. When lot of files are added&lt;BR /&gt;in a directory, the directory file size increases. But for this to happen&lt;BR /&gt;the system should have enough contiguous space.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; My understanding is that a lock is taken out on the entire volume when&lt;BR /&gt;&amp;gt;&amp;gt; the .DIR file is being modified, so I would like to minimize this lock&lt;BR /&gt;&amp;gt;&amp;gt; time as well as the disk I/O time.&lt;BR /&gt;&lt;BR /&gt;Directory is a file, whose contents are filenames along with some&lt;BR /&gt;attributes such as Version Limit, Version, FID, SYMLINK information and&lt;BR /&gt;so on. When creating/deleting new files in a directory, the directory files&lt;BR /&gt;needs to be modified to reflect this operation. For this, serialization&lt;BR /&gt;lock is  taken out on the directory. This blocks only those XQP threads&lt;BR /&gt;that want to  access the same directory. But other activities on the volume&lt;BR /&gt;can proceed. i.e. you can create/delete files in some other directory on&lt;BR /&gt;the same disk at the same time.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; I think we should move to a new log file directory each day&lt;BR /&gt;Yes this sounds like a good idea.&lt;BR /&gt;With this setup, the directory for every day would be smaller.&lt;BR /&gt;&lt;BR /&gt;With a single large directory,&lt;BR /&gt;For the first day the directory gets filled up (lets say Filenames a.txt&lt;BR /&gt;to z.txt). For the subsequent days, when files are created (say c.txt),&lt;BR /&gt;then based on whether the block where c.txt has to be inserted is full&lt;BR /&gt;or not, XQP would have to do Expand Shuffle (move d.txt to z.txt one block&lt;BR /&gt;below) to insert new entries in a directory file.&lt;BR /&gt;&lt;BR /&gt;When files needs to be deleted (say d.txt), then based on whether the&lt;BR /&gt;block having d.txt is full or not, XQP would have to do compress shuffle&lt;BR /&gt;(move e.txt to z.txt one block above) to delete entries in a directory&lt;BR /&gt;file.&lt;BR /&gt;&lt;BR /&gt;If we have a day wise directory,&lt;BR /&gt;Then the number of Expand/Compress Shuffle that XQP does can be minimized.&lt;BR /&gt;i.e. As every day has its own directory, the day wise create/delete would&lt;BR /&gt;act on only its corresponding directory with few number of entries&lt;BR /&gt;(as compared to only a single directory with large number of entries).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; Any node in the cluster (2 to 4 machines) might create these log files.&lt;BR /&gt;Is distributed lock manager involved here ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Will get back to you on the performance related practices.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Murali</description>
      <pubDate>Mon, 12 Apr 2010 01:45:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234485#M39902</guid>
      <dc:creator>P Muralidhar Kini</dc:creator>
      <dc:date>2010-04-12T01:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234486#M39903</link>
      <description>Having a directory per day will be more efficient; I doubt you will find anyone that will say otherwise.&lt;BR /&gt;&lt;BR /&gt;Shortening the file names will allow more file names to be stored in each directory block, so the 18,000 files will require fewer blocks in the directory file.&lt;BR /&gt;&lt;BR /&gt;Just curious, will having the PID in the log file name be very useful?  How will a user know what PID was theirs?  If the files have a constant name, the directory will be much more compact, since each version must only store the version number and file ID of the specific file (when it is in the same directory block).  For example, the following command file will create 1000 versions of "THIS_IS_A_LONG_FILE_NAME_THAT_WILL.HAVE_MANY_VERSIONS" in a 10 block directory.&lt;BR /&gt;&lt;BR /&gt;$ cre/dir/all=10 [.itrctest]&lt;BR /&gt;$ cnt=1&lt;BR /&gt;$top:&lt;BR /&gt;$ cre [.itrctest]this_is_a_long_file_name_that_will.have_many_versions;&lt;BR /&gt;$ cnt = cnt + 1&lt;BR /&gt;$ if cnt .le. 1000 then goto top&lt;BR /&gt;$end:&lt;BR /&gt;$ exit&lt;BR /&gt;&lt;BR /&gt;Another advantage of one per day, is that you can easily delete all the files in the directory at the end of the 7 day waiting period.  One of the most efficient ways to do that would be with DFU.&lt;BR /&gt;&lt;BR /&gt;For example to delete device:[20100404...]*.*;*&lt;BR /&gt;&lt;BR /&gt;$ dfu delete/directory/tree/nolog device:[000000]20100404.dir&lt;BR /&gt;&lt;BR /&gt;If you use dfu to delete the directories, it will also delete the directory too.  I am not aware of a way to delete the files without the directory using DFU.  So I would recommend using &lt;BR /&gt;&lt;BR /&gt;$ create/directory/allocation=5000 &lt;BR /&gt;&lt;BR /&gt;when creating the empty directories, to avoid constant directory expansions (which will probably involve recopying the current contents to a new location on disk each time, since VMS directory files must be contiguous).&lt;BR /&gt;&lt;BR /&gt;You may want to create a search list logical name that will include all the 7 day's worth of directories, so it will be possible to find a log file from a previous day using a simple directory command:&lt;BR /&gt;&lt;BR /&gt;For example &lt;BR /&gt;&lt;BR /&gt;$ define[/system] applog device:[20100411],device:[20100410],device:[20100409],device:[20100408],device:[20100407],device:[20100406],device:[20100405]&lt;BR /&gt;&lt;BR /&gt;$ directory applog:mylog.log&lt;BR /&gt;&lt;BR /&gt;Jon&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Apr 2010 01:54:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234486#M39903</guid>
      <dc:creator>Jon Pinkley</dc:creator>
      <dc:date>2010-04-12T01:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234487#M39904</link>
      <description>Hoff,&lt;BR /&gt;Mark's &amp;amp; Hein's comments were interesting but were largely focused on file deletes.  This isn't a big issue because we're using ZIP with the "remove" (or is it "move"?) option.  (For those not familiar, it's like BACKUP/DEL).  Moreover this runs in a batch job at about 4:00am when performance isn't as important as from 8am to 9pm or theerabouts.&lt;BR /&gt;&lt;BR /&gt;We are working on reducing the number of log files because some are for "slave" processes that ultimately did nothing because of what other slaves did, but this situation seems unpredictable and depends on job mix.</description>
      <pubDate>Mon, 12 Apr 2010 02:22:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234487#M39904</guid>
      <dc:creator>John McL</dc:creator>
      <dc:date>2010-04-12T02:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234488#M39905</link>
      <description>Muralidhar,&lt;BR /&gt;I'd forgotten about the contiguous requirement, so thanks for that reminder.&lt;BR /&gt;&lt;BR /&gt;Are you sure about the lock ONLY being on the .DIR file during creates and deletes?  What about the changes to INDEXF.SYS and BITMAP.SYS?  Aren't there two locks, one for the directory and one for the volume?&lt;BR /&gt;&lt;BR /&gt;The other point about daily directories is that each is independent and that a very large number of files created on one day won't continue being a performance problem for the other 6 days.</description>
      <pubDate>Mon, 12 Apr 2010 02:27:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234488#M39905</guid>
      <dc:creator>John McL</dc:creator>
      <dc:date>2010-04-12T02:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234489#M39906</link>
      <description>Jon,&lt;BR /&gt;&lt;BR /&gt;I agree with you that multiple versions would be better (smaller .DIR and fast access) and I've confirmed that using the cycling 4-digit number we currently use in the filename, however ...&lt;BR /&gt;&lt;BR /&gt;The slave processes are named according to their PID and the PID is displayed by certain management utilities, so short of some convoluted translation system and telling everyone how to use it I'm pretty much stuck with using the PID.&lt;BR /&gt;&lt;BR /&gt;The saving grace is that the log files will always(?) be added to the end of the list for the machine on which the slave process is running (i.e. on a 2-node evenly balanced system new filenames will be entered at a point 50% down the file and at the end.&lt;BR /&gt;&lt;BR /&gt;Sure filenames in the form &lt;HHMMSS&gt;_&lt;PID&gt;.LOG would guarantee end of file additions but now we've taken a 14 character filename out to 21 characters (orig size was 28 chars) and .DIR file size has grown. Is that a better tradeoff?  I'm not sure.&lt;BR /&gt;&lt;/PID&gt;&lt;/HHMMSS&gt;</description>
      <pubDate>Mon, 12 Apr 2010 02:39:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234489#M39906</guid>
      <dc:creator>John McL</dc:creator>
      <dc:date>2010-04-12T02:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234490#M39907</link>
      <description>Hi John,&lt;BR /&gt;&lt;BR /&gt;From Mark's comment in the above link, note the following thing&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; Note that the create/dir command allows you&lt;BR /&gt;&amp;gt;&amp;gt; to allocate the space up front so you don't&lt;BR /&gt;&amp;gt;&amp;gt; have to endure the frequent extends for&lt;BR /&gt;&amp;gt;&amp;gt; directories expected to be very large.&lt;BR /&gt;&lt;BR /&gt;Apart from the Expand and Compress shuffle operation of the directory&lt;BR /&gt;file, this talks about moving directory file to some other location on&lt;BR /&gt;the disk.&lt;BR /&gt;When adding entries to directory file, if there is no contiguous space&lt;BR /&gt;(i.e. contiguous space after the current directory file location on the&lt;BR /&gt;disk) then the directory would be moved to some other location of the disk&lt;BR /&gt;where the contiguous space is available. By pre-allocating directory file&lt;BR /&gt;on the disk using the create command, this can be avoided.&lt;BR /&gt;you may want to try this out also.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; Are you sure about the lock ONLY being on the .DIR file during creates&lt;BR /&gt;&amp;gt;&amp;gt; and deletes? What about the changes to INDEXF.SYS and BITMAP.SYS?&lt;BR /&gt;&amp;gt;&amp;gt; Aren't there two locks, one for the directory and one for the volume?&lt;BR /&gt;&lt;BR /&gt;You are correct. When creating a file, a lot of other operations are&lt;BR /&gt;involved other than creating a directory entry for that file. Space needs&lt;BR /&gt;to be grabbed from the disk and so on. For these different set of locks&lt;BR /&gt;are used and some of them would block the activity on the entire volume.&lt;BR /&gt;&lt;BR /&gt;I was referring in particular to operation of adding/removing entries from&lt;BR /&gt;the directory files for which only the serialization lock on the directory&lt;BR /&gt;file is taken. This is where there is lot of scope for optimization and&lt;BR /&gt;reduce the amount of time taken.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; The other point about daily directories is that each is independent&lt;BR /&gt;&amp;gt;&amp;gt; and that a very large number of files created on one day won't continue&lt;BR /&gt;&amp;gt;&amp;gt; being a performance problem for the other 6 days.&lt;BR /&gt;Yes. Also as i said before, with smaller directories, XQP would not have to &lt;BR /&gt;do a lot of activity for Expand/Compress shuffle of the directory.&lt;BR /&gt;This would be a performance benefit.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Murali</description>
      <pubDate>Mon, 12 Apr 2010 02:39:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234490#M39907</guid>
      <dc:creator>P Muralidhar Kini</dc:creator>
      <dc:date>2010-04-12T02:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234491#M39908</link>
      <description>&lt;!--!*#--&gt;&amp;gt; [...] largely focused on file deletes. This&lt;BR /&gt;&amp;gt; isn't a big issue because we're using ZIP&lt;BR /&gt;&amp;gt; with the "remove" (or is it "move"?)&lt;BR /&gt;&amp;gt; option. [...]&lt;BR /&gt;&lt;BR /&gt;Zip has no special code to make deleting&lt;BR /&gt;files any faster than anything else.&lt;BR /&gt;Depending on how it's used, I'd expect it to&lt;BR /&gt;use some sub-optimal (perhaps anti-optimal)&lt;BR /&gt;order when deleting the files in a directory.</description>
      <pubDate>Mon, 12 Apr 2010 02:50:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234491#M39908</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-04-12T02:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234492#M39909</link>
      <description>Steven,&lt;BR /&gt;&lt;BR /&gt;I'm in no position to be able to modify the ZIP technique that we use on a whole range of files.&lt;BR /&gt;&lt;BR /&gt;As I said, I'm not overly concerned with what happens at 4:00am unless it ultimately impacts the major processing that occurs between 8:00am and about 9pm.&lt;BR /&gt;&lt;BR /&gt;Using separate daily directories will also mean that deletions of the log files there won't have .DIR management overheads potentially impacting other files (although the volume lock would do so briefly).</description>
      <pubDate>Mon, 12 Apr 2010 03:06:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234492#M39909</guid>
      <dc:creator>John McL</dc:creator>
      <dc:date>2010-04-12T03:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234493#M39910</link>
      <description>Whether deleting files is a problem or not&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;When files needs to be deleted (say d.txt), then based on whether the&lt;BR /&gt;block having d.txt is full or not, XQP would have to do compress shuffle&lt;BR /&gt;(move e.txt to z.txt one block above) to delete entries in a directory&lt;BR /&gt;file. &lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;seems to have a typo: "whether the&lt;BR /&gt;block having d.txt is _empty_ or not".</description>
      <pubDate>Mon, 12 Apr 2010 06:09:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234493#M39910</guid>
      <dc:creator>H.Becker</dc:creator>
      <dc:date>2010-04-12T06:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234494#M39911</link>
      <description>Hi Becker,&lt;BR /&gt;&lt;BR /&gt;Yes. That was a typo.&lt;BR /&gt;I meant "whether the block having d.txt is _empty_ or not".&lt;BR /&gt;&lt;BR /&gt;Thanks for pointing that out.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Murali</description>
      <pubDate>Mon, 12 Apr 2010 06:24:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234494#M39911</guid>
      <dc:creator>P Muralidhar Kini</dc:creator>
      <dc:date>2010-04-12T06:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234495#M39912</link>
      <description>Ahhrg; posting failure(??)&lt;BR /&gt;This is a retry, please excuse a possible duplicate.&lt;BR /&gt;&lt;BR /&gt;jpe&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;John,&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;Sure filenames in the form &lt;HHMMSS&gt;_&lt;PID&gt;.LOG would guarantee end of file additions but now we've taken a 14 character filename out to 21 characters (orig size was 28 chars) and .DIR file size has grown. Is that a better tradeoff? I'm not sure.&lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;That explains easily:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;contain 28 characters, made up of an unchanging 11-character standard prefix, &lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;Consecutive directory entries get compacted where possible:&lt;BR /&gt;Each entry begins with the COUNT of characters from the previous entry that is repeated, followed by only the differing chars.&lt;BR /&gt;In the original setup, you only had the 11 char prefix ONCE, thereafter only the (one-byte) count (btw, hence the 255 char length limit). &lt;BR /&gt;Your new approach only allows for condensing off 6 bytes in the same second (6 digits + 1 "_" - 1 byte), 4 bytes in the same 10-second period, and regularly less when that rolls.&lt;BR /&gt;&lt;BR /&gt;Summary: long same-character LEADING substrings are relatively cheap, but varying chars early in the string force the remainder to be verbatim.&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe&lt;BR /&gt;&lt;/PID&gt;&lt;/HHMMSS&gt;</description>
      <pubDate>Mon, 12 Apr 2010 07:06:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234495#M39912</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2010-04-12T07:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234496#M39913</link>
      <description>John McL,&lt;BR /&gt;&lt;BR /&gt;I will have to keep this brief, as I need to get ready for an early meeting.&lt;BR /&gt;&lt;BR /&gt;Another consideration is whether these files need be stored in a single unitary directory.&lt;BR /&gt;&lt;BR /&gt;Two relatively straightforward options present themselves:&lt;BR /&gt;&lt;BR /&gt;- use a different directory per day, for searching purposes, use a logical name which concatenates six days of directories into a search list (this approximates the present behavior).&lt;BR /&gt;&lt;BR /&gt;- rather than a flat directory with a 28 character filename, consider creating a second-level set of subdirectories based upon part of that name (e.g., PID) with individual files being entered in the subdirectories. The subdirectories would be entered in the search list as described above. &lt;BR /&gt;&lt;BR /&gt;Combining the above two alternations would provide the scope of a seven-day retention, together with far smaller individual directories. As has been noted previously by other posters, the work involved in adding/removing files is loosely related to the size of the directory, thus segmenting the add/delete problem has potentially larger than linear payoff.&lt;BR /&gt;&lt;BR /&gt;Searching is then handled using a logical name with a search list.&lt;BR /&gt;&lt;BR /&gt;- Bob Gezelter, &lt;A href="http://www.rlgsc.com" target="_blank"&gt;http://www.rlgsc.com&lt;/A&gt;</description>
      <pubDate>Mon, 12 Apr 2010 07:24:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234496#M39913</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2010-04-12T07:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234497#M39914</link>
      <description>&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;Consecutive directory entries get compacted where possible: &lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;&lt;BR /&gt;The directory entries are always compacted within a disk block: all the free space is at the end. But entries are not compressed. What is described here, sounds like front end key compression for RMS index files.&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Apr 2010 11:01:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234497#M39914</guid>
      <dc:creator>H.Becker</dc:creator>
      <dc:date>2010-04-12T11:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234498#M39915</link>
      <description>&amp;gt;&amp;gt; we should use shorter file names (just "S_&lt;PID&gt;.LOG").&lt;BR /&gt;&lt;BR /&gt;Yeah, excellent. More dense is better, but try to get some movement in those leading characters. The XQP will use them as an index/accelerator. From what you described so far &lt;NNN&gt;&lt;PID&gt;_S.log might b a good alternative. &lt;HHMM&gt;&lt;PID&gt; might do. The leading part if the PID is often invariant or slow-variant. You might want to skip that?&lt;BR /&gt;Any concerns on re-boots and pids recycling?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; Q1 - what performance-related practices do you recommend for large numbers of files being created in a single directory, and why? &lt;BR /&gt;&lt;BR /&gt;a) Try to avoid that. Try exploit subdirectories and search-lists of directories. The latter may now need any application change.&lt;BR /&gt;b) If you can not use the searchlist/subdirectory, then try NOT to add in ever increasing order. Randomness where periodic deletes do NOT empty out the entire directory block are ideal. That way new files will typically re-use directory space from past files, and the directory will stay more or less constant in size, avoiding shuffles to squeeze out empty directory blocks, and open up for a fresh block.&lt;BR /&gt;&lt;BR /&gt;Hmmm... I never implemented anything like this, but with a somewhat predictable re-use pattern, you could seed the directory with constant entries to stop blocks from emptying out. &lt;BR /&gt;Write a tiny program to read the directory as sequential file. Every time the RFA_VBN changes, take the first N characters from the name, and call sys$enter to do something similar to: SET FILE/ENT=nnnnn.X $_place_holder.X. Just leave those around.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; Q2 - exactly what changes were made in v7.3 and what, if any, performance "gotchas" still exist? &lt;BR /&gt;&lt;BR /&gt;a) RMS was thought to user a directory buffer greater than 127 block if needed.&lt;BR /&gt;b) The XPQ was thought to not just use a single block buffer during directory shuffles, but use SYSGEN PARAM ACP_MAXREAD as  buffers size. That's typicaly set to 32, reducing large directory operations by that factor.&lt;BR /&gt;&lt;BR /&gt;Jan... you confused RMS INdexed file key compression with directories. Nice thought, but no, directory entries are NOT compressed.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein&lt;BR /&gt;&lt;/PID&gt;&lt;/HHMM&gt;&lt;/PID&gt;&lt;/NNN&gt;&lt;/PID&gt;</description>
      <pubDate>Mon, 12 Apr 2010 11:56:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234498#M39915</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2010-04-12T11:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234499#M39916</link>
      <description>Q1: Why are you even looking at this stuff?  &lt;BR /&gt;&lt;BR /&gt;Q1a: aesthetics?  &lt;BR /&gt;&lt;BR /&gt;Q2: If deletes aren't an issue, then what is an issue?&lt;BR /&gt;&lt;BR /&gt;Q3: what are your critical tasks and where are those bottlenecked for resources?  &lt;BR /&gt;&lt;BR /&gt;Q3a: Is that with big directories?&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Apr 2010 12:26:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234499#M39916</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2010-04-12T12:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234500#M39917</link>
      <description>&lt;!--!*#--&gt;Hmmm,&lt;BR /&gt;&lt;BR /&gt;I think seeding a certain directory for a customer of mine might be helpful. &lt;BR /&gt;So I wrote the helper program I suggested earlier to report the first record in each directory block, the numbers of records for that block,  and a final line to indicate how many leading characters would be needed to create unique names. Source below.&lt;BR /&gt;&lt;BR /&gt;It already provided useful insights for me ( using my twisted definition of useful :-).&lt;BR /&gt;&lt;BR /&gt;I could envision someone using something like this to get an insight in how directory entries might move around, using some snapshots. A quick DCL hack could use the output as driver file to actually create seeds directory name entries.&lt;BR /&gt;&lt;BR /&gt;Enjoy,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;$ type CHECK_DIRECTORY.C&lt;BR /&gt;#include &lt;STRING&gt;&lt;BR /&gt;#include &lt;STDLIB&gt;&lt;BR /&gt;#include &lt;STDIO&gt;&lt;BR /&gt;#include &lt;RMS&gt;&lt;BR /&gt;&lt;BR /&gt;int sys$open(), sys$connect(), sys$get();&lt;BR /&gt;main(int argc, char *argv[]) {&lt;BR /&gt;&lt;BR /&gt;    struct FAB  fab;&lt;BR /&gt;    struct RAB  rab;&lt;BR /&gt;    struct { short verlimit; unsigned char flags, namecount; char name[508]; } directory_record;&lt;BR /&gt;    int s, i, records=0, old_records=0, blocks=0, minimum=0, old_vbn=0;&lt;BR /&gt;    char old_name[256];&lt;BR /&gt;&lt;BR /&gt;    if (argc != 2) return 16;&lt;BR /&gt;    fab = cc$rms_fab;&lt;BR /&gt;    fab.fab$l_fna = argv[1];&lt;BR /&gt;    fab.fab$b_fns = strlen(argv[1]);&lt;BR /&gt;    fab.fab$b_fac = FAB$M_GET;&lt;BR /&gt;    fab.fab$b_shr = FAB$M_SHRUPD | FAB$M_SHRGET;&lt;BR /&gt;&lt;BR /&gt;    rab = cc$rms_rab;&lt;BR /&gt;    rab.rab$l_fab = &amp;amp;fab;&lt;BR /&gt;    rab.rab$l_ubf = (char *) &amp;amp;directory_record;&lt;BR /&gt;    rab.rab$w_usz = sizeof (directory_record);&lt;BR /&gt;&lt;BR /&gt;    s = sys$open (&amp;amp;fab);&lt;BR /&gt;    if (s&amp;amp;1) s = sys$connect (&amp;amp;rab);&lt;BR /&gt;    while (s&amp;amp;1) {&lt;BR /&gt;directory_record.namecount = 0; // EOF        &lt;BR /&gt;s = sys$get(&amp;amp;rab);&lt;BR /&gt;        if (!(s&amp;amp;1) &amp;amp;&amp;amp; s != RMS$_EOF) break;&lt;BR /&gt;        records++;&lt;BR /&gt;        if (old_vbn == rab.rab$l_rfa0 ) continue;  // Same block test.&lt;BR /&gt;        if ( blocks++ ) printf ("%06d %02d %s\n", // First block is special&lt;BR /&gt;            old_vbn, records - old_records, old_name);&lt;BR /&gt;        for (i=0; i &amp;lt; directory_record.namecount; i++) // Uniqueness test.&lt;BR /&gt;          if (old_name[i] != directory_record.name[i]) break;&lt;BR /&gt;        if (i &amp;gt; minimum) minimum = i;&lt;BR /&gt;        directory_record.name[directory_record.namecount] = 0;&lt;BR /&gt;        strcpy ( old_name, directory_record.name);&lt;BR /&gt;        old_vbn = rab.rab$l_rfa0;&lt;BR /&gt;        old_records = records;&lt;BR /&gt;    }&lt;BR /&gt;    printf ("\n%d records in %d blocks, minimum length %d.\n", records, blocks, minimum );&lt;BR /&gt;    if (s == RMS$_EOF) s = 1;&lt;BR /&gt;    return s;&lt;BR /&gt;}&lt;BR /&gt;&lt;/RMS&gt;&lt;/STDIO&gt;&lt;/STDLIB&gt;&lt;/STRING&gt;</description>
      <pubDate>Mon, 12 Apr 2010 13:17:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234500#M39917</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2010-04-12T13:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234501#M39918</link>
      <description>As already proposed, I would create the directory with a suitable allocation size. That avoids looking for contiguous disk space and copying the whole directory when the directory is growing in size.&lt;BR /&gt;&lt;BR /&gt;Pre-seeding the directory sounds interesting. Instead of pre-seeding you can also re-use a directory file after deleting almost all of the old log files.&lt;BR /&gt;&lt;BR /&gt;Using Hein's idea, looking at the first entry of each disk block in the directory tells you, which filenames you want to keep. "Pre-seeding" now means to delete all other files (and probably set EOF to zero for the remaining ones). This shouldn't be slower than deleting ALL files: no disk block shuffling any more.&lt;BR /&gt;&lt;BR /&gt;Now, if the pattern of the created filenames is similar enough, the available directory blocks will have enough room for most of the new files. So there will not be much copying within the disk file.&lt;BR /&gt;&lt;BR /&gt;There will be a lot of files in an "empty" directory. This may be VERY confusing.&lt;BR /&gt;&lt;BR /&gt;All this may be possible to code in DCL. Dump/dir can be used to find the filenames to keep.&lt;BR /&gt;&lt;BR /&gt;However, given the confusion and with writing/changing all the command procedure it may not be worth the effort.</description>
      <pubDate>Mon, 12 Apr 2010 13:22:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234501#M39918</guid>
      <dc:creator>H.Becker</dc:creator>
      <dc:date>2010-04-12T13:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Overheads of large .DIR files?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234502#M39919</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;Besides the comments on directory structure and using a logical, how large are your log files compared to the cluster size?  You'll need to review disk capacity against space since a larger disk cluster (or allocation size) will use more space, but can reduce i/o operatations overall.  &lt;BR /&gt;&lt;BR /&gt;Another option, is to spread your logical over 2 disks, alternating by day.  Schedule the delete pass on disk 0 while disk 1 is active for new logs.  Have a batch job modify the logical each night.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Apr 2010 15:35:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/overheads-of-large-dir-files/m-p/5234502#M39919</guid>
      <dc:creator>Andy Bustamante</dc:creator>
      <dc:date>2010-04-12T15:35:51Z</dc:date>
    </item>
  </channel>
</rss>

