Page 1 of 1

Serving static content through PHP - bad idea?

Posted: Sat Feb 28, 2009 3:31 pm
by kaisellgren
Hello,

Does anyone have experience with high load websites where you deliver static content through PHP? I am setuping a file download site and I am serving some files through PHP. Actually I am limiting the file download speed with PHP so that it sends x bytes and then sleeps one second... this way I can effectively make more premium users, but I am wondering if this is too challenging for the processor to handle all file downloads through PHP? Or are there Apache modules that can do the same?

Re: Serving static content through PHP - bad idea?

Posted: Thu Mar 19, 2009 2:39 am
by jaoudestudios
Apache's htaccess file can limit the connection speed. It might be more efficient than php?

Re: Serving static content through PHP - bad idea?

Posted: Thu Mar 19, 2009 4:05 am
by php_east
i would imagine that to be at TCP level, not IP. if you have limited speed access from your server out, the only way is to ask your host for faster link out. I really don't think servers choke for downloads. Once triggered, the sockets do the work.

Re: Serving static content through PHP - bad idea?

Posted: Thu Mar 19, 2009 7:10 am
by kaisellgren
jaoudestudios wrote:Apache's htaccess file can limit the connection speed. It might be more efficient than php?
Sounds good.
php_east wrote:i would imagine that to be at TCP level, not IP. if you have limited speed access from your server out, the only way is to ask your host for faster link out. I really don't think servers choke for downloads. Once triggered, the sockets do the work.
It's not because of having a bad server. It's because I want to have a feature. VIP users should get faster downloads than guests, for instance. Just like MegaUpload, RapidShare, etc do.

Re: Serving static content through PHP - bad idea?

Posted: Thu Mar 19, 2009 7:27 am
by jaoudestudios
You must have a big server with a fat pipe?

Re: Serving static content through PHP - bad idea?

Posted: Thu Mar 19, 2009 7:47 am
by kaisellgren
jaoudestudios wrote:You must have a big server with a fat pipe?
Not me. :)

Re: Serving static content through PHP - bad idea?

Posted: Fri Mar 20, 2009 9:56 am
by php_east
kaisellgren wrote: It's not because of having a bad server. It's because I want to have a feature. VIP users should get faster downloads than guests, for instance. Just like MegaUpload, RapidShare, etc do.
ah, i see. you cruel beast :mrgreen:

Re: Serving static content through PHP - bad idea?

Posted: Fri Mar 20, 2009 11:12 am
by jaoudestudios
Your pipe and traffic must be quite big if you want to host lots of files.

I am planning on hosting some virtual server images in the near future, fedora10, centos5.2, ubunut8.10 (including latest updates). Zipped they are about 1.4GB, I am affraid that I will go over my 4TB limit each month :?