FileUpload multi-node

I have set up a FilamentPHP v2 & v3 application on a multi-node Docker architecture without shared volumes between the containers. For file uploads, I am using S3, as my containers do not have persistent local volumes. However, I am encountering an issue: files are not always uploaded correctly. This problem becomes more frequent as I add more nodes to the cluster. This behavior seems to be related to how file uploads are handled in a multi-node environment, since everything works fine when I only use a single node. Here are my assumptions based on my observations: 1. Initial upload: When a user uploads a file, it might be temporarily stored on the node that received the request. 2. Multi-node issue: In a multi-node setup, the server that receives the file and temporarily stores it may be different from the one that handles the final operation, such as saving it to S3. If each node has its own isolated local storage, this could explain why the file upload occasionally fails, especially when multiple nodes are involved. To try to resolve this issue, I configured Traefik with sticky sessions, so that each user is consistently directed to the same node for their requests. Unfortunately, this doesn’t seem to completely fix the problem, or there may be an issue with my Traefik configuration. Do you have any advice or solutions for effectively handling file uploads in a multi-node Docker environment, especially with setups like this? Any suggestions would be appreciated. Here is the code:
Forms\Components\FileUpload::make('attachments')
->label(__('artist_event-resource.field.attachments'))
->columnSpan(3)
->disk('s3')
->visibility('private')
->directory('/artist'),
Forms\Components\FileUpload::make('attachments')
->label(__('artist_event-resource.field.attachments'))
->columnSpan(3)
->disk('s3')
->visibility('private')
->directory('/artist'),
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server