[mapserver-users] MapServer Oracle performance

Ivan ivan.lucena at pmldnet.com
Fri Aug 28 04:25:10 PDT 2009


Frank,

Frank Warmerdam wrote:
> Ivan wrote:
>> I setup an very simple MAP file with a GDAL/GeoRaster as the DATA 
>> parameter of a layer like that:
>>
>>   LAYER
>>     DATA "geor:scott/tiger at orcl,CITIES,SCENE,ID=120"
>>
>> This raster is 14336x14336x3 big (600Mb) and has 7 level of pyramids 
>> on it. The question is that, because of the pyramids (= GDAL 
>> overviews) this image loads, pan and zoom pretty fast on QuantumGIS 
>> with the Oracle Raster plugin but that doesn't help at all in MapServer.
>>
>> I might not be that familiar with MapServer architecture either, but 
>> it looks to me that it doesn't take advantage of Pyramids at all. Not 
>> even if the raster is stored in MrSID. The only way to go is to build 
>> tile cache. Right?
> 
> Ivan,
> 
> MapServer certainly should be taking advantage of overviews if they are
> available.  MapServer just calls RasterIO and lets it do the downsampling
> so if GDAL's RasterIO is downsampling with overviews it should be good.
> 
> If this is not working, we should likely be investigating how the overviews
> are presented by the driver.

I pretty much sure that the GeoRaster driver is returning the overview correctly when it is asked to
read the correct overview/pyramid level.

My MAP/SIZE parameter is "800 600" so if add some debugging message inside the driver code and run
gdal_translate and shp2img to compare the results that is what I got:

% gdal_translate geor:scott/tiger at orcl,gdal_rdt,59 out.tif -outsize 800 600
Input file size is 14336, 14336
...
GEOR: nBlock, nBand, nLevel, nXOffset, nYOffset, nColumnBlockSize, nRowBlockSize = 0, 1, 4, 0, 0,
256, 256
GEOR: nBlock, nBand, nLevel, nXOffset, nYOffset, nColumnBlockSize, nRowBlockSize = 1, 1, 4, 1, 0,
256, 256
GEOR: nBlock, nBand, nLevel, nXOffset, nYOffset, nColumnBlockSize, nRowBlockSize = 2, 1, 4, 2, 0,
256, 256
...

% shp2img -m /home/ilucena/htdocs/test.map -o out.png
...
GEOR: nBlock, nBand, nLevel, nXOffset, nYOffset, nColumnBlockSize, nRowBlockSize = 0, 1, 0, 0, 0,
256, 256
GEOR: nBlock, nBand, nLevel, nXOffset, nYOffset, nColumnBlockSize, nRowBlockSize = 1, 1, 0, 1, 0,
256, 256
GEOR: nBlock, nBand, nLevel, nXOffset, nYOffset, nColumnBlockSize, nRowBlockSize = 2, 1, 0, 2, 0,
256, 256
...
0...10...20...30...40...50...60...70...80...90...100 - done.

I am assuming that shp2img is calling the same code as MapServer. Rigth?

So looking at the debugging information I can see that the nLevel parameter is incorrect. It is
reading from the full scene what takes much more blocks to read and more time. But I am assuming
that the only downsamplying I need to specify for this test is the SIZE parameter on the general MAP
level.

Debugging those two process I noticed some important difference. shp2img calls GDALDatasetRasterIO 
and will ultimately calls the driver IRasterIO but without calling GetOverview first, so when it 
goes to the driver IReadBlock the level is 0. gdal_translate calls GetOverview and get the 
appropriated level but it does not touch the driver IRasterIO, it goes directly to the IReadBlock 
with the correct level. It Seams like QGIS does the same.

I will continue to investigate.

Thanks,

Ivan





More information about the MapServer-users mailing list