Speeding Up Alfresco and Share using Nginx Reverse/Caching Frontend Proxy Ishara Fernando Senior Linux Systems Administrator
Key Considerations For a content Management application based on web, we should consider the following such as Proxy request so that application ports shouldn’t be exposed to the outside world Caching Content for High performance Webpage loading speed Load balancing for High performance
Key Considerations For a content Management application based on web, we should consider the following such as Proxy request so that application ports shouldn’t be exposed to the outside world Caching Content for High performance Webpage loading speed Load balancing for High performance
Key Considerations For a content Management application based on web, we should consider the following such as Proxy request so that application ports shouldn’t be exposed to the outside world Caching Content for High performance Webpage loading speed Load balancing for High performance
Choose the Web Proxy Server Considering the requirement and the key list of performance criteria, we have the following options for the web proxy Apache Nginx Oracle Weblogic Windows IIS Lighthttpd IBM HTTP Server
Why Nginx, not Apache ? NginxApache Event DrivenProcess Driven Does not Create a New process for each request Creates a New process for each request Best for serving Static Page content (Such as Alfresco) Best for serving Dynamic Pages Performance doesn’t rely on the underlying hardware Performance rely on the underlying hardware
Why Nginx, not Apache ? NginxApache Event DrivenProcess Driven Does not Create a New process for each request Creates a New process for each request Best for serving Static Page content (Such as Alfresco) Best for serving Dynamic Pages Performance doesn’t rely on the underlying hardware Performance rely on the underlying hardware
Reverse Proxy for Alfresco When do we use Nginx as a Reverse Proxy ?
Reverse Proxy for Alfresco ## Example Reverse proxy configuration for /alfresco and /share location / { rewrite ^/$ /share; } location /share { proxy_pass proxy_cache alfresco-cache; } location /alfresco { proxy_pass proxy_cache alfresco-cache; }
Reverse Proxy for Alfresco ## Example Reverse proxy configuration for /alfresco and /share location / { rewrite ^/$ /share; } location /share { proxy_pass proxy_cache alfresco-cache; } location /alfresco { proxy_pass proxy_cache alfresco-cache; }
Caching Content of Alfresco Why cache content of Alfresco ?
Caching Content Configurations ##An Example HTTP Block configuration for caching content on Local Disk http { include /etc/nginx/mime.types; default_type application/octet-stream; ….. ….. proxy_buffering on; proxy_cache_path /var/cache/nginx keys_zone=alfresco-cache:1512m inactive=1d; include /etc/nginx/conf.d/*.conf; }
Caching Content Configurations ##An Example HTTP Block configuration for caching content on Local Disk location /share { proxy_pass proxy_cache alfresco-cache; } location /alfresco { proxy_pass proxy_cache alfresco-cache; }
Speeding up Webpage loading of Alfresco Nginx pagespeed module can be used to increase the performance of loading of Alfresco. Below are the results of web performance tests before and after configuring Nginx pagespeed module Before Configuring Nginx Pagespeed Module After Configuring Nginx Pagespeed Module
Speeding up Webpage loading of Alfresco Nginx pagespeed module can be used to increase the performance of loading of Alfresco. Below are the results of web performance tests before and after configuring Nginx pagespeed module Before Configuring Nginx Pagespeed Module After Configuring Nginx Pagespeed Module
Nginx Pagespeed Module for speeding up webpage loading ## Below is an example block of configurations which utilizes the Nginx pagespeed module http { pagespeed on; pagespeed FileCachePath /var/ngx_pagespeed_cache; pagespeed EnableFilters combine_css,combine_javascript,rewrite_javascript; }
Load balancing across an Alfresco Cluster Nginx has the inbuilt capability of Load balancing incoming requests across an Alfresco Cluster using nginx upstream module.
Load balancing Configurations ## Below is a configuration block of load balancing requests between a 2 Node Alfresco Cluster using IP_HASH loadbalancing algorithm upstream example.com { ip_hash; server A.B.C.D:8080 max_fails=2 fail_timeout=10s weight=1; server A.B.C.E:8080 max_fails=2 fail_timeout=10s weight=1; }example.com
Load balancing Configurations ## Below is a configuration block of load balancing requests between a 2 Node Alfresco Cluster using IP_HASH loadbalancing algorithm upstream example.com { ip_hash; server A.B.C.D:8080 max_fails=2 fail_timeout=10s weight=1; server A.B.C.E:8080 max_fails=2 fail_timeout=10s weight=1; }example.com
Load balancing Configurations ## Below is a configuration block of load balancing requests between a 2 Node Alfresco Cluster using IP_HASH loadbalancing algorithm upstream example.com { ip_hash; server A.B.C.D:8080 max_fails=2 fail_timeout=10s weight=1; server A.B.C.E:8080 max_fails=2 fail_timeout=10s weight=1; }example.com
Nginx Failover Configurations ## Below specifies nginx that alfresco node1 is down upstream example.com { ip_hash; server A.B.C.D:8080 max_fails=2 fail_timeout=10s weight=1 down ; server A.B.C.E:8080 max_fails=2 fail_timeout=10s weight=1; }example.com
End Of Presentation Thank you !!!!