Welcome! Log In Create A New Profile

Advanced

sharing static files that are created by php across php servers

Posted by iberkner 
sharing static files that are created by php across php servers
January 12, 2010 11:02AM
Hi All,

Let me preface that I've asked a similar question before related to sharing
of PHP code across servers. We finally opted for a synching solution using
rsync and its working well.

This question is slightly different. We are working on a new feature which
will allow users to create audio (.mp3) files dynamically via our web
interface. The resulting .mp3 file will be stored locally and served by
our dedicated web server. In our current configuration we have to php
servers running php-fpm and a single web server. The web server serves all
non-php files.

Our PHP does 2 things:

(a) Create the .mp3 file
(b) Looks for the .mp3 file to see if it exists

The problem is that once the .mp3 file is created it needs to be made
available to both the other PHP application server as well as the web
server.

We are looking at several options:

(a) Use NFS - seems like this is what it was made for? PHP will write the
..mp3 file into the local NFS client which will be a directory on the web
server
(b) FTP the created mp3 files to the other PHP server AND to the web server
(c) Use rsync to periodically sync the audio file directories. I don't like
this option as it would have to be set up to run essentially continously and
not on demand via a cron job.

Any thoughts / suggestions?

Thanks
Ilan Berkner wrote:
> Hi All,
>
> Let me preface that I've asked a similar question before related to
> sharing of PHP code across servers. We finally opted for a synching
> solution using rsync and its working well.
>
> This question is slightly different. We are working on a new feature
> which will allow users to create audio (.mp3) files dynamically via
> our web interface. The resulting .mp3 file will be stored locally
> and served by our dedicated web server. In our current configuration
> we have to php servers running php-fpm and a single web server. The
> web server serves all non-php files.
>
> Our PHP does 2 things:
>
> (a) Create the .mp3 file
> (b) Looks for the .mp3 file to see if it exists
>
> The problem is that once the .mp3 file is created it needs to be made
> available to both the other PHP application server as well as the web
> server.
>
> We are looking at several options:
>
> (a) Use NFS - seems like this is what it was made for? PHP will write
> the .mp3 file into the local NFS client which will be a directory on
> the web server
> (b) FTP the created mp3 files to the other PHP server AND to the web
> server
> (c) Use rsync to periodically sync the audio file directories. I
> don't like this option as it would have to be set up to run
> essentially continously and not on demand via a cron job.
>
> Any thoughts / suggestions?
>
> Thanks

You could also use DRBD. Please visit http://www.drbd.org for information.

Best regards,

Hugo Monteiro.
Hello.

Try to use Amazon S3 service as an origin for your files and nginx
proxy_store feature - this will allow you not to store all the files
on your web/application servers but only highly used.

Best Regards, Pavel Radaev
Coloribus.Com Team
Advertolog.Com Team



On Tue, Jan 12, 2010 at 7:01 PM, Ilan Berkner <iberkner@gmail.com> wrote:
> Hi All,
>
> Let me preface that I've asked a similar question before related to sharing
> of PHP code across servers.  We finally opted for a synching solution using
> rsync and its working well.
>
> This question is slightly different.  We are working on a new feature which
> will allow users to create audio (.mp3) files dynamically via our web
> interface.   The resulting .mp3 file will be stored locally and served by
> our dedicated web server.  In our current configuration we have to php
> servers running php-fpm and a single web server.  The web server serves all
> non-php files.
>
> Our PHP does 2 things:
>
> (a) Create the .mp3 file
> (b) Looks for the .mp3 file to see if it exists
>
> The problem is that once the .mp3 file is created it needs to be made
> available to both the other PHP application server as well as the web
> server.
>
> We are looking at several options:
>
> (a) Use NFS - seems like this is what it was made for?  PHP will write the
> .mp3 file into the local NFS client which will be a directory on the web
> server
> (b) FTP the created mp3 files to the other PHP server AND to the web server
> (c) Use rsync to periodically sync the audio file directories.  I don't like
> this option as it would have to be set up to run essentially continously and
> not on demand via a cron job.
>
> Any thoughts / suggestions?
>
> Thanks
Re: sharing static files that are created by php across php servers
January 12, 2010 12:32PM
Thank you for that suggestions, I am looking at the Amazon S3 service as a
possible solution but as part of our next development cycle.

I'm not familiar with the proxy_store solution, I'll look at it.

Thanks!

On Tue, Jan 12, 2010 at 12:00 PM, Pavel Radaev <pradaev@gmail.com> wrote:

> Hello.
>
> Try to use Amazon S3 service as an origin for your files and nginx
> proxy_store feature - this will allow you not to store all the files
> on your web/application servers but only highly used.
>
> Best Regards, Pavel Radaev
> Coloribus.Com Team
> Advertolog.Com Team
>
>
>
> On Tue, Jan 12, 2010 at 7:01 PM, Ilan Berkner <iberkner@gmail.com> wrote:
> > Hi All,
> >
> > Let me preface that I've asked a similar question before related to
> sharing
> > of PHP code across servers. We finally opted for a synching solution
> using
> > rsync and its working well.
> >
> > This question is slightly different. We are working on a new feature
> which
> > will allow users to create audio (.mp3) files dynamically via our web
> > interface. The resulting .mp3 file will be stored locally and served by
> > our dedicated web server. In our current configuration we have to php
> > servers running php-fpm and a single web server. The web server serves
> all
> > non-php files.
> >
> > Our PHP does 2 things:
> >
> > (a) Create the .mp3 file
> > (b) Looks for the .mp3 file to see if it exists
> >
> > The problem is that once the .mp3 file is created it needs to be made
> > available to both the other PHP application server as well as the web
> > server.
> >
> > We are looking at several options:
> >
> > (a) Use NFS - seems like this is what it was made for? PHP will write
> the
> > .mp3 file into the local NFS client which will be a directory on the web
> > server
> > (b) FTP the created mp3 files to the other PHP server AND to the web
> server
> > (c) Use rsync to periodically sync the audio file directories. I don't
> like
> > this option as it would have to be set up to run essentially continously
> and
> > not on demand via a cron job.
> >
> > Any thoughts / suggestions?
> >
> > Thanks
>
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 160
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready