Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Z1. Notices

Albert Chen edited this page May 12, 2018 · 4 revisions

Notices

  1. 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.
  2. Never use dd(), exit() or die() function to print your debug message. It will terminate your swoole worker unexpectedly.
  3. global and static variables needs to be destroyed(reset) manually.
  4. 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');
}
  1. flush()/ob_flush()/ob_end_flush()/ob_implicit_flush() are not supported in swoole response.
  2. Don't use header()/setcookie()/http_response_code() in your response, only return in illuminate response.
  3. Request header can not exceed 8 KB. This is restricted by Swoole.
  4. By default the max size of POST data/file is 10 MB which is restricted by package_max_length in Swoole.
  5. You should have basic knowledge about multi-process programming and Swoole. If you still write your code with traditional php concept, your app might have unexpected bugs.

Clone this wiki locally