Large FLV file returns 500 error for Registered Users only album.

sumtig

Joined: 2010-07-29
Posts: 4
Posted: Thu, 2010-07-29 18:54

I have two FLV files, File-A.flv is 11MB, File-B.flv is 50MB. Both are playing fine for public album. However, if I set album permission to Registered Users only, then File-A.flv plays fine, File-B.flv returns "HTTP/1.0 500 Internal Server Error" shown in Fiddler, FlowPlayer will show "200 stream not found...".

A few points to help debugging:
1. Both files play fine for public album, so it cant be Apache/php/FLV problem.
2. If log into the shell and swap the two files' names, and reset browser cache, then File-A.flv (now 50MB) gives problem. So it is solely related to file size, not user permission setting.
3. The "HTTP/1.0 500 Internal Server Error" is not from Gallery codes? Because I see you use "HTTP/1.1" whenever you return error in your php code.

Please help.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25953
Posted: Thu, 2010-07-29 19:07

Al we do for permissions is drop a .htaccess file to prevent users from seeing the files. That appears to be working right since you swapped files name around.

What is in the Apache error logs?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Thu, 2010-07-29 19:24

The other thing that happens is when it's public, there's not any processing of the files through the file_proxy, but when permissions have been set, the files get processed through the file_proxy so now PHP is streaming that file out (at least that's how I believe things are still working) so it could also be a setting in PHP.

As Dave pointed out, finding out what the Apache error logs are showing will be helpful.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
sumtig

Joined: 2010-07-29
Posts: 4
Posted: Fri, 2010-07-30 04:34

Bingo!
It was due to file_proxy and php setting. My php.ini had following line:

Quote:
memory_limit = 32M

I changed it to:

Quote:
memory_limit = 70M

After Apache restart, the File-B.flv of 50MB plays fine.

BTW, Apache error log had no trace of any problem. Maybe the reporting level is not set high enough to catch this error. I dont know.

However, using file_proxy brings up another question: I run "top" command in shell, I do see the MEM usage jumps to 50 whenever I view File-B.flv. My Linux box only have 256 RAM. Does this means my box can only support maximum of 5 simultaneous File-B.flv viewers?

Thanks guys.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Sat, 2010-07-31 18:54

Hm. What version of PHP5 are you using? On my dev box (PHP 5.3.2) I set my memory limit to 32M and played a 60MB flv file without difficulty. I didn't notice any excessive CPU usage :-/
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
sumtig

Joined: 2010-07-29
Posts: 4
Posted: Mon, 2010-08-02 15:29

I am using PHP 5.2.10

Quote:
PHP 5.2.10 (cli) (built: Nov 13 2009 11:24:03)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

I get MEM spike every time I view the large FLV. Of cause you need to clean browser cache to view the effect.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Wed, 2010-08-04 04:57

I'm not sure what's going on there. If you have it working and you're not planning on hosting a lot of FLVs, I'd just leave it alone. PHP 5.2.10 is a year old so you could try upgrading to PHP 5.3.x to see if the problem still occurs.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git