Chat daemon : Recompile PHP with a larger value of FD_SETSIZE

Chat daemon : Recompile PHP with a larger value of FD_SETSIZE

by Stéphanie Lanthier -
Number of replies: 1

Dear community members,


I am trying to use the chat server daemon of a Moodle 1.9.14 installation on a linux centos 5 _x64 server,  with php-v5.3.

I launched the chat daemon at the command line as the "moodle" user like this :

 cd mod/chat

 php chatd.php --start -l /var/log/chatd.log

At the first glance, the behavior is ok, and we can use the chat succesfully.


But, after around 90 minutes, this message begins to be written in the log file :

 CRITICAL [php] socket_select(): You MUST recompile PHP with a larger value of FD_SETSIZE It is set to 1024, but you have descritors numbered at least as high as 1024. --enable-fd-setsize=2048 is recommended, but you may want to set it to equal the maximum number of open files supported by your system, in order to avoid seeign this error again at a later date. on line 701.

 

The chat windows are therefore blank.

As the moodle user, here's the result of " ulimit -n " : 65534.

 

Could some tell me if I really have to recompile php in order to use the chat daemon under a configuration like mine?

 

Best regards,

Stéphanie

 

 

Average of ratings: -
In reply to Stéphanie Lanthier

Re: Chat daemon : Recompile PHP with a larger value of FD_SETSIZE

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Stephanie,
the problem is that the chat usage is somewhat aggressive and you're hitting the default limits of your PHP. AFAIK there's no workaround but recompiling PHP.

HTH,
Matteo