php r很卡,Laravel 在高并发下很卡?求大神解答

区内找到了这篇文章和我遇到的查不到,在执行index.php的时候开启php-fpm慢日志发现php-fpm执行时间长,导致php-fpm占用着cpu一直居高不下.

没有几个人回答,是因为这个问题不值得讨论?

script_filename = /home/wwwroot/vote/public/index.php

[0x00007f885cc182c0] curl_exec() /home/wwwroot/vote/app/Tools/HttpsResponse.php:11

[0x00007f885cc18130] https_request() /home/wwwroot/vote/app/Tools/WeixinUtil.php:268

[0x00007f885cc18020] get_userinfo() /home/wwwroot/vote/app/Http/Middleware/WXVote.php:56

[0x00007f885cc17870] handle() /home/wwwroot/vote/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:148

[0x00007f885cc17650] Illuminate\Pipeline\{closure}() /home/wwwroot/vote/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

[0x00007f885cc174b0] Illuminate\Routing\{closure}() /home/wwwroot/vote/app/Http/Middleware/SiteLog.php:19

[0x00007f885cc172f0] handle() /home/wwwroot/vote/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:148

[0x00007f885cc170d0] Illuminate\Pipeline\{closure}() /home/wwwroot/vote/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

[0x00007f885cc16f30] Illuminate\Routing\{closure}() /home/wwwroot/vote/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php:41

[0x00007f885cc16e10] handle() /home/wwwroot/vote/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:148

[0x00007f885cc16bf0] Illuminate\Pipeline\{closure}() /home/wwwroot/vote/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

[0x00007f885cc16a50] Illuminate\Routing\{closure}() /home/wwwroot/vote/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:65

[0x00007f885cc16790] handle() /home/wwwroot/vote/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:148

[0x00007f885cc16570] Illuminate\Pipeline\{closure}() /home/wwwroot/vote/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

[0x00007f885cc163d0] Illuminate\Routing\{closure}() /home/wwwroot/vote/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php:49

[0x00007f885cc162b0] handle() /home/wwwroot/vote/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:148

[0x00007f885cc16090] Illuminate\Pipeline\{closure}() /home/wwwroot/vote/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

[0x00007f885cc15ef0] Illuminate\Routing\{closure}() /home/wwwroot/vote/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:64

其中查了curl_exec(),get_userinfo()发现他们在网站人数少的时候不会出现。

现在当在线人数300左右就一直很卡,php-fpm一直是在80以上.

4G4核服务器100M共享带宽撑不住500人即时在线访问。PHP-FPM一直高居不下

配置如下

Laravel5.4框架

PHP版本7.01

Mysql用2核2G的RDS

服务器CentOS7.2

cat /usr/local/php/etc/php-fpm.d/www.conf |egrep -v '^$|^;|^$'

#php-fpm 配置

[www]

user = nginx

group = nginx

listen = 127.0.0.1:9000

pm = static

pm.max_children = 8

pm.start_servers = 8

pm.min_spare_servers = 2

pm.max_spare_servers = 4

pm.max_requests = 800

request_terminate_timeout = 100

request_slowlog_timeout = 5s

slowlog = /tmp/slow.log

cat /etc/nginx/nginx.conf| egrep -v '^;|^$|^#'

#nginx 配置

user nginx;

worker_processes auto;

error_log /var/log/nginx/error.log;

pid /var/run/nginx.pid;

include /usr/share/nginx/modules/*.conf;

events {

worker_connections 1024;

}

http {

log_format main '$remote_addr - $remote_user [$time_local] "$request" '

'$status $body_bytes_sent "$http_referer" '

'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;

tcp_nopush on;

tcp_nodelay on;

keepalive_timeout 65;

types_hash_max_size 2048;

include /etc/nginx/mime.types;

default_type application/octet-stream;

# Load modular configuration files from the /etc/nginx/conf.d directory.

# See http://nginx.org/en/docs/ngx_core_module.html#include

# for more information.

include /etc/nginx/conf.d/*.conf;

}

百度的统计,在线人数303

浏览量(PV)

访客数(UV)

IP数

跳出率

平均访问时长195,557

78,823

60,862

41.31%

00:03:50

图片上传不来,只能打表格,同志们,帮忙分析下?是php-fpm的配置不行还是laravel不适合做这种高并发的程序?

即时连接数

netstat -an|awk '/^tcp/{a[$NF]++}END{for (i in a) print i,a[i]}'

TIME_WAIT 3938

CLOSE_WAIT 6

FIN_WAIT1 72

SYN_SENT 160

FIN_WAIT2 423

ESTABLISHED 1959

SYN_RECV 9

LAST_ACK 19

LISTEN 7

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值