Page 1 of 2

OMERO.web takes a lot of time to load Aperio SVS images

PostPosted: Thu Apr 30, 2015 8:40 am
by lucalianas
Hi everyone!

We are using OMERO to manage images produced by an Aperio ScanScopeXT and recently we noticed that OMERO.web is quite slow when loading these images.

As you can see from the image below, it seems that the problem is the number of the requests that the web server is processing at the same time.

Image

I configured OMERO.web to use Nginx and I kept the default options described in the deployment guide on the forum. We are running our installations on a 4GB Ubuntu server with 2 processors (actually, it is a Virtual Machine running on a Xen Server), with 2GB dedicated to the Blitz process.

Do you have any suggestion on how to configure our server in order to reduce loading times for this kind of images?

Thanks for the help!

Re: OMERO.web takes a lot of time to load Aperio SVS images

PostPosted: Fri May 01, 2015 8:56 am
by manics
Hi

Which browser are you using? It should be possible to increase the number of django workers in OMERO.web, but most browsers will limit the number of simultaneous connections to a single server so it might not help.

Simon

Re: OMERO.web takes a lot of time to load Aperio SVS images

PostPosted: Fri May 01, 2015 9:19 am
by wmoore
I just tried this on our test server with a big SVS image and was seeing response times around 300-400 ms for each tile (also on Chrome). It seems like yours are more like 600-800, so it may be the rendering speed that's the problem, not the number of requests.

When you say "slow", is this compared with other software, or web slower than Insight, or these images slower than others? Or just "would like it to be faster"?

Will.

Re: OMERO.web takes a lot of time to load Aperio SVS images

PostPosted: Mon May 04, 2015 8:08 am
by lucalianas
Hi guys,
it seems that the problem is the browser, as Simon wrote.
I was using Chrome and Safari (the screenshot was taken using Chrome) and I didn't notice any difference because both browsers can handle 6 connections per hostname.

http://www.browserscope.org/?category=network

We are comparing against Aperio's Spectrum WebScope

http://piox.nikon-instruments.it:88/PIOX/2009-05-08/acantoma%20a%20cellule%20chiare.svs/

which is faster than our OMERO.web installation but, as Will suggested, maybe the real problem in our server's rendering speed. I'm going to try to improve the server's performance, do you have any suggestion about that? Or a "OMERO fast rendering" recipe (like best RAM size, best RAM percentage for each process, how many processors should the server have)? :)
Thanks!

Re: OMERO.web takes a lot of time to load Aperio SVS images

PostPosted: Mon May 04, 2015 8:20 am
by manics
Our current recommended spec is a quad core processor with 8G GB RAM:
http://www.openmicroscopy.org/site/supp ... ments.html

However, if you are doing a lot of work with large images you might want to increase this even more, e.g. 16 GB RAM.

Re: OMERO.web takes a lot of time to load Aperio SVS images

PostPosted: Wed May 13, 2015 2:43 pm
by lucalianas
I'm still working on the server to decrease as much as possible load time for big SVS.
I was able to achieve really good results by "cheating" and caching tiles for Aperio images using Nginx's FastCGI cache.
I added the following rules to the nginx configuration file to enable this feature

Code: Select all
    fastcgi_cache_path /opt/omero_cache_data levels=1:2 keys_zone=omero_cache:100m inactive=60m;
    fastcgi_cache_key "$scheme$request_method$host$request_uri";
    fastcgi_ignore_headers Set-Cookie;

    server {
       
        ...

        # only cache rendered images
        set $skip_cache 1;
        if ($request_uri ~* "webclient/render_image_region*") {
           set $skip_cache 0;
        }

        location / {
       
        ...

        fastcgi_cache_bypass $skip_cache;
        fastcgi_no_cache $skip_cache;

        fastcgi_cache omero_cache;
        fastcgi_cache_valid 200 60m; # Only cache 200 responses, cache for 60 minutes
        fastcgi_cache_methods GET HEAD; # Only GET and HEAD methods apply
        add_header X-Fastcgi-Cache $upstream_cache_status;
        add_header X-Fastcgi-Cache-Skip $skip_cache;
       
        }

        ...

    }


I know, it is a trivial configuration but it works fine. I'll tune up Nginx now in order to get the best configuration for our OMERO.web installation.

Re: OMERO.web takes a lot of time to load Aperio SVS images

PostPosted: Thu May 14, 2015 10:43 am
by atarkowska
HI Luca

That was very good idea. We are investigating caching options that could be applied across OMERO platform to support all type of data.This will be coming soon.

In the meantime I would like to point you that we fixed bugs in a viewer to better support caching https://github.com/openmicroscopy/openm ... /pull/3800. It should be available for you in 5.1.2

Ola

Re: OMERO.web takes a lot of time to load Aperio SVS images

PostPosted: Tue May 26, 2015 8:59 am
by atarkowska
HI Luca

You mentioned
lucalianas wrote:
I configured OMERO.web to use Nginx and I kept the default options described in the deployment guide on the forum...


As we do not provide default nginx workers configuration did you optimize it? for example: http://stackoverflow.com/questions/7325 ... ts-per-min


Ola

Re: OMERO.web takes a lot of time to load Aperio SVS images

PostPosted: Wed Oct 14, 2015 9:27 am
by atarkowska
Hi Luca,

I am writing to follow up your suggested FastCGI cache config. Please not that we are removing FastCGI support in 5.2 in favor of WSGI as Django no longer support it. New way of deploying web is documented in https://www.openmicroscopy.org/site/sup ... -wsgi.html

I hope you will find it more useful and much more efficient.

Ola

Re: OMERO.web takes a lot of time to load Aperio SVS images

PostPosted: Wed Oct 14, 2015 10:45 am
by atarkowska
In addition, as you are now using Nginx+Gunicorn locally did you try reverse proxy cache, something like:

Code: Select all
proxy_temp_path    /var/cache/nginx/proxy_temp;
proxy_cache_path   /var/cache/nginx/proxy_cache/omeroweb levels=1:2 keys_zone=omeroweb_zone:50m inactive=1y max_size=10g;
proxy_cache_key    "$request_method@$scheme://$server_name:$server_port$uri$args";
proxy_cache_valid  200 302 10m;

upstream omeroweb_server {
    server 127.0.0.1:24080 fail_timeout=0;
}

server {
    ...
    location /omero/static {
        alias /home/omero/lib/python/omeroweb/static;
        expires 1D;
        add_header Cache-Control "public";
    }

        set $nocache 1;

        if ($request_uri ~* "webclient/render*") {
            set $nocache "1";
        }

location @proxy_to_app {
       
        proxy_cache               omeroweb_zone;
        proxy_cache_methods       GET;
        proxy_cache_bypass        $nocache
        proxy_no_cache            $nocache
        add_header                X-Proxy-Cache $upstream_cache_status;
        expires                   -1;
        proxy_cache_valid         200 1d;
        proxy_ignore_headers      Cache-Control Expires;
        proxy_pass_header         Set-Cookie;
        proxy_cache_use_stale     error timeout invalid_header http_500 http_502 http_504 http_404;
        proxy_set_header          X-Real-IP $remote_addr;
        proxy_set_header          X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header          Host $http_host;
        proxy_redirect            off;
        proxy_pass                http://omeroweb_server;
    }



Did you have login issues when using cache globally (across entire OMERO.web) or just with your selected URLs?

Ola