Tomcat调优及JMX监控

实验背景

======================================================

系统版本:CentOS release 6.5 (Final)

Tomcat版本: Apache-tomcat-7.0.54



Tomcat介绍:

Tomcat是Apache 软件基金会(Apache Software Foundation)的Jakarta 项目中的一个核心项目,由Apache、Sun 和其他一些公司及个人共同开发而成。由于有了Sun 的参与和支持,最新的Servlet 和JSP 规范总是能在Tomcat 中得到体现,Tomcat 5支持最新的Servlet 2.4 和JSP 2.0 规范。因为Tomcat 技术先进、性能稳定,而且免费,因而深受Java 爱好者的喜爱并得到了部分软件开发商的认可,成为目前比较流行的Web 应用服务器。目前最新版本是8.0。

======================================================

1
2
Tomcat 7最新版本下载链接:
http://mirrors.cnnic.cn/apache/tomcat/tomcat-7/v7.0.56/bin/apache-tomcat-7.0.56.tar.gz
1
2
Tomcat 安装:
tar zxvf apache-tomcat-7.0.54.tar.gz -C /opt/
1
2
3
4
5
6
7
8
jsvc编译及调优:
cd apache-tomcat-7.0.54/bin
tar zxvf commons-daemon-native.tar.gz
cd commons-daemon-1.0.x-native-src/unix
./configure
make -j4
cp jsvc ../../
cd ../../
1
2
添加tomcat用户,后面用来启动tomcat进程:
useradd -s /sbin/nologin tomcat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
jsvc help文件:
# export JAVA_HOME=/opt/jdk1.7.0_60/
# ./jsvc --help
Usage: jsvc [-options] class [args...]
Where options include:
-help | --help | -?
show this help page (implies -nodetach)
-jvm
use a specific Java Virtual Machine. Available JVMs:
'server'
-client
use a client Java Virtual Machine.
-server
use a server Java Virtual Machine.
-cp | -classpath
set search path for service classes and resouces
-java-home | -home
set the path of your JDK or JRE installation (or set
the JAVA_HOME environment variable)
-version
show the current Java environment version (to check
correctness of -home and -jvm. Implies -nodetach)
-showversion
show the current Java environment version (to check
correctness of -home and -jvm) and continue execution.
-nodetach
don't detach from parent process and become a daemon
-debug
verbosely print debugging information
-check
only check service (implies -nodetach)
-user
user used to run the daemon (defaults to current user)
-verbose[:class|gc|jni]
enable verbose output
-cwd
set working directory to given location (defaults to /)
-outfile
Location for output from stdout (defaults to /dev/null)
Use the value '&2' to simulate '1>&2'
-errfile
Location for output from stderr (defaults to /dev/null)
Use the value '&1' to simulate '2>&1'
-pidfile
Location for output from the file containing the pid of jsvc
(defaults to /var/run/jsvc.pid)
-D=
set a Java system property
-X

你可能感兴趣的:(Tomcat调优及JMX监控)