NYCPHP Meetup

NYPHP.org

[nycphp-talk] Writing daemons in PHP

Anthony Wlodarski anthony at tinkertownlabs.com
Fri Apr 8 20:34:18 EDT 2011


I don't have knowledge or expertise in this area but I have written a 
few things in node.js and using upstart to control the jobs.  However 
doing my own research on how to write a daemon in PHP you should check 
out http://simas.posterous.com/writing-a-php-daemon-application.

-Anthony

On 04/07/2011 05:38 PM, Gary Mort wrote:
> Just wondering what, in general, others are using for writing daemons in
> PHP.
>
> Just code it directly using libevent...   or using a framework such as
> phpdaemon, https://github.com/kakserpom/phpdaemon
>
>
> For a first pass, I need to set up a more intelligent CPULimit app to
> meet my specific goals.  Since all CPULimit basically does is check all
> the PID's every 2ms and send out kill to processes with SIGSTOP and
> SIGCONT - it seems simple to do the same with PHP.
>
> Just loop through every 2 ms and when cpu usage is over the threshold,
> do some quick calcs to determine how many microseconds before the
> processes can be continued in order to drop the cpu usage below the
> threshold and use libevent to set the callback time.
>
> Granted, this is supposedly "better" to program in C rather than PHP,
> but since I want to be able to do quick changes and keep the learning
> curve small, I'd rather do it in PHP until everything has been tweaked
> and perfected.  Then it's always an option to try using HipHop to
> convert it.... or if it is running well and doing what is needed, leave
> it be.
> _______________________________________________
> New York PHP Users Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/Show-Participation

-- 
Anthony Wlodarski
Lead Software Engineer
Get2Know.me
646 285 0500 x217




More information about the talk mailing list