【nginx】waiting ttfb 首字节加载慢 搜遍全网 没找到原因……求好心人帮看下(wdcp面板)

如题,首字节加载慢……用测试网站速度一般在1-10秒甚至更久。
找遍了全网也没找到原因……崩溃惹

我的是wdcp面板
我是nginx(1.8.1)+apache双系统,网站用php7.14,所以nginx是主的,我切换成nginx单系统,伪静态不能翻页了……貌似apache还起作用?还有插件用到zend。
我的服务器是阿里云的1核2G内存,带宽5M,阿里云全站CDN + OSS图片CDN。但是首字节还是很慢啊!~
(网站流量不多,一天也就1000人以内)

下面是我的DZ系统信息

系统信息

Discuz! 程序版本 Discuz! X3.4 Release 20170801

UCenter 客户端版本 UCenter 1.6.0 Release 20170101

服务器系统及 PHP Linux / PHP v7.1.4

服务器软件 nginx

服务器 MySQL 版本 5.5.54

上传许可 5M

当前数据库尺寸 120.31 MB

【nginx】waiting ttfb 首字节加载慢 搜遍全网 没找到原因……求好心人帮看下(wdcp面板)

【nginx】waiting ttfb 首字节加载慢 搜遍全网 没找到原因……求好心人帮看下(wdcp面板)

下面是mysql的配置

# mysql conf /etc/my.cnf

# Created by http://www.wdlinux.cn

# Last Updated 2010.06.01

[client]

port = 3306

socket = /tmp/mysql.sock

[mysqld]

port = 3306

socket = /tmp/mysql.sock

skip-external-locking

key_buffer_size = 256M

max_allowed_packet = 2M

table_open_cache = 512

sort_buffer_size = 2M

read_buffer_size = 2M

read_rnd_buffer_size = 2M

myisam_sort_buffer_size = 64M

thread_cache_size = 128

query_cache_size = 64M

thread_concurrency = 8

max_connections = 3000

wait_timeout = 120

interactive_timeout = 30

max_connect_errors = 3000

long_query_time = 1

tmp_table_size = 64M

#log-bin=mysql-bin

#binlog_format=mixed

#server-id = 1

[mysqldump]

quick

max_allowed_packet = 8M

[mysql]

no-auto-rehash

[myisamchk]

key_buffer_size = 256M

sort_buffer_size = 256M

read_buffer = 2M

write_buffer = 2M

[mysqlhotcopy]

interactive-timeout

下面是PHP设置
【nginx】waiting ttfb 首字节加载慢 搜遍全网 没找到原因……求好心人帮看下(wdcp面板)
下面是nginx设置

# nginx conf conf/nginx.conf

# Created by http://www.wdlinux.cn

# Last Updated 2010.06.01

user www www;

worker_processes 3;

error_log logs/error.log notice;

pid logs/nginx.pid;

worker_rlimit_nofile 5120;

events {

use epoll;

worker_connections 5120;

}

http {

include mime.types;

default_type application/octet-stream;

server_names_hash_bucket_size 128;

client_header_buffer_size 256k;

large_client_header_buffers 8 64k;

client_max_body_size 50m;

client_body_buffer_size 1024k;

limit_conn_zone $binary_remote_addr zone=one:32k;

sendfile on;

tcp_nopush on;

keepalive_timeout 60;

tcp_nodelay on;

gzip on;

gzip_min_length 1k;

gzip_buffers 4 16k;

gzip_http_version 1.0;

gzip_comp_level 2;

gzip_types text/plain application/x-javascript text/css application/xml;

gzip_vary on;

log_format wwwlogs '$remote_addr - $remote_user [$time_local] $request $status $body_bytes_sent $http_referer $http_user_agent $http_x_forwarded_for';

access_log off;

#include default.conf;

include vhost/*.conf;

}

vhost里运行了两个网站(一个www电脑站一个是m移动站,共用一个数据库,这个配置是wdcp默认生成的)

server {

listen 80;

root /www/web/网站域名_com/public_html;

server_name 网站域名.com www.网站域名.com *.网站域名.com;

index index.html index.php index.htm;

error_page 400 /errpage/400.html;

error_page 403 /errpage/403.html;

error_page 404 /errpage/404.html;

error_page 503 /errpage/503.html;

location ~ \.php(.*)$ {

fastcgi_pass unix:/tmp/php-71-cgi.sock;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $DOCUMENT_ROOT$fastcgi_script_name;

fastcgi_param PATH_INFO $2;

include fcgi.conf;

}

location ~ /\.ht {

deny all;

}

include /www/wdlinux/wdcp/rewrite/dzx35_nginx.conf;

}

server {

listen 443;

root /www/web/网站域名_com/public_html;

ssl on;

ssl_certificate cert/网站域名.com.pem;

ssl_certificate_key cert/网站域名.com.key;

ssl_prefer_server_ciphers on;

ssl_session_timeout 10m;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;

ssl_stapling on;

server_name 网站域名.com www.网站域名.com *.网站域名.com;

index index.html index.php index.htm;

error_page 400 /errpage/400.html;

error_page 403 /errpage/403.html;

error_page 404 /errpage/404.html;

error_page 503 /errpage/503.html;

location ~ \.php(.*)$ {

fastcgi_pass unix:/tmp/php-71-cgi.sock;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $DOCUMENT_ROOT$fastcgi_script_name;

fastcgi_param PATH_INFO $2;

include fcgi.conf;

}

location ~ /\.ht {

deny all;

}

include /www/wdlinux/wdcp/rewrite/dzx35_nginx.conf;

}

回答

那就不是问题。就是你的网站慢,就这么简单。。。和配置没关系,不信你写个简单的php代码,看看是不是就是毫秒的waitting

以上是 【nginx】waiting ttfb 首字节加载慢 搜遍全网 没找到原因……求好心人帮看下(wdcp面板) 的全部内容, 来源链接: utcz.com/a/86362.html

回到顶部