Wednesday, October 8, 2014

Multiple levels of data compression in save commands

AS400 IBM i data compression rates to a save file

Addendum: There is a newer post that includes the new ZLIB save algorithm, you can read it here.


Something that was added to the SAVOBJ and SAVLIB commands in IBM i release 6.1 V5R4 was the ability to compress data more than before when saving to a save file. Previously the only options that were available for the Data Compression parameter was *DEV, *NO, and *YES. With 6.1 V5R4 three new compressions levels were added:

  • *LOW
  • *MEDIUM
  • *HIGH

Note:  These three values are not valid when saving to tape.

What is the benefit of using any of these Data Compression values?

On a quiet Sunday afternoon I decided to put this to the test. It does not matter the processor size of the IBM i I performed the testing upon as the numbers generated are purely comparable. If you perform a similar test on your IBM i you might get different numbers, but I am sure that the differences will be comparable.

I took a large physical file and saved it using the SAVOBJ command using the following parameters:

  SAVOBJ OBJ(FILE) LIB(MYLIB) OBJTYPE(*FILE)
           DEV(*SAVF) SAVF(QTEMP/SAVEFILE) 
           DTACPR(value)

I used all of the types of data compressions:

  • *DEV - This only compresses if the save is to tape. Otherwise it should be the same as *NO.
  • *NO - No compression is performed.
  • *YES - As the save is being performed to a save file this should be the same as the *LOW.
  • *LOW
  • *MEDIUM
  • *HIGH

The results were…

Compression
type
Save file
size
Time taken
(seconds)
Original file 12,085,375 N/A
*DEV 12,075,568 53
*NO 12,075,568 66
*YES 5,741,616 120
*LOW 5,741,616 121
*MEDIUM 2,669,616 374
*HIGH 1,795,120 1,801

As expected the higher level of compression the smaller the file and the longer the save operation takes. What is interesting is the difference in size between the size of the compressed save file. By using the *HIGH compression the save file can be only 14.9% of the size of the original.

Compression
type
Percentage of
original file
Original file 100%
*DEV  *NO 99.9%
*YES  *LOW 47.5%
*MEDIUM 22.1%
*HIGH 14.9%

What would I do? As I have mentioned in previous posts I do spend time sending files and programs between 11 different IBM i partitions and servers. If I have a large number of objects or large (big) files to send to another IBM i server I would use the *HIGH compression level to create a smaller save file. It will then take less time for FTP to copy the save file from one IBM i to the other.

 

More information about these keywords can be found on the IBM website:

 

This article was written for IBM i 7.1, and it will work with 6.1 V5R4 and higher releases too.

4 comments:

  1. Hi, I used the data compression value "*HIGH" in 5.4..... HIGH, MEDIUM and LOW values were available in 5.4... not something new in 6.1.

    Am i wrong?

    ReplyDelete
    Replies
    1. You are probably not wrong. When doing research for this story I could not find any V5R4 documentation. What I did find was 6.1 documentation that included the command.

      I have made corrections.

      Thanks

      Delete
  2. Perhaps you should do the research on the restoration as well.

    Thanks.

    ReplyDelete
  3. *HIGH compression can take a long time to save and sometimes the saving in size are not worth that extra time. For instance during our end of day processing a back up is done to save file of the main file library which with *MEDIUM compression takes about 2 hours. With *HIGH compression it was nearer 7. Hence we use *MEDIUM as a compromise.

    ReplyDelete

To prevent "comment spam" all comments are moderated.
Learn about this website's comments policy here.

Some people have reported that they cannot post a comment using certain computers and browsers. If this is you feel free to use the Contact Form to send me the comment and I will post it for you, please include the title of the post so I know which one to post the comment to.