[GH-ISSUE #95] Must wait for video to copy before streaming in AMS #59

Open
opened 2026-03-04 01:41:39 +03:00 by kerem · 5 comments
Owner

Originally created by @hterhanian on GitHub (Dec 11, 2014).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/95

I'm surprised I wasn't able to find any info about this since s3fs is offered as the solution for streaming content from S3 with Adobe Media Server (AMS).

I saw an issue from s3fs on code.google.com that talks about this problem and gives a possible solution here: Issue 350: Opening for READ ONLY could be optimized.

Basically, content must be copied entirely to local instance from S3 before AMS will start playback. This becomes a problem with larger movie file sizes because there will always be a lag time for the movie to copy before AMS can start streaming it.

Could there be mount option that allows file to be read once a configurable amount of the file is copied? On top of this, I would also like to see this feature allow moving to different parts of the file before the entire thing is downloaded.

Originally created by @hterhanian on GitHub (Dec 11, 2014). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/95 I'm surprised I wasn't able to find any info about this since s3fs is offered as the solution for streaming content from S3 with Adobe Media Server (AMS). I saw an issue from s3fs on code.google.com that talks about this problem and gives a possible solution here: [Issue 350: Opening for READ ONLY could be optimized.](https://code.google.com/p/s3fs/issues/detail?id=350) Basically, content must be copied entirely to local instance from S3 before AMS will start playback. This becomes a problem with larger movie file sizes because there will always be a lag time for the movie to copy before AMS can start streaming it. Could there be mount option that allows file to be read once a configurable amount of the file is copied? On top of this, I would also like to see this feature allow moving to different parts of the file before the entire thing is downloaded.
Author
Owner

@ggtakec commented on GitHub (Jan 6, 2015):

I'm sorry for replying late.

When s3fs gets(downloads) the object with use_cache option, s3fs caches the object.
The cache file is separated by parts, so you can specify bytes for one parts by fd_page_size option.
Can you solve this problem by using this option?

Regards,

<!-- gh-comment-id:68886547 --> @ggtakec commented on GitHub (Jan 6, 2015): I'm sorry for replying late. When s3fs gets(downloads) the object with use_cache option, s3fs caches the object. The cache file is separated by parts, so you can specify bytes for one parts by fd_page_size option. Can you solve this problem by using this option? Regards,
Author
Owner

@hterhanian commented on GitHub (Jan 7, 2015):

I tried reducing page size and increasing parallel transfers but since pagesize must be smaller than multipartsize times maxparallelcount, and multipartsize is hardcoded to 10mb, I could not decrease page size while increasing parallel count.

Also this point might be moot, when I tried any configuration of s3fs... I monitored real time traffic and saw that whenever trying to do VOD with flash media server, the stream would not start until it looked like traffic between ec2 instance and s3 bucket stopped (meaning the movie was copied over to local s3fs cache). I increased multipart_size and parallel_count in hopes of decreasing the time it takes to copy the movie but I could only get it down to around 25 seconds for 2.5GB. For my situation, streaming needs to start in at most 5 seconds. I tried searching everywhere for someone in this situation and I'm surprised to say that I saw no one talk about how slow VOD starts when using FMS/AMS and s3fs even though Adobe recommends s3fs when streaming from S3.

Thanks,
-hd

<!-- gh-comment-id:69043084 --> @hterhanian commented on GitHub (Jan 7, 2015): I tried reducing page size and increasing parallel transfers but since [pagesize must be smaller than multipartsize times maxparallelcount](https://github.com/s3fs-fuse/s3fs-fuse/blob/082eb24c12de62a0bacfc240c99d36114a75ccc0/src/s3fs.cpp#L3693), and [multipartsize is hardcoded to 10mb](https://github.com/s3fs-fuse/s3fs-fuse/blob/eedc62163714bc1ba2bbea21fb31358b91cbfbb0/src/curl.cpp#L191), I could not decrease page size while increasing parallel count. Also this point might be moot, when I tried any configuration of s3fs... I monitored real time traffic and saw that whenever trying to do VOD with flash media server, the stream would not start until it looked like traffic between ec2 instance and s3 bucket stopped (meaning the movie was copied over to local s3fs cache). I increased multipart_size and parallel_count in hopes of decreasing the time it takes to copy the movie but I could only get it down to around 25 seconds for 2.5GB. For my situation, streaming needs to start in at most 5 seconds. I tried searching everywhere for someone in this situation and I'm surprised to say that I saw no one talk about how slow VOD starts when using FMS/AMS and s3fs even though Adobe recommends s3fs when streaming from S3. Thanks, -hd
Author
Owner

@ggtakec commented on GitHub (Jan 13, 2015):

Do you need to load all of the video file before starting streaming?
If you need, probably I think that you should increase parallel connection and use more traffic by s3fs options for loading 25Gb file.
(Is 5Gbyte/sec posssible?)

(About just idea by multi process and read from cache, if it is possible.
When starting download(streaming), run another process.
Another process reads the object and puts cache, and main process for VOD reads from cache.....)

<!-- gh-comment-id:69769890 --> @ggtakec commented on GitHub (Jan 13, 2015): Do you need to load all of the video file before starting streaming? If you need, probably I think that you should increase parallel connection and use more traffic by s3fs options for loading 25Gb file. (Is 5Gbyte/sec posssible?) (About just idea by multi process and read from cache, if it is possible. When starting download(streaming), run another process. Another process reads the object and puts cache, and main process for VOD reads from cache.....)
Author
Owner

@vijvijay commented on GitHub (May 9, 2015):

@hterhanian, since the get operation is blocking, you need to get the entire file to cache before accessing it.
BUT, you may still do it under 5s. As you say 25s for 2.5GB (which translates to ~800Mbps), I can see the speed is limited by the virtual network card (1Gbps). You can increase it by adding more virtual network interfaces(ENI) to the virtual machine. By adding 4 more virtual network interfaces to your VM and configuring network appropriately, your VM's network speed should increase and file download/cache time should drop by 5X, reducing the opening time to your expected 5s from the current 25s.
PS: See this link: http://www.aerospike.com/blog/boosting-amazon-ec2-network-for-high-throughput/

<!-- gh-comment-id:100425489 --> @vijvijay commented on GitHub (May 9, 2015): @hterhanian, since the get operation is blocking, you need to get the entire file to cache before accessing it. BUT, you may still do it under 5s. As you say 25s for 2.5GB (which translates to ~800Mbps), I can see the speed is limited by the virtual network card (1Gbps). You can increase it by adding more virtual network interfaces(ENI) to the virtual machine. By adding 4 more virtual network interfaces to your VM and configuring network appropriately, your VM's network speed should increase and file download/cache time should drop by 5X, reducing the opening time to your expected 5s from the current 25s. PS: See this link: http://www.aerospike.com/blog/boosting-amazon-ec2-network-for-high-throughput/
Author
Owner

@gaul commented on GitHub (Sep 26, 2020):

@ggtakec s3fs does a synchronous read-ahead on when reading at a given offset. This is a poor fit for streaming reads that video players do. Instead, s3fs should issue an asynchronous prefetch when the applications reads 50% of the previous buffer.

<!-- gh-comment-id:699273385 --> @gaul commented on GitHub (Sep 26, 2020): @ggtakec s3fs does a synchronous read-ahead on when reading at a given offset. This is a poor fit for streaming reads that video players do. Instead, s3fs should issue an asynchronous prefetch when the applications reads 50% of the previous buffer.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#59
No description provided.