Difference between revisions of "SUNScholar/Prepare Ubuntu/S08"

From Libopedia
Jump to navigation Jump to search
m
 
(57 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<center>
 
<center>
'''[[SUNScholar/Prepare Ubuntu|Prepare Ubuntu - Index]]'''
+
  '''[[SUNScholar/Prepare Ubuntu/S09|NEXT - STEP 9]]'''
 
</center>
 
</center>
  
==Step 8. Setup the environment variables==
+
==Step 8. Configure the environment variables==
==Step 8.1 Java  environment settings for Tomcat webapp server==
 
To setup the environment variables for Tomcat java web applications, type the following:
 
nano /etc/default/tomcat6
 
  
Check the following for comparison:
+
==Step 8.1 Java environment settings for other java web applications==
 +
<font color="red">'''*** To setup the environment variables for other java applications, type the following: ***'''</font>
 +
sudo nano /etc/environment
 +
 
 +
Copy and paste the following '''to the bottom of the file'''.
 
<pre>
 
<pre>
# You may pass JVM startup parameters to Java here. If unset, the default
+
JAVA_HOME="/usr/lib/jvm/default-java"
# options (-Djava.awt.headless=true -Xmx128m) will be used.
+
JAVA_OPTS="-Djava.awt.headless=true -Xmx2048m -Xms1024m -Dfile.encoding=UTF-8"
#JAVA_OPTS="-Djava.awt.headless=true -Xmx128m"
 
JAVA_OPTS="-Djava.awt.headless=true -Xms1024m -Xmx2048m -XX:MaxPermSize=1024m"
 
 
</pre>
 
</pre>
  
{{NANO}}
+
Save and exit the file.
  
===Java  environment settings used for [http://scholar.sun.ac.za SUNScholar]===
+
==Step 8.2 Increase number of open files available==
Your settings will depend on how much RAM you have available to assign to the Tomcat server. See graph below as well.
+
Open the following file as follows:
JAVA_OPTS="-Djava.awt.headless=true -Xmx8192m -Xms4096m -XX:PermSize=4096m -XX:MaxPermSize=8192m"
+
  sudo nano /etc/security/limits.conf
 
+
Add the following to '''the bottom of the file''':
Graph of RAM memory usage on SUNScholar.
 
 
 
[[File:Sunscholar-memory-year.png]]
 
 
 
==Step 8.2 Java environment settings for other java web applications==
 
To setup the environment variables for other java applications (such as the Handle and SOLR servers), type the following:
 
  nano /etc/environment
 
 
 
Copy and paste the following to the bottom of the file.
 
 
<pre>
 
<pre>
JAVA_HOME="/usr/lib/jvm/java-6-sun"
+
*            hard      nofile          65536
JAVA_OPTS="-Djava.awt.headless=true -Xmx1024m -Xms512m"
+
*            soft      nofile          65536
 
</pre>
 
</pre>
  
{{NANO}}
+
Save and exit the file.
  
==Step 8.3 Increase number of open files available==
+
''Make sure to check the files open parameter with the '''next computer reboot''' by typing the following as the root user:''
Open the following file as follows:
 
nano /etc/security/limits.conf
 
Add the following to the bottom of the file:
 
<pre>
 
*            hard      nofile          65536
 
*            soft      nofile          65536
 
</pre>
 
  
{{NANO}}
+
ulimit -n
  
Make sure to check the files open parameter with the next computer reboot by typing the following:
+
==Step 8.3: Setup file creation permissions==
 +
nano $HOME/.bashrc
 +
Add the following to '''the bottom of the file'''.
 +
umask 002
  
sudo ulimit -n
+
Save and exit the file.
  
 
==References==
 
==References==
*http://en.wikipedia.org/wiki/Java_performance
+
*http://en.wikipedia.org/wiki/Environment_variable
[[File:Sunscholar-java.png]]
+
*http://wiki.apache.org/tomcat/FAQ/Memory
 +
*http://en.wikipedia.org/wiki/Java_performance#Memory_usage
 +
*http://javaperformancetuning.com
 +
*http://wiki.lib.sun.ac.za/index.php/SUNScholar/Optimisations
 +
*https://wiki.duraspace.org/display/DSDOC3x/Performance+Tuning+DSpace
  
   '''[[SUNScholar/Prepare Ubuntu/S07|PREVIOUS]]'''
+
<center>
 +
   '''[[SUNScholar/Prepare Ubuntu/S07|PREVIOUS - STEP 7]]'''
 +
</center>
  
  '''[[SUNScholar/Prepare Ubuntu/S09|NEXT]]'''
+
[[Category:Installation]]
 +
__NOTOC__

Latest revision as of 23:50, 9 June 2016

 NEXT - STEP 9

Step 8. Configure the environment variables

Step 8.1 Java environment settings for other java web applications

*** To setup the environment variables for other java applications, type the following: ***

sudo nano /etc/environment

Copy and paste the following to the bottom of the file.

JAVA_HOME="/usr/lib/jvm/default-java"
JAVA_OPTS="-Djava.awt.headless=true -Xmx2048m -Xms1024m -Dfile.encoding=UTF-8"

Save and exit the file.

Step 8.2 Increase number of open files available

Open the following file as follows:

sudo nano /etc/security/limits.conf

Add the following to the bottom of the file:

*            hard       nofile          65536
*            soft       nofile          65536

Save and exit the file.

Make sure to check the files open parameter with the next computer reboot by typing the following as the root user:

ulimit -n

Step 8.3: Setup file creation permissions

nano $HOME/.bashrc

Add the following to the bottom of the file.

umask 002

Save and exit the file.

References

 PREVIOUS - STEP 7