Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: command buffering #515

Open
bluppfisk opened this issue Jul 6, 2017 · 5 comments
Open

feature request: command buffering #515

bluppfisk opened this issue Jul 6, 2017 · 5 comments
Assignees
Labels

Comments

@bluppfisk
Copy link

As Gaufrette does not buffer commands, executing multiple commands on a remote service can cause considerable delays.

E.g. User deletes an uploaded image. All related sizes must also be removed from the remote service (e.g. S3). This will take 2 HTTP calls for every file: one to ensure the bucket exists, and one to delete the file. In the very regular situation where you keep 4 versions of each image, this will take 8(!) HTTP calls, a massive bottleneck.

I'd propose buffering of commands (after which a flush command executes all of it at once), or the option to concatenate commands.

@akerouanton
Copy link
Contributor

one to ensure the bucket exists, and one to delete the file. In the very regular situation where you keep 4 versions of each image, this will take 8(!) HTTP calls, a massive bottleneck.

Do you have any prove of that? The AwsS3::ensureBucketExists() method checks if the bucket exists only once.

I'd propose buffering of commands (after which a flush command executes all of it at once), or the option to concatenate commands.

It's not possible to do so right now: it would require some async filesystem implementation. But that's something we might do in some months :)

@bluppfisk
Copy link
Author

@NiR- , you're right, I was looking at a deprecated version which has an ensureBucketExists() on every delete() call. However, S3 supports deleting multiple objects:

http://docs.aws.amazon.com/AmazonS3/latest/dev/DeletingMultipleObjectsUsingPHPSDK.html

Would it be possible to allow access to this?

@akerouanton
Copy link
Contributor

Then what you're looking for is a batchDelete method. We can add it through a new BatchAdapter interface, and mimic the behavior in the Filesystem if adapters don't implement it. So yeah, it's totally feasible ;)

@KevinArtus
Copy link
Contributor

Hi @akerouanton @bluppfisk
Is this issue is still relevant or can i close it ?

@bluppfisk
Copy link
Author

Hi @akerouanton @bluppfisk Is this issue is still relevant or can i close it ?

Hi

I no longer use Gaufrette and I've written some custom code to achieve what I wanted, but I imagine it could still be a useful feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants