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

Allow change of parallelUploads config in dropzone #1538

Closed
4 tasks done
mikaldl opened this issue Feb 4, 2025 · 3 comments
Closed
4 tasks done

Allow change of parallelUploads config in dropzone #1538

mikaldl opened this issue Feb 4, 2025 · 3 comments

Comments

@mikaldl
Copy link
Contributor

mikaldl commented Feb 4, 2025

Description

When running SilverStripe in a LoadBalancer multi-server setup, the parallel uploads causes problems with unique key constraints due to the fast distribution of requests between different servers and one database connection.

With parallel uploads already being available in the dropzone module, it can be handy to be able to change this to prevent earlier said problems.

Additional context or points of discussion

To sketch a good picture in how this occurs with the setup I am currently running for a client:

  • WEB-01, WEB-02 as dedicated CMS/Frontend servers
  • LB-01 for load balancing all the requests
  • DB-01 (with a slave setup)

We are seeing every /upload request being distributed towards WEB-01 and WEB-02 simultaneously causing request 1 being correctly saved, but request 2 fail because of the duplicate key constraints.

Validations

  • You intend to implement the feature yourself
  • You have read the contributing guide
  • You strongly believe this feature should be in core, rather than being its own community module
  • You have checked for existing issues or pull requests related to this feature (and didn't find any)

PRs

@emteknetnz
Copy link
Member

emteknetnz commented Feb 11, 2025

I haven't looked into this very deeply though based on this answer it may be that we want to make it so that uploadMultiple is configurable to false instead

@mikaldl
Copy link
Contributor Author

mikaldl commented Feb 11, 2025

The package uses version 6.0.0-beta.2 of Dropzone. uploadMultiple would mean there will be multiple files inside one request, which is different compared to parallelUploads which result in two parallel requests. Changing the uploadMultiple to true would probably break the PHP upload field because of different behaviour.

More information about available options is found here: https://github.com/dropzone/dropzone/blob/v6.0.0-beta.2/src/options.js#L35

@emteknetnz
Copy link
Member

Linked PR has been merged, it will be released as part of the upcoming CMS 5.4.0 release

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

No branches or pull requests

2 participants