Board logo

标题: [求助] 首字节加载慢 + connect() to unix:/tmp/php-71-cgi.sock failed [打印本页]

作者: d40355    时间: 2018-11-29 10:20     标题: 首字节加载慢 + connect() to unix:/tmp/php-71-cgi.sock failed

hi,我的wdcp下运行了discuz程序,近期发现首字节waiting ttfb加载比较慢,有时最高能到10几秒的等待时间,上了CDN打开速度是很快,不过ttfb还在。
如何能破解首字节等待太久的问题啊……

另外

connect() to unix:/tmp/php-71-cgi.sock failed (11: Resource temporarily unavailable)
后台nginx错误日志里面这个问题
网上搜了好些方法(有的说listen = /tmp/php-71-cgi.sock改成127.0.0.1 同时他提到会导致phpmyadmin打不开),我还没敢尝试……不知道哪个适用wdcp

求赐教。跪谢
以下是我的配置%

/www/wdlinux/phps/71/etc/php-fpm.conf
  1. [global]
  2. pid = /www/wdlinux/phps/71/var/run/php-fpm.pid
  3. error_log = /www/wdlinux/phps/71/var/log/php-fpm.log
  4. log_level = notice
  5. [www]
  6. listen = /tmp/php-71-cgi.sock
  7. listen.backlog = -1
  8. listen.allowed_clients = 127.0.0.1
  9. listen.owner = www
  10. listen.group = www
  11. listen.mode = 0666
  12. user = www
  13. group = www
  14. pm = dynamic
  15. pm.max_children = 20
  16. pm.start_servers = 5
  17. pm.min_spare_servers = 2
  18. pm.max_spare_servers = 12
  19. pm.max_requests = 2000
  20. request_terminate_timeout = 60
复制代码
/www/wdlinux/nginx-1.8.1/conf/nginx.conf
  1. # nginx conf conf/nginx.conf
  2. # Created by http://www.wdlinux.cn
  3. # Last Updated 2010.06.01
  4. user  www www;
  5. worker_processes  3;
  6. error_log  logs/error.log  notice;
  7. pid        logs/nginx.pid;
  8. worker_rlimit_nofile 5120;
  9. events {
  10.     use epoll;
  11.     worker_connections  5120;
  12. }

  13. http {
  14.     include       mime.types;
  15.     default_type  application/octet-stream;
  16.    
  17.     resolver 8.8.8.8;
  18.     server_names_hash_bucket_size 128;
  19.     client_header_buffer_size 256k;
  20.     large_client_header_buffers 8 64k;
  21.     client_max_body_size 50m;
  22.     client_body_buffer_size 1024k;
  23.     limit_conn_zone $binary_remote_addr zone=one:32k;
  24.     sendfile        on;
  25.     tcp_nopush     on;

  26.     fastcgi_connect_timeout 300;
  27.     fastcgi_send_timeout 300;
  28.     fastcgi_read_timeout 300;
  29.     fastcgi_buffer_size 128k;
  30.     fastcgi_buffers 256 16k;
  31.     fastcgi_busy_buffers_size 1024k;

  32.     keepalive_timeout  60;
  33.     tcp_nodelay on;

  34.     gzip  on;
  35.     gzip_min_length  1k;
  36.     gzip_buffers     4 16k;
  37.     gzip_http_version 1.0;
  38.     gzip_comp_level 2;
  39.     gzip_types       text/plain application/x-javascript text/css application/xml;
  40.     gzip_vary on;

  41.     log_format  wwwlogs  '$remote_addr - $remote_user [$time_local] $request $status $body_bytes_sent $http_referer $http_user_agent $http_x_forwarded_for';
  42.     access_log off;
  43.     #include default.conf;
  44.     include vhost/*.conf;
  45. }   
复制代码
/www/wdlinux/etc/my.cnf
  1. # mysql conf /etc/my.cnf
  2. # Created by http://www.wdlinux.cn
  3. # Last Updated 2010.06.01
  4. [client]
  5. port                = 3306
  6. socket                = /tmp/mysql.sock
  7. [mysqld]
  8. port                = 3306
  9. socket                = /tmp/mysql.sock
  10. skip-external-locking
  11. key_buffer_size = 256M
  12. max_allowed_packet = 2M
  13. table_open_cache = 512
  14. sort_buffer_size = 2M
  15. read_buffer_size = 2M
  16. read_rnd_buffer_size = 2M
  17. myisam_sort_buffer_size = 64M
  18. thread_cache_size = 128
  19. query_cache_size = 64M
  20. thread_concurrency = 8
  21. max_connections = 3000
  22. wait_timeout = 120
  23. interactive_timeout = 30
  24. max_connect_errors = 3000
  25. long_query_time = 1
  26. tmp_table_size = 64M
  27. #log-bin=mysql-bin
  28. #binlog_format=mixed
  29. #server-id        = 1
  30. [mysqldump]
  31. quick
  32. max_allowed_packet = 8M
  33. [mysql]
  34. no-auto-rehash
  35. [myisamchk]
  36. key_buffer_size = 256M
  37. sort_buffer_size = 256M
  38. read_buffer = 2M
  39. write_buffer = 2M
  40. [mysqlhotcopy]
  41. interactive-timeout
复制代码





欢迎光临 WDlinux官方论坛 (http://wdlinux.cn/bbs/) Powered by Discuz! 7.2