SHARED MEMORY STATE MANAGEMENT IN MULTI-WORKER PHP WEBSOCKET SERVERS: A CASE STUDY WITH OPENSWOOLE AND SWOOLE\TABLE
Abstract
The research investigates how PHP WebSocket servers with multiple workers share their memory state through shared memory. Persistent WebSocket servers in multi-worker PHP environments experience a state-sharing issue which does not affect regular PHP usage because worker processes use separate memory areas and normal PHP structures cannot connect those memory areas. The research work evaluates the issue based on the OCPP 1.6 electric vehicle charging management system we created and deployed on OpenSwoole. On the initial testing we tracked the failure modes when per-process PHP arrays began to differ between workers. It made us perform transformation from PHP arrays to Swoole\Table for shared memory purposes as well as designed a bidirectional lookup table which enabled command routing between different workers. Swoole\Table provided us an efficient solution to track connections with sufficient capacity for our operational needs.
Fields of Study & Subjects
Mobile and Web Applications
Parallel Computing and Optimization Techniques
Distributed and Parallel Computing Systems
Publication details
- Journal / source
- CyberLeninK (CyberLeninka)
- Publication date
- 16 March 2026
- Language
- EN