NossOriginal post
Rank 1: Thread
I am currently testing around with realtime. I setup a second server with Dragonfly instead of Redis and I am now performance and stress testing a bit. But doing so the main Appwrite server gets kind of overwelmed even though the Dragonfly Server is kind of chilling its life. Furthermore the Realtime container is screaming errors in my face like:
Plain text
Fatal error: Uncaught Swoole\Error: Socket#115 has already been bound to another coroutine#3, reading of the same socket in coroutine#8 at the same time is not allowed in /usr/src/code/app/init.php:861Stack trace:#0 /usr/src/code/app/init.php(861): PDO->__construct('mysql:host=mari...', 'user', Object(SensitiveParameterValue), Array)#1 @swoole/library/core/Database/PDOProxy.php(33): {closure}()#2 /usr/src/code/app/init.php(860): Swoole\Database\PDOProxy->__construct(Object(Closure))#3 /usr/src/code/app/init.php(888): {closure}()#4 /usr/src/code/vendor/utopia-php/pools/src/Pools/Pool.php(189): {closure}()#5 /usr/src/code/app/realtime.php(90): Utopia\Pools\Pool->pop()#6 /usr/src/code/app/realtime.php(456): getProjectDB(Object(Utopia\Database\Document))#7 [internal function]: {closure}(70136, Object(Appwrite\Utopia\Request))#8 /usr/src/code/vendor/utopia-php/websocket/src/WebSocket/Adapter/Swoole.php(93): call_user_func(Object(Closure), 70136, Object(Swoole\Http\Request))#9 [internal function]: Utopia\WebSocket\Adapter\Swoole->Utopia\WebSocket\Adapter\{closure}(Object(Swoole\WebSocket\Server), Object(Swoole\Http\Request))#10 {main} thrown in /usr/src/code/app/init.php on line 861Sometimes:
Plain text
[Error] Message: Missing or unknown project IDConnection open (user: 71435)[Error] File: /usr/src/code/app/realtime.php[Error] Line: 445Pub/sub connection established (worker: 0)[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exception[Error] Type: Exceptionor:
Plain text
[2024-06-28 15:44:11 $7.0] WARNING Server::check_worker_exit_status(): worker(pid=11585, id=21) abnormal exit, status=255, signal=0Connection open (user: 71827)Connection open (user: 71590)[Error] Message: SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.[Error] Message: SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.[Error] Message: Missing or unknown project IDSummary
Developers encountering various error messages in Realtime container such as pool size issues, abnormal worker exits, unbuffered queries, and unknown project IDs. The issue might be related to conflicting coroutines or missing project identifier. Check socket bindings, handle unbuffered queries properly, and ensure all project IDs are valid in the code. Additionally, consider reporting bugs to Swoole developers for potential fixes.