淡如水 发表于 2017-3-21 00:01:05

军哥请进,关于1.3版本在4核8G服务器上的nginx和PHP的性能优化建议

如题,相关的性能优化,该怎么做合适?

licess 发表于 2017-3-21 09:53:31

回复 1# 的帖子

默认都是自动优化了的

淡如水 发表于 2017-3-21 10:28:59

回复 2# 的帖子

好的,谢谢,阿军哥!

淡如水 发表于 2017-3-21 14:49:08

回复 2# 的帖子

阿军哥,漏问一问题。对于别人恶意用压测工具如loadruner,Jmeter之类的工具来刷网站,能通过配置文件过滤掉吗?

licess 发表于 2017-3-21 19:14:35

回复 4# 的帖子

如果是特定的useragent,可以屏蔽useragent

useragent可以日志里查看

nginx对应虚拟主机上设置

      if ($http_user_agent ~* abcde|fghijk|lmno) {
            return 444;
      }

淡如水 发表于 2017-3-23 11:48:28

回复 5# 的帖子

军哥,咱们的脚本在腾讯云上不能运行吗?
安装log会报 Couldn't resolve host 'mirrors.tencentyun.com' ,找不到这个地址,相应的脚本改怎么改,让它不连这个地址?
--- lnmp.org ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 311ms
rtt min/avg/max/mdev = 45.332/45.332/45.332/0.000 ms
DNS...ok
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
http://mirrors.tencentyun.com/epel/6/x86_64/repodata/repomd.xml: PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.tencentyun.com'"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: epel. Please verify its path and try again
include/main.sh: line 250: lsb_release: command not found
CentOS
Setting timezone...
 Installing ntp...
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
http://mirrors.tencentyun.com/epel/6/x86_64/repodata/repomd.xml: PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.tencentyun.com'"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: epel. Please verify its path and try again
23 Mar 11:43:12 ntpdate: adjust time server 173.255.246.13 offset -0.046718 sec
Thu Mar 23 11:43:12 CST 2017
 Yum remove packages...
error: package httpd is not installed
error: package httpd-tools is not installed
error: package mysql is not installed
error: package mysql-libs is not installed
error: package php-mysql is not installed
error: package php-cli is not installed
error: package php-gd is not installed
error: package php-common is not installed
error: package php is not installed
Loaded plugins: fastestmirror, security
Setting up Remove Process

淡如水 发表于 2017-3-23 12:30:33

回复 5# 的帖子

我用的是lnmp1.3-full完整的安装包,安装上需要的东西应该已经齐全,不需要下载才是,腾讯云不知道搞什么飞机。

淡如水 发表于 2017-3-23 13:11:13

解决了,解决办法如下

主要原因是腾讯云的dns问题,安装帖子中的方法目前能正常安装
http://bbs.qcloud.com/thread-3972-1-1.html

licess 发表于 2017-3-23 13:59:55

回复 6# 的帖子

腾讯云都是用内部dns才能用他们内网的源,不要就换成他们内部的dns,要不就换其他源
参考:https://bbs.vpser.net/thread-14732-1-1.html
页: [1]
查看完整版本: 军哥请进,关于1.3版本在4核8G服务器上的nginx和PHP的性能优化建议