From e7cb8dcf98d16af8310bb56750d576247c7becdf Mon Sep 17 00:00:00 2001 From: Jim Schmid Date: Fri, 11 Oct 2013 19:19:02 +0200 Subject: [PATCH 1/2] Fixed some typos in documentation. --- Resources/doc/chunked_uploads.md | 20 ++++++++++---------- Resources/doc/gaufrette_storage.md | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Resources/doc/chunked_uploads.md b/Resources/doc/chunked_uploads.md index b6c560d7..7eefd95d 100644 --- a/Resources/doc/chunked_uploads.md +++ b/Resources/doc/chunked_uploads.md @@ -38,7 +38,7 @@ oneup_uploader: You can choose a custom directory to save the chunks temporarily while uploading by changing the parameter `directory`. Since version 1.0 you can also use a Gaufrette filesystem as the chunk storage. To do this you must first -set up [Gaufrette](gaufrette_storage.md).There are however some additional things to keep in mind. +set up [Gaufrette](gaufrette_storage.md). There are however some additional things to keep in mind. The configuration for the Gaufrette chunk storage should look as the following: ``` oneup_uploader: @@ -46,14 +46,14 @@ oneup_uploader: maxage: 86400 storage: type: gaufrette - filesystem: gaufrette.gallery_filesystem + filesystem: gaufrette.gallery_filesystem prefix: 'chunks' stream_wrapper: 'gaufrette://gallery/' ``` -> Setting the stream_wrapper is heavily recommended for better performance, see the reasons in the [gaufrette configuration](gaufrette_storage.md#configure-your-mappings) +> Setting the `stream_wrapper` is heavily recommended for better performance, see the reasons in the [gaufrette configuration](gaufrette_storage.md#configure-your-mappings) -As you can see there are is a new option, ```prefix```. It represents the directory +As you can see there are is a new option, `prefix`. It represents the directory *relative* to the filesystem's directory which the chunks are stored in. Gaufrette won't allow it to be outside of the filesystem. @@ -61,16 +61,16 @@ Gaufrette won't allow it to be outside of the filesystem. only the Local filesystem is capable of streaming directly. This will give you a better structured directory, -as the chunk's folders and the uploaded files won't mix with each other. -> You can set it to an empty string (```''```), if you don't need it. Otherwise it defaults to ```chunks```. +as the chunk's folders and the uploaded files won't mix with each other. +> You can set it to an empty string (`''`), if you don't need it. Otherwise it defaults to `chunks`. -The chunks will be read directly from the tmp and appended to the already existing part on the given filesystem, +The chunks will be read directly from the temporary directory and appended to the already existing part on the given filesystem, resulting in only 1 read and 1 write operation. -You can achieve the biggest improvement if you use the same filesystem as your storage, as if you do so, the assembled -file only has to be moved out of the chunk directory, which on the same filesystem takes almost not time. +You can achieve the biggest improvement if you use the same filesystem as your storage. If you do so, the assembled +file only has to be moved out of the chunk directory, which takes no time on a local filesystem. -> The ```load distribution``` is forcefully turned on, if you use gaufrette as the chunk storage. +> The load distribution is forcefully turned on, if you use Gaufrette as the chunk storage. ## Clean up diff --git a/Resources/doc/gaufrette_storage.md b/Resources/doc/gaufrette_storage.md index c03ba849..2e74a3cd 100644 --- a/Resources/doc/gaufrette_storage.md +++ b/Resources/doc/gaufrette_storage.md @@ -53,7 +53,7 @@ knp_gaufrette: local: directory: %kernel.root_dir%/../web/uploads create: true - + filesystems: gallery: adapter: gallery @@ -71,7 +71,7 @@ oneup_uploader: gallery: storage: type: gaufrette - filesystem: gaufrette.gallery_filesystem + filesystem: gaufrette.gallery_filesystem ``` You can specify the buffer size used for syncing files from your filesystem to the gaufrette storage by changing the property `sync_buffer_size`. @@ -84,7 +84,7 @@ oneup_uploader: gallery: storage: type: gaufrette - filesystem: gaufrette.gallery_filesystem + filesystem: gaufrette.gallery_filesystem sync_buffer_size: 1M ``` @@ -97,18 +97,18 @@ oneup_uploader: gallery: storage: type: gaufrette - filesystem: gaufrette.gallery_filesystem + filesystem: gaufrette.gallery_filesystem stream_wrapper: gaufrette://gallery/ ``` -> This is only useful if you are using a stream capable adapter, at the time of this writing only +> This is only useful if you are using a stream-capable adapter. At the time of this writing, only the local adapter is capable of streaming directly. -The first part (```gaufrette```) in the example above ```MUST``` be the same as ```knp_gaufrette.stream_wrapper.protocol```, -the second part (```gallery```) in the example, ```MUST``` be the key of the filesytem (```knp_gaufette.filesystems.key```). -It also must end with a slash (```/```). +The first part (`gaufrette`) in the example above `MUST` be the same as `knp_gaufrette.stream_wrapper.protocol`, +the second part (`gallery`) in the example, `MUST` be the key of the filesytem (`knp_gaufette.filesystems.key`). +It also must end with a slash (`/`). This is particularly useful if you want to get exact informations about your files. Gaufrette offers you every functionality to do this without relying on the stream wrapper, however it will have to download the file and load it into memory -to operate on it. If ```stream_wrapper``` is specified the bundle will try to open the file as streams when such operation -is requested.(e.g. getting the size of the file, the mime-type based on content) +to operate on it. If `stream_wrapper` is specified, the bundle will try to open the file as streams when such operation +is requested. (e.g. getting the size of the file, the mime-type based on content) From 207d2f19d89f37ca61831ff1a79e2557aa9464f1 Mon Sep 17 00:00:00 2001 From: Jim Schmid Date: Fri, 11 Oct 2013 19:19:16 +0200 Subject: [PATCH 2/2] Added a documentation topic: How to use Chunked Uploads behind Load Balancers. This is WIP. --- Resources/doc/index.md | 1 + Resources/doc/load_balancers.md | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 Resources/doc/load_balancers.md diff --git a/Resources/doc/index.md b/Resources/doc/index.md index fe69b15d..430fc085 100644 --- a/Resources/doc/index.md +++ b/Resources/doc/index.md @@ -124,6 +124,7 @@ some more advanced features. * [Validate your uploads](custom_validator.md) * [General/Generic Events](events.md) * [Enable Session upload progress / upload cancelation](progress.md) +* [Use Chunked Uploads behind Load Balancers](load_balancers.md) * [Configuration Reference](configuration_reference.md) * [Testing this bundle](testing.md) diff --git a/Resources/doc/load_balancers.md b/Resources/doc/load_balancers.md new file mode 100644 index 00000000..0667b949 --- /dev/null +++ b/Resources/doc/load_balancers.md @@ -0,0 +1,6 @@ +Use Chunked Uploads behind Load Balancers +========================================= + +If you want to use Chunked Uploads behind load balancers that is not configured to use sticky sessions you'll eventually end up with a bunch of chunks on every instance and the bundle is not able to reassemble the file on the server. + +You can avoid this problem by using Gaufrette as an abstract filesystem. \ No newline at end of file