Re: Running a server process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/10/07, Stut <stuttle@xxxxxxxxx> wrote:
> Tijnema wrote:
> > On 8/10/07, Stut <stuttle@xxxxxxxxx> wrote:
> >> Tijnema wrote:
> >>> On 8/10/07, Stut <stuttle@xxxxxxxxx> wrote:
> >>>> Tijnema wrote:
> >>>>> On 8/10/07, Richard Heyes <richardh@xxxxxxxxxxx> wrote:
> >>>>>>> That is it works with just me using the site.  I am wondering how this would
> >>>>>>> effect performance if say 500 people were executing this php function around
> >>>>>>> the same time and the processing overlapped.  Is there anyway to make an
> >>>>>>> executable run as a service, I am guessing at the terminology that I should
> >>>>>>> use here, but I feel there would be a much more efficient way of performing
> >>>>>>> this task.
> >>>>>> Well, ideally you don't run an executable. But if you must, there's some
> >>>>>> Windows program that turns an executable into a service. But then
> >>>>>> there's the consideration of communicating with it, which you could do
> >>>>>> with sockets. Or you could use a file.
> >>>>>>
> >>>>>> --
> >>>>>> Richard Heyes
> >>>>>> +44 (0)844 801 1072
> >>>>>> http://www.websupportsolutions.co.uk
> >>>>> I don't know if there a program exists that can "convert" the program
> >>>>> to a service, I think you need to compile it as a service from source
> >>>>> code, but as I mentioned in my first post, and you mentioned here too,
> >>>>> you also need to add support for a socket server in your program.
> >>>>> Sockets in PHP are easy ;)
> >>>> http://www.firedaemon.com/
> >>>>
> >>>> But you're right, you'd need a way to communicate with the service.
> >>>>
> >>>> -Stut
> >>> Well stut, this doesn't really run your program as a service.
> >>> The program itself is a server, and simply starts every program when
> >>> that service starts. That's not the same as running the program as a
> >>> service.
> >> That's extremely pedantic. "As a service" simply means it responds to
> >> messages from the OS such as start, pause and stop. Firedaemon wraps
> >> your executable in a process that does just that. So technically you're
> >> correct, it doesn't turn your executable into a service, it wraps it in
> >> one, but the effect is essentially the same.
> >>
> >> If you need the extra control you'll get over it by rewriting your
> >> executable to actually be a service then you should do that. But if
> >> you're working with something you don't have the source for, or don't
> >> have the time to implement such a modification then Firedaemon is the
> >> best option I've come across.
> >>
> >> -Stut
> >
> > Yes, but if you don't have the source, you can't add socket support,
> > and then you can do quite less with a program... Unless you already
> > have socket support in the program, but that seems quite odd to me ;)
>
>  Sockets aren't the only IPC mechanism available. And besides, I was
> countering your general statement regarding Firedaemon, not the
> applicability of Firedaemon to the OP's problem, which we can't comment
> on without knowing a lot more information about it.
>
> -Stut

Sockets is the best IPC available for all platforms, Pipes etc. only
work on POSIX systems, not on default windows installation, as you
would need the Microsoft Windows Services For Unix package installed.

You could use things like files or databases too, but sockets would
mostly be easier as you can simple send a START command to emulate the
start of a program, and have a stream open for returning data.

I see I misreaded a little bit of your reply.

Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux