提问三步曲: 提问先看教程/FAQ索引(wdcp,wdcp_v3,一键包)及搜索,会让你更快解决问题
1 提供详细,如系统版本,wdcp版本,软件版本等及错误的详细信息,贴上论坛或截图发论坛
2 做过哪些操作或改动设置等
温馨提示:信息不详,很可能会没人理你!论坛有教程说明的,也可能没人理!因为,你懂的
各位linux达人,我刚弄linux服务器,菜虫一个,帮忙看下下面的配置哪些不合理,有哪些重要的配置没弄,
服务器主要用于app的访问,没有页面。数据库也不大。可是有时会很慢。远程xshell连接输入个字符都要近一分钟左右才看到,带宽是2M的
,不知道瓶颈在哪里,top看资源使用的时候cpu使用率很低。内存也没用完,可就是很慢。,望指点
1.硬件:(阿里云的)CPU:Intel(R) Xeon(R) CPU E5-2430 0 @ 2.20GHz 4核
内存:4G
2.系统:
Ubuntu 12.04 64位 安全加固版,装了tomcat6,mysql5.1 wdcp 2.5
3.tomcat 配置:
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml"
maxActive="400"
maxIdle="10"
maxWait="18000000"/>
</GlobalNamingResources>
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443"
maxThreads="500"
minSpareThreads="10"
maxSpareThreads="100"
acceptCount="100"
enableLookups="false"
/>
4.Mysql配置:
[mysqld]
port
= 3306
socket
= /tmp/mysql.sock
init_connect = 'SET autocommit=0'
skip-locking
key_buffer_size = 256M
max_allowed_packet = 16M
table_open_cache = 512
sort_buffer_size = 32M
net_buffer_length = 512K
read_buffer_size = 10M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
wait_timeout = 2880000
interactive_timeout = 2880000
net_read_timeout = 10
max_connections = 500
net_retry_count = 2
tmp_table_size = 50M
table_cache=512
query_cache_size = 64M
thread_cache_size = 16
# log slow query
log-slow-queries = /var/lib/mysql/my.slow.log
long_query_time = 1
# log-queries-not-using-indexes = 1
# log-slow-admin-statements = 1
server-id
= 1
# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = /www/wdlinux/mysql-5.1.61/var
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /www/wdlinux/mysql-5.1.61/var
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 1G
innodb_additional_mem_pool_size = 16M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 256M
innodb_log_files_in_group=3
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 50
innodb_file_per_table=1
innodb_file_io_threads=4
innodb_open_files=500
innodb_flush_method=O_DIRECT
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
5.JAVA配置:
export JAVA_OPTS="-server -Xms512m -Xmx1024m -XXermSize=128m -XX:MaxNewSize=512m -XX:MaxPermSize=512m -Djava.awt.headless=true" |