我一直在研究Laravel Octane作为现有Laravel应用程序性能改进的可能性,并发现每4000-5000个请求中,多达15个请求返回失败。
我目前已经部署了laravel应用程序,并通过supervisor在/etc/supervisor/conf.d/laravel-octane-worker.conf中使用以下配置运行octane:
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/artisan octane:start --server=swoole --workers=8 --task-workers=4 --port=8089
autostart=true
autorestart=true
user=www-data
redirect_stderr=true
stdout_logfile=/var/www/html/octane-worker.log
stopwaitsecs=3600
numprocs=1使用如下的nginx配置:
server {
listen 80;
return 301 https://my_test_domain.com$request_uri;
}
server {
listen 443 ssl default_server;
#listen [::]:443 ssl default_server;
ssl on;
ssl_certificate /etc/ssl/certs/validchain.pem;
ssl_certificate_key /etc/ssl/private/prvatekey.pem;
root /var/www/html/public;
server_name my_test_domain.com;
access_log off;
error_log /var/log/log_path_here.log error;
error_page 404 /index.php;
index index.html index.htm index.php;
error_page 404 /index.php;
location / {
proxy_pass http://127.0.0.1:8089;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}看起来在辛烷值刷新上有某种类型的管理进程争用,但我无法确定问题所在。以下是请求成功后的日志:
Local: http://127.0.0.1:8089
Press Ctrl+C to stop the server
Swoole\Exception failed to listen server port[127.0.0.1:8089], Error: Address already in use[98]
0 /var/www/html/vendor/laravel/octane/bin/createSwooleServer.php:12
1 /var/www/html/vendor/laravel/octane/bin/createSwooleServer.php:12
2 /var/www/html/vendor/laravel/octane/bin/swoole-server:35发布于 2021-10-05 00:56:08
尝试在辛烷值开始逗号--max-requests=1000中设置最大请求数
https://stackoverflow.com/questions/69354357
复制相似问题