Server Process

This is a discussion on Server Process within the PHP General forums, part of the PHP Programming Forums category; Just a follow up to my post about running an application server side and the introduction of sockets. My application ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-13-2007
Nathan Wallis
 
Posts: n/a
Default Server Process

Just a follow up to my post about running an application server side and the
introduction of sockets.



My application is really just to modify a series of images on the server and
combine them into a collage of images as a single file name. So I just say
go and wait for it to build the final file, then it is done.



So in this case are sockets an advantage? I really just want to start the
application and let it go, without transferring data back and forth between
PHP and the app.



Any more help would be great.



Cheers,



Nathan


Reply With Quote
  #2 (permalink)  
Old 08-13-2007
Tijnema
 
Posts: n/a
Default Re: [PHP] Server Process

On 8/13/07, Nathan Wallis <nwallis@ncable.net.au> wrote:
> Just a follow up to my post about running an application server side and the
> introduction of sockets.
>
>
> My application is really just to modify a series of images on the server and
> combine them into a collage of images as a single file name. So I just say
> go and wait for it to build the final file, then it is done.
>
>
> So in this case are sockets an advantage? I really just want to start the
> application and let it go, without transferring data back and forth between
> PHP and the app.
>
>
> Any more help would be great.
>
> Cheers,
>
> Nathan
>


Yes, Sockets are still an advantage, IF you use them correctly, and
use the script behind it correctly. Each program does some things at
startup, like loading DLLs if they weren't loaded already, copying
program into memory etc. which all take resources, and when you run
the program as a service with access through sockets, the program
would run forever, but doesn't need to startup each time.

Tijnema


--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info
Reply With Quote
  #3 (permalink)  
Old 08-13-2007
Richard Lynch
 
Posts: n/a
Default Re: [PHP] Server Process

On Mon, August 13, 2007 4:37 am, Nathan Wallis wrote:
> Just a follow up to my post about running an application server side
> and the
> introduction of sockets.
>
> My application is really just to modify a series of images on the
> server and
> combine them into a collage of images as a single file name. So I
> just say
> go and wait for it to build the final file, then it is done.
>
> So in this case are sockets an advantage? I really just want to start
> the
> application and let it go, without transferring data back and forth
> between
> PHP and the app.
>
> Any more help would be great.


Who is doing the waiting, and when, and just how long will they need
to wait?...

I suspect you are over-engineering this, and could just write a single
script to do the collaging and not even have it ever be in a file.

<img src="collage.php" />

<?php
//collage.php
//something not unlike this:
$files = array('1.jpg', '2.jpg', '3.jpg', '4.jpg', '5.jpg', '6.jpg');
$image = imagecreatetruecolor(600, 400);
reset($files);
for ($column = 0; $column < 3; $column++){
for ($row = 0; $row < 2; $row++){
$img = imagecreatefromjpg('/full/path/to/images/' . next($files));
imagecopyresampled($image, $img, $column * 200, $row * 200, 0,
0, 200, 200, imagesx($img), imagesy($img));
}
}
header("Content-type: image/jpeg");
imagejpeg($image);
?>

We can't really tell you if you should use a daemon, a cache, or
whatever, unless you tell us more about the Big Picture of your
application.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:29 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0