Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#11310 closed Bug Report - General (fixed)

Unable to access large ISOs via mythweb/video

Reported by: antonio.e.russo@… Owned by: Rob Smith
Priority: minor Milestone: 0.27
Component: Plugin - MythWeb Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

With the recent addition of modules/video/stream.php infrastructure, I have been unable to use mythweb to access videos (in the form of very large .iso or .vob) files. This occurs because PHP runs out of memory at the line

readfile("http://$Master_Host:$port/Content/GetVideo?Id=".$vid_id);

I don't program PHP, but I have raised the PHP memory_limit up to 1GB, and yet apache still complains about too much memory being used. I'm guessing that PHP is trying to pull the full file into memory before passing it out over the network. I only have 4GB of RAM on this machine, and some ISOs exceed that size (easily 6GB). I don't know anything about what problem is being solved with this new stream infrastructure, but wouldn't it be more efficient (memory and network-wise, if the master backend is different than the mythweb host) to simply redirect to this $Master_Host:$port... url?

Thanks for all the great work!

Attachments (1)

disable_object_buffering.patch (512 bytes) - added by antonio.e.russo@… 7 years ago.
disable object buffering before readfile in mythvideo

Download all attachments as: .zip

Change History (6)

comment:1 in reply to:  description Changed 7 years ago by Raymond Wagner

Replying to antonio.e.russo@…:

I don't know anything about what problem is being solved with this new stream infrastructure, but wouldn't it be more efficient (memory and network-wise, if the master backend is different than the mythweb host) to simply redirect to this $Master_Host:$port... url?

No, as that would require the backend also be exposed to the internet. The whole purpose of proxying it is that you only have to protect one server instead of two.

comment:2 Changed 7 years ago by antonio.e.russo@…

I'm excited to hear that internet support is being added. Again, I am not PHP programmer (I just read a few paragraphs of the documentation), but can we disable object buffering? Put

if (ob_get_level()) ob_end_clean();

right before

readfile("http://$Master_Host:$port/Content/GetVideo?Id=".$vid_id);

This eliminates the enormous read-in-file-then-spit-out memory use in my case.

Changed 7 years ago by antonio.e.russo@…

disable object buffering before readfile in mythvideo

comment:3 Changed 7 years ago by antonio.e.russo@…

I have attached a diff, if that makes it any easier to include this patch. I don't know what the precise strategic goals are, so I do not understand why object buffering is enabled (or if it is some local configuration error on my side). Thanks.

comment:4 Changed 7 years ago by antonio.e.russo <antonio.e.russo@…>

Resolution: fixed
Status: newclosed

In ff50f84a53ad241cabe902857ff76429243b1b7a/mythweb:

Fixes #11310, this forces ob_buffering off for readfile.

Signed-off-by: Rob Smith <kormoc@…>

comment:5 Changed 7 years ago by Raymond Wagner

Milestone: unknown0.27
Note: See TracTickets for help on using tickets.