[续2]记录“装nginx+3个tomcat+mysql,测一下1000并发访问的应用性能”的过程
2013-01-26 15:37
351 查看
app发布有点问题,分析了下,是字符集问题。
改一下locale就好了。
为了确保EN的locale资源安装了,先到cd /usr/share/locales,执行./install-language-pack en_US
用root用户在/etc/default/locale和/etc/environment里面增加两行:
LANG="en_US.UTF-8"
LANGUAGE="en_US:en"
然后执行locale-gen。得到下面的结果:
root@vps968:/usr/share/locales# su - tomcat
tomcat@vps968:~$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
session共享有点问题,用户要登录两次才能登录的进系统。
[待续]2013.1.26 15:43
------搞定了。22:43----
主要就两个地方,tomcat里,1:应用的web.xml里增加:<distributable/>,以便支持多tomcat。
2、改了nginx的配置文件,以便支持session共享。如下,红色段新增。
upstream www.xxxx.net {
server 127.0.0.1:8080 srun_id=tomcat1;
server 127.0.0.1:18080 srun_id=tomcat2;
server 127.0.0.1:28080 srun_id=tomcat3;
jvm_route $cookie_JSESSIONID|sessionid reverse;
}
server {
listen 80;
server_name www.xxxx.net;
charset utf-8;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
proxy_pass http://www.xxxx.net;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
client_max_body_size 100m;
}
加入开机自启动项目,
/etc/init.d/rc.local最后增加如下两行:
/usr/local/bin/memcached -d -m 256 -u root -p 12000 -P /tmp/memcached.pid
/usr/local/nginx/sbin/nginx
改一下locale就好了。
为了确保EN的locale资源安装了,先到cd /usr/share/locales,执行./install-language-pack en_US
用root用户在/etc/default/locale和/etc/environment里面增加两行:
LANG="en_US.UTF-8"
LANGUAGE="en_US:en"
然后执行locale-gen。得到下面的结果:
root@vps968:/usr/share/locales# su - tomcat
tomcat@vps968:~$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
session共享有点问题,用户要登录两次才能登录的进系统。
[待续]2013.1.26 15:43
------搞定了。22:43----
主要就两个地方,tomcat里,1:应用的web.xml里增加:<distributable/>,以便支持多tomcat。
2、改了nginx的配置文件,以便支持session共享。如下,红色段新增。
upstream www.xxxx.net {
server 127.0.0.1:8080 srun_id=tomcat1;
server 127.0.0.1:18080 srun_id=tomcat2;
server 127.0.0.1:28080 srun_id=tomcat3;
jvm_route $cookie_JSESSIONID|sessionid reverse;
}
server {
listen 80;
server_name www.xxxx.net;
charset utf-8;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
proxy_pass http://www.xxxx.net;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
client_max_body_size 100m;
}
加入开机自启动项目,
/etc/init.d/rc.local最后增加如下两行:
/usr/local/bin/memcached -d -m 256 -u root -p 12000 -P /tmp/memcached.pid
/usr/local/nginx/sbin/nginx
相关文章推荐
- [续1]记录“装nginx+3个tomcat+mysql,测一下1000并发访问的应用性能”的过程
- 记录“装nginx+3个tomcat+mysql,测一下1000并发访问的应用性能”的过程
- 记录mysql性能查询过程的使用方法
- 开发环境-Windows下搭建JAVA Web开发环境(含Tomcat+MySQL)-过程记录
- 阿里云服务器linux环境,从启动tomcat服务器外网访问--->绑定域名--->Navicat远程连接mysql--->阿里云服务器部署项目过程中,一定会遇到的五大问题;
- Tomcat的性能与最大并发量(1000)
- mysql存储过程出参入参,sqlserver很熟悉的一件事到mysql,捣鼓了大半天。记录一下提醒自己。勿看
- 一次tomcat应用无法访问的处理过程
- Vps中Ubuntu下安装Mysql并开启远程数据库访问过程记录
- 使用多线程模拟多用户并发访问一个或多个tomcat,测试性能 java
- Java应用Tomcat执行过程之性能调优
- 详解Centos7 64位下Nginx+Tomcat部署java web全过程以及在线离线安装Mysql
- 记录一下误删除了mysql表中的数据后的恢复过程
- Linux下Nginx+tomcat应用系统性能优化
- 记录mysql性能查询过程
- Tomcat性能 与 最大并发数(1000) ——转自Helloworld
- 记录一下在WinXP上搭建Apache的httpd+PHP+MySQL+Wordpress的过程
- tomcat应用用root账号不能访问本机mysql库解决方案
- 系统1000用户并发测试过程记录
- Java应用Tomcat执行过程之性能调优