Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
UP YOUR LIFERAY
DEPLOYMENT
Copyright 2000 2009 Liferay, Inc.
All Rights Reserved.
No material may be reproduced electronically or in print, duplicated,
copied, sold, resold, or otherwise exploited for any commercial purpose
without express written consent of Liferay, Inc.
Rich Sezov
Knowledge Manager
Liferay, Inc.
Number 12:
Flood the data center with gamma radiation and then
make the server angry by rebooting it over and over
again.
Number 11:
Detach Jon Stewart's mouth from the network router.
<!-<filter-mapping>
<filter-name>SSO Ntlm Filter</filter-name>
<url-pattern>/c/portal/login</url-pattern>
</filter-mapping>
-->
Number 10:
Use EMM386 to put all the TSRs into high memory to free
upoh, never mind, wrong decade.
From
To
Java Heap
Old Generation
Permanent Generation
Garbage Collection
When Garbage Collection occurs, here's what happens:
Young Generation
X
To
Old Generation
Permanent Generation
When all of this is done, the space is compacted, so the memory is contiguous.
JVM Options
NewSize, MaxNewSize: The initial size and the maximum size of the New or
Young Generation.
+UseParNewGC: Causes garbage collection to happen in parallel, using multiple
CPUs. This decreases garbage collection overhead and increases application
throughput.
+UseConcMarkSweepGC: Use the Concurrent Mark-Sweep Garbage Collector. This
uses shorter garbage collection pauses, and is good for applications that have a
relatively large set of long-lived data, and that run on machines with two or
more processors, such as web servers.
+CMSParallelRemarkEnabled: For the CMS GC, enables the garbage collector to
use multiple threads during the CMS remark phase. This decreases the pauses
during this phase.
ServivorRatio: Controls the size of the two survivor spaces. It's a ratio between
the survivor space size and Eden. The default is 25. There's not much bang for
the buck here, but it may need to be adjusted.
ParallelGCThreads: The number of threads to use for parallel garbage collection.
Should be equal to the number of CPU cores in your server.
Number 9:
Tell the OS it's been featured on America's Most Wanted
andhey look, you better run: I see some FBI agents
coming this way!
Number 8:
Take a queue from Speed: configure the server so that
any time the pages per second drops below your defined
threshold, it'll blow up. That'll get it moving.
Number 7:
Solr is an open source enterprise search server based on the Lucene Java search
library, with XML/HTTP and JSON APIs, hit highlighting, faceted search, caching,
replication, a web administration interface and many more features. It runs in a Java
servlet container such as Tomcat.
Solr allows you to abstract out of your Liferay installation everything that has to
do with search, and run search from a completely separate environment.
Number 6:
That's it, we have no other choice: go to Ludicrous Speed!
Number 5:
Use a Redundant Array of Impelling Rodents (RAIR).
Number 4:
Liferay Configuration
Step 1: Set the following property in your portal-ext.properties file:
theme.virtual.path=/var/www/themes
Step 3: Set your server proxy to exclude from the proxy the path to the theme.
This will vary from web server to web server. For Apache and mod_proxy, you
would add this to your configuration file:
ProxyPass /themes !
With this configuration, Liferay will deploy your theme to the path specified,
which will be served up by your web server.
Number 3:
Put some of that Comcast Speed Boost into the server.
Instead of standard <img src> tags, use the <liferay-ui:icon> tag as shown above.
Number 2:
Buy another server from the planet Krypton.
jdbc.read.driverClassName=com.mysql.jdbc.Driver
jdbc.read.url=jdbc:mysql://dbread.com/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.read.username=
jdbc.read.password=
jdbc.write.driverClassName=com.mysql.jdbc.Driver
jdbc.write.url=jdbc:mysql://dbwrite.com/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=fal
jdbc.write.username=
jdbc.write.password=
Make sure the spring config is included in your portal-ext.properties file (see
next slide)
A-D: Database 1
E-H: Database 2
(etc)
Liferay Sharding
Liferay supports sharding through portal instances.
You can create separate portal instances with your application in them, enable
sharding, and Liferay will use its round robin shard selector to determine where
users should go.
To enable sharding, use your portal-ext.properties file:
shard.selector=com.liferay.portal.dao.shard.RoundRobinShardSelector
More Sharding
spring.configs=\
META-INF/base-spring.xml,\
\
META-INF/hibernate-spring.xml,\
META-INF/infrastructure-spring.xml,\
META-INF/management-spring.xml,\
\
META-INF/util-spring.xml,\
\
META-INF/editor-spring.xml,\
META-INF/jcr-spring.xml,\
META-INF/messaging-spring.xml,\
META-INF/scheduler-spring.xml,\
META-INF/search-spring.xml,\
\
META-INF/counter-spring.xml,\
META-INF/document-library-spring.xml,\
META-INF/lock-spring.xml,\
META-INF/mail-spring.xml,\
META-INF/portal-spring.xml,\
META-INF/portlet-container-spring.xml,\
META-INF/wsrp-spring.xml,\
\
META-INF/mirage-spring.xml,\
\
#META-INF/dynamic-data-source-spring.xml,\
META-INF/shard-data-source-spring.xml,\
\
Number 1:
Red Bull anyone?
They have JavaScript after the HTML tag. That's not according to spec, but all the
browsers support it, and it improves performance.
JavaScript in Portlets
If you have JavaScript in your portlets, you can control where Liferay positions it
via the liferay-portlet.xml file.
<footer-portlet-javascript>/html/portlet/message_boards/javascript.js</footer-portlet-javascript>