FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » php daemon
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: php daemon [message #179650 is a reply to message #179642] Thu, 15 November 2012 16:25 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 11/15/2012 10:09 AM, Goran wrote:
> On 15.11.2012 14:46, Jerry Stuckle wrote:
>> On 11/15/2012 8:08 AM, Goran wrote:
>>> On 14.11.2012 11:51, Jerry Stuckle wrote:
>>>> You're the one who claimed life's a kludge, so yours must be. Mine
>>>> isn't.
>>>
>>> As I can see, you tend to overcomplicate things, that's why I believe
>>> your life is a mess.
>>>
>>
>> Nope, you're the one who had to put together a kludge instead of using a
>> more appropriate language.
>
> I guess you are the kind of person which prefer to buy a car instead of
> paying for single taxi drive.
>

Absolutely nothing to do with the question. I prefer to do it *right*.

>>>> Yes, it is a common pattern for people who don't know better.
>>>
>>> Maybe it's time for you to start defining what's wrong with my example
>>> (after so much bs talk). Define kludge.
>>>
>>
>> You have to keep stopping and starting it, for one thing. And in your
>> loop you need to sleep() for a while.
>
> Every daemon needs loop, sleep is completely optional in every language
> (it's just an example). Whats wrong with restarting? It's not your job,
> it's supervisord's job. Even regular daemons need autorestarting for
> failover sometimes.
>

Yes, but good daemons don't need to stop and restart. They also don't
use sleep().

As for restarting - extra overhead on the processor, for one thing. But
mainly the daemon loses any existing values, and is not available during
the restart procedure.

I can imagine how far an ftp server daemon would go if you had to log on
after every ten blocks were uploaded!

>> And you confuse the "stateless nature of the web" with daemons - they
>> have nothing to do with each other.
>
> You took it out of context, how appropriate...
>

Nope. You're the one who mentioned them together.

> PHP is scripting language primarily made for web - not designed to deal
> with long running applications. Therefor, it's memory management is not
> so precise - it's optimized for performance, not for memory usage.
> Therefore, it's ideal for "stateless nature of the web", because there
> is no need to carry state among http requests.
>

PHP is written as a web language, but it's also good for scripting
files. And no, it is not "optimized for performance". It is "optimized
for ease of coding". PHP performance is actually pretty bad when
compared to other languages like C. But while you *can* use C for web
projects, it is not a good choice, IMHO.

And yes, there is a need for carrying state amongst http requests.
That's what $_SESSION is all about.

> Although, it's suboptimal for daemons, with a little help of supervisord
> it can be efficient enough.
>

It's crap for daemons. It was never meant to be used for them. But
then there are always people why try to use a hammer when a screwdriver
is more appropriate.

>> Or maybe you don't understand what a daemon is, or how a *real* daemon
>> works.
>
> You know what? My dad eat daemons for breakfast!
>

I can believe that!

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Benefits of the 3-Tier Architecture
Next Topic: Bad database design can cause unnecessary coding
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 01:57:17 GMT 2024

Total time taken to generate the page: 0.04390 seconds