If I were writing a solution, I would use PHP sockets and use the UDP protocol, which is more suitable for this scenario. UDP is unreliable, but much faster than TCP, which is most often used for communication. Therefore, I assume that I will have a very lightweight PHP script that sends a couple of bytes of data to the processing server using UDP. Use AJAX to send data to a PHP script. Of course, there will be a delay, but UDP will significantly speed up the transaction.
source
share