Re: xinetd vs php socket server
| From: | Bostjan Skufca | Date: | Mon, 28 Mar 2011 18:38:49 +0000 |
| Subject: | Re: xinetd vs php socket server | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-312102@lists.php.net to get a copy of this message | ||
Xinetd will definitely be faster way than coding your daemon in PHP.
You have to consider many other things as well:
- do your worker processes run under various UIDs (do they do
setuid/setgid)?
- do your workers die after processing each request/client or do they
process multiple connections?
- do you need inter-worker communication?
- resource locking issues, etc?
What is your goal, the function of your daemon/socket server?
You can find PHP socket server implementations around the net already:
- Nanoserv being one: http://nanoserv.si.kz/
- something of "mine": https://github.com/bostjan/PHP-application-server
Of course, it is always a good excercise to write your own. But that is not
for faint hearted :)
b.
On 28 March 2011 18:25, Nathan Nobbe <quickshiftin@gmail.com> wrote:
> Hi,
>
> I'd like to bat around some pros / cons of selecting xinetd to implement a
> socket server. From my perspective the list is something like this:
>
> xinetd pros
> . no need to rewrite forking functionality, 'server' can be written as
> simple php script
> . forking potentially faster than php-based implementation
>
> xinetd cons
> . time tradeoff learning xinetd configuration vs coding in support
> directly
> in php implementation
> . potentially less maintainable depending on staff, likely php dev team
> more capable of maintaining 100% php solution
>
> Interested in your thoughts!
>
> -nathan
>