Message Boards

load everything.jsp from NgInx to Increase performance

pradip choudhari, modified 3 Years ago.

load everything.jsp from NgInx to Increase performance

Junior Member Posts: 59 Join Date: 5/10/19 Recent Posts

Hi Team , 

We are trying to increase performance of the site , In that work , we seen 1 problem with everything.jsp . 
everything.jsp taking 3/4 of the time while loading . so we are trying to load this jsps code from NgInx server , so request will reduce to main server(tomcat) and content always load from the proxy server ( ngInx) . 
But , we tried and we are getting the response always from tomcat server only . 
How can we load everything.jsp from NgInx server ? so requests will reduces and performance will increase of the site . 


adding below attachment to show the everything.jsps loading time : 

 

thumbnail
Olaf Kock, modified 3 Years ago.

RE: load everything.jsp from NgInx to Increase performance

Liferay Legend Posts: 6396 Join Date: 9/23/08 Recent Posts

Low hanging fruit: As there are a couple of scripts loading through everything.jsp: Make sure you're not accidentally running in development mode (check your portal-ext.properties).

Also, to avoid stepping into issues that have long been fixed, consider upgrading at least to the latest GA in your major version, with this patch.

pradip choudhari, modified 3 Years ago.

RE: load everything.jsp from NgInx to Increase performance

Junior Member Posts: 59 Join Date: 5/10/19 Recent Posts

Hi Olaf , 

We are using Liferay 7 GA2 , 
and currently , we not any planning to upgrade to Liferay 7.1 or any higher version .
Can you suggest me , with current version , how can we increase the performance of everything.jsp ? 

Thanks & Regards , 
Pradip 

 

thumbnail
Christoph Rabel, modified 3 Years ago.

RE: load everything.jsp from NgInx to Increase performance

Liferay Legend Posts: 1554 Join Date: 9/24/09 Recent Posts

I didn't try it myself, but in theory it should be possible to cache everything.jsp. But I am not sure if it is worth it. I tried to cache lots of Liferay stuff before, but in general, the effort was high and the results were meh, when I measured it with a stresstest.

Putting the really, really important security fix aside that Olaf has mentioned, you should indeed consider upgrading to at least 7.0 GA6 (and apply the security fix!)

Early 7.0 performance was quite bad and it improved with each patch. 7.1 was okish. 7.0 brought a new architecture (which was good in a longterm sense, but bad for 7.0 performance). Later versions improved it.

7.3 has continued that trend, it is quite a bit faster than 7.0 (at least in my experience).

But can you show us your nginx config?

Did you create an extra location for everything.jsp? Have you set a cache key that honors the parameters? Something like e.g.:

proxy_cache_key $scheme$proxy_host$uri$is_args$args;

pradip choudhari, modified 3 Years ago.

RE: RE: load everything.jsp from NgInx to Increase performance

Junior Member Posts: 59 Join Date: 5/10/19 Recent Posts

Hi Christoph , 

I tried to place everything.jsp inside ngInx data folder and Inside config file , 
Inside location property , i used root directive for accessing from the location 
something like below- 

location = /o/frontend-js-web/ {
               root /data/everything.jsp 
            }


I am sharing my current nginx config file - 



 


worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
	server_names_hash_bucket_size  64;


    server {
		listen 80;
		
		server_name local.education.com;
		return 301 https://local.education.com.com$request_uri;
	}
	   
	server {
			  listen                443 ssl;
			server_tokens        	off;
			server_name             local.education.com;
			#ssl on;
			ssl_certificate           G:/Liferay7/_.education.com/_.education.com.cer;
			ssl_certificate_key       G:/Liferay7/_.education.com/_.education.com.key;
			#ssl_dhparam /etc/nginx/dhparam.pem;
			add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
			add_header X-Cache-Status $upstream_cache_status;
			add_header X-Content-Type-Options nosniff;
			add_header Content-Security-Policy "frame-ancestors 'self' *.educationyug.com *.authorize.net;";
			location / {
					client_max_body_size 1024M;
					proxy_pass http://localhost:8080;
					proxy_set_header X-Forwarded-Server $host;
					proxy_set_header Host $host;
					proxy_set_header X-Real-IP $remote_addr;
					proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
					proxy_set_header X-Forwarded-Proto $scheme;
					proxy_set_header Upgrade $http_upgrade;
					proxy_set_header Connection "upgrade";
					proxy_read_timeout  1200s;
					proxy_hide_header X-Frame-Options;
				}
				
			location ~* \.(js|css|png|jpg|jpeg|gif|svg|ico)$ {
				expires 5d;
				add_header Cache-Control "public, no-transform";
				proxy_pass http://localhost:8080;
			}
		
		  
		    
		server_name local.education.com;
		
	}
	 


 
}


Thanks & Regrads, 
Pradip