Notices
- Please reload or restart the swoole_http_server after released your code. Because the Laravel program will be kept in memory after the swoole_http_server started. That's why the swoole_http_server has high performance.
- Never use
dd()
,exit()
ordie()
function to print your debug message. It will terminate your swoole worker unexpectedly. global
andstatic
variables needs to be destroyed(reset) manually.- Infinitely appending element into static/global variable will lead to memory leak.
- // Some class
- class Test
- {
- public static $array = [];
- public static $string = '';
- }
- // Controller
- public function test(Request $req)
- {
- // Memory leak
- Test::$array[] = $req->input('param1');
- Test::$string .= $req->input('param2');
- }
flush()
/ob_flush()
/ob_end_flush()
/ob_implicit_flush()
are not supported in swoole response.- Don't use
header()
/setcookie()
/http_response_code()
in your response, only return in illuminate response. - Request header can not exceed
8 KB
. This is restricted by Swoole. - By default the max size of POST data/file is
10 MB
which is restricted bypackage_max_length
in Swoole. - You should have basic knowledge about multi-process programming and Swoole. If you still write your code with traditional php concepts, your app might have unexpected bugs.
当前内容版权归 Laravel-Swoole 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 Laravel-Swoole .