Telvin Nguyen
Telvin Nguyen

Reputation: 3559

Ratchet - The IO Server suddenly stop working

I have run the ratchet IOServer on my server, everything works fine except it stop working randomly after a day.

$server = IoServer::factory(
    new HttpServer(
        new WsServer(
            new AppServer()
        )
    ),
    8082
);
$server->run();

Port is free to use, I am using the supervisord to control my daemon process. When I recheck whether the process is running or not, I can see the process is still there, but the Ratchet server basically could not be connected to anymore. it starts working properly by the following command

$ supervisorctl restart appserver

I have no idea what going on. In current situation, I have to restart it over again after 1 day

# supervisorctl

  appserver                      RUNNING   pid 29083, uptime 1 day, 2:03:20

(I have used the forever before, it gave me the same result)

Do I need to modify the duration of the ratchet server settings somewhere?

Upvotes: 2

Views: 782

Answers (1)

Telvin Nguyen
Telvin Nguyen

Reputation: 3559

On my server, there is a code which was using the database connection. I guess sometimes it dropped and the server is failed to continue. By running a script to restart the server every hour is my workaround.

Upvotes: 1

Related Questions