[Geoserver-users] World Image performance

Hello,

I have performance problems with a PNG+World Image Coverage displayed
with WMS. The first requests are OK, then it gets slower until all
HTTP connections are used: GeoServer is stuck.

I don't have this problem with PostGIS Features displayed with WMS.

I tried to install native JAI in my JRE, but it doesn't help.

I am using Linux, Java 6, Tomcat 6, GeoServer 1.6.2, Open Layers.

What can I do?

Gerald

Gérald Quintana ha scritto:

Hello,

I have performance problems with a PNG+World Image Coverage displayed
with WMS. The first requests are OK, then it gets slower until all
HTTP connections are used: GeoServer is stuck.

I don't have this problem with PostGIS Features displayed with WMS.

I tried to install native JAI in my JRE, but it doesn't help.

I am using Linux, Java 6, Tomcat 6, GeoServer 1.6.2, Open Layers.

What can I do?

Give up using png, it's not a good format for web image serving
in general, and especially bad with GeoServer.
Use gdal_translate and gdal_addo to translate your images into inner tiled tiffs with overviews.
Some hints here:
http://geoserver.org/display/GEOSDOC/High+performance+coverage+serving

Cheers
Andrea

Thanks for you help Andrea,

2008/4/9, Andrea Aime <aaime@anonymised.com>:

Give up using png, it's not a good format for web image serving
in general, and especially bad with GeoServer.

PNG not a good format for the Web? it's the first time hear that!
Is there a chance that GIF+WLD or TIF+WLD works better than PNG+WLD?

I tried to convert PNG into GeoTiff with "geotifcp" tool (from GeoTiff
library), unfortunately GeoServer can't load such GeoTiffs (invalid
SRS).

Use gdal_translate and gdal_addo to translate your images into inner tiled
tiffs with overviews.

I am going to look at the GDAL toolbox. I don't have ECW files, this
PNG coverage is generated from another application (not GIS oriented).
This is why I find World Image practical: I tell the other app to
periodically save a PNG in the GeoServer data folder and it works.

Gerald

Gérald Quintana ha scritto:

Thanks for you help Andrea,

2008/4/9, Andrea Aime <aaime@anonymised.com>:

Give up using png, it's not a good format for web image serving
in general, and especially bad with GeoServer.

PNG not a good format for the Web? it's the first time hear that!

Definitely not a good format for GIS web serving, no, not nearly
as performant as a geotiff with inner tiles and overviews.

When accessing a PNG you have to uncompress it fully in order to
grab even only a portion of it (which is typical when users do
zoom an pan around).
With inner tiled geotiffs GeoServer can grab only the relevant tiles
and avoid reading the others. If the geotiff has overviews, GeoServer
can use the pre scaled down overview instead of having to compute
it on the fly

Is there a chance that GIF+WLD or TIF+WLD works better than PNG+WLD?

The performance secret sauce is having innner tiles and overviews,
using tiff without those two features should not increase performance
significantly, thought you'll have to check for yourself, I don't
have numbers (if you do, I'm curious about the results).

I tried to convert PNG into GeoTiff with "geotifcp" tool (from GeoTiff
library), unfortunately GeoServer can't load such GeoTiffs (invalid
SRS).

It seems that tool does not embed the srs information into the geotiff.
Cheers
Andrea

2008/4/9, Andrea Aime <aaime@anonymised.com>:

Definitely not a good format for GIS web serving, no, not nearly

> as performant as a geotiff with inner tiles and overviews.
>
> When accessing a PNG you have to uncompress it fully in order to
> grab even only a portion of it (which is typical when users do
> zoom an pan around).
> With inner tiled geotiffs GeoServer can grab only the relevant tiles
> and avoid reading the others. If the geotiff has overviews, GeoServer
> can use the pre scaled down overview instead of having to compute
> it on the fly
>
>

I converted the PNG+WLD coverage into GeoTIFF ones with
gdal_translate. I removed tiling in Open Layers and gave my server
many names (ala Google Maps) to let the browser load WMS layers in
parallel. It's better, but after some times the WMS rendering still
slows down and I fear it won't be enough. I think there is still
something wrong, but I can't determine where.

By the way I thank you very much Andrea for you help,

Gérald

2008/4/9, Andrea Aime <aaime@anonymised.com>:

Gérald Quintana ha scritto:
> I converted the PNG+WLD coverage into GeoTIFF ones with
> gdal_translate.
>

Did you add overviews with gdal_addo? That's key to get good performance
when you're fairly zoomed out (far from the native resolution of the
imags).

Since I added the overviews to the Geo Tiff coverage, it doesn't
display anymore when the display bounding box is bigger than the
coverage bounding box (don't ask me why I am trying to display a map
bigger than my coverage :wink: ). When I zoom in, the coverage appears,
is it a normal behaviour?

Gérald

Gérald Quintana ha scritto:

2008/4/9, Andrea Aime <aaime@anonymised.com>:

Gérald Quintana ha scritto:

I converted the PNG+WLD coverage into GeoTIFF ones with
gdal_translate.

Did you add overviews with gdal_addo? That's key to get good performance
when you're fairly zoomed out (far from the native resolution of the
imags).

Since I added the overviews to the Geo Tiff coverage, it doesn't
display anymore when the display bounding box is bigger than the
coverage bounding box (don't ask me why I am trying to display a map
bigger than my coverage :wink: ). When I zoom in, the coverage appears,
is it a normal behaviour?

No, it's not. GeoServer 1.6.2 may happen to do this if you added
overviews out of order. The instructions page suggested to do:
gdaladdo file 2 4 8 16 32 64 ...
(increasing powers of two)

If the overviews are out of order, like as if you added like:
gdaladdo file 64 32 16 8 ...
gdaladdo file 2 4 16 8 32 128 64

geoserver may fail to use the proper one...
Can you check and see if this is the problem?
(you'll have to gdal_translate and gdal_addo from scratch,
since overviews can only be added)

Cheers
Andrea

2008/4/10, Andrea Aime <aaime@anonymised.com>:

Gérald Quintana ha scritto:

> Since I added the overviews to the Geo Tiff coverage, it doesn't
> display anymore when the display bounding box is bigger than the
> coverage bounding box (don't ask me why I am trying to display a map
> bigger than my coverage :wink: ). When I zoom in, the coverage appears,
> is it a normal behaviour?
>

No, it's not. GeoServer 1.6.2 may happen to do this if you added
overviews out of order. The instructions page suggested to do:
gdaladdo file 2 4 8 16 32 64 ...
(increasing powers of two)

If the overviews are out of order, like as if you added like:
gdaladdo file 64 32 16 8 ...
gdaladdo file 2 4 16 8 32 128 64

geoserver may fail to use the proper one...
Can you check and see if this is the problem?
(you'll have to gdal_translate and gdal_addo from scratch,
since overviews can only be added)

Before I had overviews 2 4 8 16 -> nothing appeared at big scales, OK
at small scales
Now I have overviews 16 8 4 2 -> A mozaic appears at big scales, OK at
small scales

The more I add overviews levels (.. 32 64 128), the bigger are mozaic tiles.

Cheers,
Gerald

2008/4/10, Andrea Aime <aaime@anonymised.com>:

Gérald Quintana ha scritto:
No, it's not. GeoServer 1.6.2 may happen to do this if you added
overviews out of order. The instructions page suggested to do:
gdaladdo file 2 4 8 16 32 64 ...
(increasing powers of two)

If the overviews are out of order, like as if you added like:
gdaladdo file 64 32 16 8 ...
gdaladdo file 2 4 16 8 32 128 64

geoserver may fail to use the proper one...
Can you check and see if this is the problem?
(you'll have to gdal_translate and gdal_addo from scratch,
since overviews can only be added)

The solutions was to add overviews level, I did
gdaladdo file 2 4 8 16
I added
gdaladdo file 2 4 8 16 32 128 64
And now it's OK

You saved me Andrea: THANKS!
Gérald