The staging-area blobspace improves the performance of writing TEXT and BYTE data that is larger than the cache size. The Optical Subsystem receives TEXT and BYTE data from the client application in 1-kilobyte pieces for a single row at a time. If the memory cache is full and cannot hold all pieces of TEXT and BYTE data, or if the cache is not being used, then the Optical Subsystem writes the TEXT and BYTE data to the staging-area blobspace. The Optical Subsystem uses the same memory cache for all client applications that are writing TEXT and BYTE data.
The configuration parameter OPCACHEMAX, located in the ONCONFIG file, specifies the size of the memory cache in kilobytes. If the value is 0, the Optical Subsystem does not use the cache. You can set the client environment variable, INFORMIXOPCACHE, to restrict the amount of memory cache that the client application uses. The value for INFORMIXOPCACHE is specified in kilobytes and can be any value less than or equal to OPCACHEMAX. If INFORMIXOPCACHE is not set, the client application can use as much of the memory cache as is available.
For more information about the ONCONFIG file, see the IBM Informix: Guide to SQL Reference. For more information about the OPCACHEMAX configuration parameter, see the IBM Informix: Administrator's Reference.
The Optical Subsystem stores all TEXT or BYTE data for a given row in the memory cache until the last bit of TEXT or BYTE data in the row has been received or until the cache is full. If TEXT or BYTE data in the row does not fit in the memory cache, it is flushed out of the cache to the staging-area blobspace. If the next column of TEXT or BYTE data in the row fits in the available space in the memory cache, it stays in the memory cache.
For example, imagine that you have a memory cache of 150 kilobytes, that the setting for the configuration parameter OPCACHEMAX is 150 kilobytes, and that the environment variable INFORMIXOPCACHE is not set. Your current row has three columns of TEXT data of the following sizes: 30 kilobytes, 180 kilobytes, and 70 kilobytes. The first TEXT data column is 30 kilobytes and the Optical Subsystem writes it to the memory cache. The second TEXT data column is 180 kilobytes and the Optical Subsystem tries to use the memory cache but the data is too large. The Optical Subsystem writes the TEXT data from the second column to the staging-area blobspace. The third column of TEXT data is 70 kilobytes and fits in the memory cache. The Optical Subsystem now outmigrates all three TEXT data columns in the row to the optical-storage subsystem in 50-kilobyte pieces in the order the TEXT data columns were processed: the first TEXT data from the memory cache; the second TEXT data from the staging-area blobspace; and the third TEXT data from the memory cache.
If you want to outmigrate a different number of bytes than the default of 50 kilobytes, you can configure the outmigration amount using the storage manager for the optical-storage subsystem. Figure 3 illustrates the use of the memory cache and the staging area when TEXT and BYTE data is outmigrated to the optical-storage subsystem.
You create the staging-area blobspace with the onspaces command line utility. Before you use the optical-storage subsystem, you must perform the following tasks:
Before you use the optical-storage subsystem, you might also want to perform the following tasks:
For detailed information for each step, see Creating the Staging Area.
Memory for the memory cache is allocated as it is used. If OPCACHEMAX is set at 500 (500 kilobytes) and the largest TEXT or BYTE data is 50 kilobytes, the Optical Subsystem uses only 50 kilobytes for the memory cache.
Because the setting for the configuration parameter OPCACHEMAX is system wide, 100 percent of the memory cache is available if you are the only user. If additional users compete for use of the memory cache, more data is written to the staging-area blobspace. To properly assess the use of the memory cache, look at how many applications are processing TEXT or BYTE data objects and set the OPCACHEMAX to accommodate the largest data object.
The system configuration parameter OPCACHEMAX uses a default value of 128 kilobytes; however, you can set OPCACHEMAX to any value. If OPCACHEMAX is set to 0, the memory cache is not used and the Optical Subsystem writes all TEXT and BYTE data to the staging-area blobspace.
The structure of the staging-area blobspace is the same as all other blobspaces. When it is created, the staging area consists of only one chunk, but more can be added as desired. Blobspace free-map pages manage the space. For information on how to create a blobspace, see the IBM Informix: Administrator's Reference.
The optimal size for the staging-area blobspace depends on the following application factors:
To calculate the size of the staging-area blobspace, you must estimate the number of TEXT or BYTE data objects that you expect to reside in the staging-area blobspace simultaneously and multiply that number by the average size. In a single transaction, all TEXT or BYTE data that moves to the staging area is held in the staging area until the transaction completes. The number of TEXT or BYTE data objects that reside in the staging area simultaneously depends on the number of rows that are inserted at one time. The minimum size of the staging-area blobspace must be at least as large as the largest TEXT or BYTE data object that will reside in it. If the Optical Subsystem uses the staging-area blobspace, it writes an entire TEXT or BYTE data object to the staging area before it outmigrates the object to the optical-storage subsystem.
If a hardware failure occurs in the staging-area blobspace, the Optical Subsystem rolls the transaction back. The Optical Subsystem does not commit the transaction until it has written the data to the optical platter.
The staging-area blobspace cannot be mirrored.
You specify the stageblob blobspace with the STAGEBLOB configuration parameter. The STAGEBLOB parameter has two values separated by a comma. The first value gives the name of the blobspace and the second value gives the number of optical VPs configured. In the following example, the blobspace_name is the name of the stageblob blobspace and 2 is the number of optical VPs configured. For information on configuring optical VPs, see Support for Multiple Optical Virtual Processors.
STAGEBLOB blobspace_name,2
For information on how to set the STAGEBLOB parameter, refer to the IBM Informix: Administrator's Reference.
The presence of the STAGEBLOB parameter in the ONCONFIG file signals the database server that an optical-storage subsystem is present. If the database server does not find the STAGEBLOB parameter in the ONCONFIG file or if STAGEBLOB has a blank tag, it behaves as if no optical-storage subsystem existed. If the STAGEBLOB parameter is present but you have not created the staging-area blobspace, the database server displays the following message:
Invalid or missing name for Subsystem Staging Blobspace
You must create the staging-area blobspace and reinitialize the database server before it can migrate TEXT or BYTE data to the optical-storage subsystem. For the procedure to create the staging-area blobspace, refer to Installation and Initial Configuration.
You can use the -O option of the onstat utility to monitor available and allocated resources for the memory cache and the staging-area blobspace. Figure 4 shows a sample of onstat -O output.
IBM Informix Dynamic Server, Version 10.00.UN105 --Online-- Up 00:45:18 -- 11656 Kbytes Optical StageBlob Cache System Cache Totals: System Blob Totals: Size Alloc. Avail. Number Kbytes Number Kbytes 500 500 0 1 20 3 1500 User Cache Totals: User Blob Totals: SID User Size Number Kbytes Number Kbytes 94 doug 250 1 20 1 300 95 beth 500 0 0 2 1200
The example shows that Doug wrote one 20-kilobyte TEXT or BYTE data to the memory cache. He also tried to write a 300-kilobyte TEXT or BYTE data object, but it did not fit because he is limited to 250 kilobytes of the memory cache. Beth can use the entire 500-kilobyte memory cache, but the two TEXT or BYTE data objects that she tried to write did not fit in the memory cache (1,200 kilobytes) and were written to the staging-area blobspace. No optical writes are in progress in Figure 4 (Avail = 0). No optical work was completed except for these two programs because the totals equal the sum of the two user entries (1,500 kilobytes). You can tell that the two programs are still connected because the entries are visible.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]