php client

Eric Chang scrazy77 at gmail.com
Wed May 4 16:39:07 PDT 2005


Thanks for your help!
The testing of option 2 success.
I'll try option 1 and test it.

2005/5/4, Jan Mulders <varka3 at gmail.com>:
> Hmm.
>  
>  I wrote a Perl-based script to do the same thing, except with multiple
> independent nodes (each had the tracker, the storage daemon, and MySQL
> cluster running), checking each other's load and passing requests among
> them. 
>  
>  Basically, I took option 2, and I think it would've sucked if I'd actually
> managed to get it to work. Because you're echoing the contents of the file
> when the PHP is called, I believe (don't get me wrong here, I have not
> tested this... yet...) that it will consume large amounts of memory,
> depending on the size of the file of course. Ie, if the file requested is -
> say - 10MB, each user that requests it at the same time will be using 10MB
> or more of RAM. For my test cluster of five P233's PC's with 64mb RAM
> apiece, I believe it would have killed all the nodes within a very short
> space of time.
>  
>  Hence.. in my humble opinion, I'd go with option 1. It's been tested and
> proven to be non-lame by Livejournal, doesn't weigh down your mod_php with
> echoing all that data, and keeps things nice and clean overall. Working out
> MogileFS was quite a challenge... I should really look at contributing some
> documentation, perhaps on 'how to use in a real-life environment', and maybe
> a bit of architecture design.
>  
>  Hope this helps you in any way?
>  
>  PS - I would be interested to see how you got it all done in the end, as I
> was trying to attain the same goal myself... If the group is interested, I
> can provide a link to the write-up of my project?
>  
>  Thanks,
>  
>  Jan Mulders
> 
> 
> On 5/4/05, Eric Chang <scrazy77 at gmail.com> wrote:
> > The php client works fine.
> > But I don't know which implemenation is better in our environment.
> > User files' url like :
> http://foo.bar/username/filename.ext
> > Since our script written in PHP, so we could use php MogileFS client 
> > writting file into MogileFS.
> > Then we need transparent access for our users (browser).
> > 
> > 1. using Perlbal as frontend, then dispatch request to backend ,
> > the backend is mod_rewrite pass to my php script,php script translate 
> > the incoming url to
> > MogileFS file key, then get the file real path(url) , return reproxy to
> Perlbal,
> > at least Perlbal get the real file and return to user ?
> > 
> > 2.using mod_rewrite and my php script,get the real file data , and 
> > return to user directly
> > (I don't know how to handle the file's mime types in this situation)
> > 
> > Which way is better? any other better implementation ?
> > 
> > thanks
> > 
> 
>


More information about the mogilefs mailing list