前書き: 最近、swoole を使用して websocket を試したいと思っています。laravel と swoole をインストールしてパフォーマンスをテストしたところです。laravel9 のパフォーマンスが適切に最適化されているかどうかはわかりません。最終的なストレス テストの結果は次のとおりです。 laravels と同様~
Laradock に swoole をインストールしました
実際の操作後に問題が発生しました:
元の PHP のバージョンは 7.4 です。.env ファイルを変更してバージョンを 8.0 以降に切り替える必要があります (Laravels ではインストール時に php が 8.1 である必要があるため、設定されたままです)バージョン 8.1 へ):
もう一度実行します。ビルド コマンドは成功します。 [推奨事項: laravel ビデオチュートリアル ]
検証結果:
laravels http サーバーの設定
1. laravel プロジェクトをインストールします。多くのチュートリアルがあります。ここで参照できます:docker が存在する環境に基づくインストール済み
curl -s "https://laravel.build/laravel9" | bashCopy2.laravelsのインストール
composer require hhxsv5/laravel-sCopy3.laravels設定の公開
php artisan laravels publishCopy4. サイトの設定手順: サイトに対応するプロジェクト コードは/var/www/laravel9/public(1) laravels http サーバーを設定します
upstream laravels { # Connect IP:Port server workspace:5200 weight=5 max_fails=3 fail_timeout=30s; keepalive 16; } server { listen 80; server_name swoole.test; root /var/www/laravel9/public; index index.php index.html index.htm; # Nginx 处理静态资源,LaravelS 处理动态资源 location / { try_files $uri @laravels; } location @laravels { proxy_http_version 1.1; proxy_set_header Connection ""; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-PORT $remote_port; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header Scheme $scheme; proxy_set_header Server-Protocol $server_protocol; proxy_set_header Server-Name $server_name; proxy_set_header Server-Addr $server_addr; proxy_set_header Server-Port $server_port; proxy_pass http://laravels; } error_log /var/log/nginx/swoole_test_error.log; access_log /var/log/nginx/swoole_test_access.log; }注意: laravels プロジェクト laravel9 プロジェクトの .env ファイルに次の設定を追加する必要があります:
LARAVELS_LISTEN_IP=workspace LARAVELS_DAEMONIZE=trueCopy(2) 通常の laravel プロジェクト サイトの設定
server { listen 80; listen [::]:80; # For https # listen 443 ssl; # listen [::]:443 ssl ipv6only=on; # ssl_certificate /etc/nginx/ssl/default.crt; # ssl_certificate_key /etc/nginx/ssl/default.key; server_name laravel.test; root /var/www/laravel9/public; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php$is_args$args; } location ~ \.php$ { try_files $uri /index.php =404; fastcgi_pass php-upstream; fastcgi_index index.php; fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fixes timeouts fastcgi_read_timeout 600; include fastcgi_params; } location ~ /\.ht { deny all; } location /.well-known/acme-challenge/ { root /var/www/letsencrypt/; log_not_found off; } error_log /var/log/nginx/laravel_error.log; access_log /var/log/nginx/laravel_access.log; }(3) ローカルホストの設定
127.0.0.1 swoole.test127.0.0.1 laravel.testCopy
docker-compose stop docker-compose build workspace nginx docker-compose up -d redis mysql nginx workspaceCopy#(5) ) ワークスペースコンテナに入り、laravels を開始します
コンテナコマンドを入力します:
docker exec -it d4940755a928 /bin/bashCopy
AB パフォーマンス テストの結果
中心的な懸念は 1 秒あたりのリクエスト数 (1 秒あたりのリクエスト数)です。
これらはすべて Laradock 環境に基づいています- 同じプロジェクト コードを共有します
- 1. リクエストの総数は 100、同時実行数は 10 (左側が swoole、右側が laravel9):
2.リクエストの合計数は 1000、同時実行数は 20 (左側が swoole、右側が laravel9) );
ギャップは明らかではなく、場合によってはlaravel9 はさらに優れています。このような結果は逆転とみなされるのでしょうか ~元のアドレス: https://learnku.com /articles/73575
以上がlaravel9とlaravelのパフォーマンス競争!の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

反応、vue、andangularcanbe veintedated withlaravelbyfollowingspecificsetupSteps.1)forReact:instruectusinglaravelui、setUpComponentsInapp.js.2)forvue:uselaravel'sbuilt-invuesuptort、futureinapp.3)

Taskmanagementtoolsareessentialforeffectiveremoteprojectmanagementbyprioritizingtasksandtrackingprogress.1)UsetoolslikeTrelloandAsanatosetprioritieswithlabelsortags.2)EmploytoolslikeJiraandMonday.comforvisualtrackingwithGanttchartsandprogressbars.3)K

laravel10EnhancesperformAnceTheveralkeyfeatures.1)ItintroduceSquerybuilderCachinucedatedatabaseload.2)itoptimizeseLoquentModelloadingwithlazingproxies.3)itimprovesRoutingWithineSystem.4)itemproveStingwithingingSystem.4)

最高のフルスタックのLaravelアプリケーション展開戦略には、1。Zeroダウンタイム展開、2。ブルーグリーン展開、3。連続展開、4。Canaryリリースが含まれます。 1.ゼロダウンタイムデプロイメントは、EnvoyまたはDeployerを使用して展開プロセスを自動化して、更新時にアプリケーションを利用できるようにします。 2。ブルーとグリーンの展開により、2つの環境を維持し、迅速なロールバックを可能にすることにより、ダウンタイムの展開が可能になります。 3.継続的な展開GithubactionsまたはGitlabci/CDを使用して、展開プロセス全体を自動化します。 4。nginx構成を通じてカナリーがリリースされ、パフォーマンスの最適化と迅速なロールバックを確保するために、新しいバージョンをユーザーに徐々に宣伝します。

ToscalealAravelApplicationively、Focusondatabasesharding、Caching、Loadbalancing、andMicroservices.1)databaseShardingTodistributedataacrossMultipledatabase.2)uselaraval'scachingsmultedistestemedisemememememememedtededatedatab

ToovercomcomcommunicationbarriersindistributedTeams、使用:1)VideoCallsForface-to-faceInteraction、2)setClearResponsetimeExpectations、3)ChooseaprateCommunicationSoools、4)CreateAmCommunicationGuide、and5)

laravelbladeEnhancesFrontendTemplatinginfull stackprojectsbyofferingcleansyntaxandpowerfulfeatures.1)itallows foreasyvariabledisplayandcontrolstructures.2)bladeSupportscreating andReusing components、

laravelisidealforfull-stackapplicationsduetoitseLegantyntax、包括的なセコスシステム、およびパワーフルフィーチュア


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事

ホットツール

SAP NetWeaver Server Adapter for Eclipse
Eclipse を SAP NetWeaver アプリケーション サーバーと統合します。

MinGW - Minimalist GNU for Windows
このプロジェクトは osdn.net/projects/mingw に移行中です。引き続きそこでフォローしていただけます。 MinGW: GNU Compiler Collection (GCC) のネイティブ Windows ポートであり、ネイティブ Windows アプリケーションを構築するための自由に配布可能なインポート ライブラリとヘッダー ファイルであり、C99 機能をサポートする MSVC ランタイムの拡張機能が含まれています。すべての MinGW ソフトウェアは 64 ビット Windows プラットフォームで実行できます。

SublimeText3 中国語版
中国語版、とても使いやすい

メモ帳++7.3.1
使いやすく無料のコードエディター

Dreamweaver Mac版
ビジュアル Web 開発ツール
