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

base64_encode memory limit #478

Closed
alimuzzaman opened this issue Apr 17, 2020 · 5 comments
Closed

base64_encode memory limit #478

alimuzzaman opened this issue Apr 17, 2020 · 5 comments
Assignees
Labels
Milestone

Comments

@alimuzzaman
Copy link
Contributor

https://wordpress.org/support/topic/stateless-max-size-upload/

stateless max size upload

Hello,

With the plugin WP Stateless, I am triing to upload file bigger than 70Mb.
I desactivate all plugin. The ini.php file is set to accept upload up to 128MB.
I can upload on my server (wp-content folder) files until 128MB when the plugin is desactivate.
But with WP Stateless I have a limit of 70MB, if the file is more heavy than 70MB I can not upload the file.
On my logs I have this error :
2020/04/16 16:55:27 [error] 6032#6032: *208007 FastCGI sent in stderr: “PHP message: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 97769512 bytes) in /www/mywebsite_842/public/wp-content/plugins/wp-stateless/lib/Google/src/Google/Http/MediaFileUpload.php on line 247” while reading response header from upstream, client: 80.215.246.220, server: http://www.mywebsite.center, request: “POST /wp-admin/admin-ajax.php HTTP/1.0”, upstream: “fastcgi://unix:/var/run/php7.4-fpm-mywebsite.sock:”, host: “modelmono.mywebsite.center”, referrer: “https://modelmono.mywebsite.center/wp-admin/upload.php”

Is there a limit on the plugin for a file size ?
Do you have an idea about how to fix this issue?
Thank you very much if you can help.

@alimuzzaman
Copy link
Contributor Author

alimuzzaman commented May 1, 2020

We will now upload files to GCS in chunks.

Previously to upload a media memory requirement was double the file size.
Chunk size will be determined based on free memory available.

@antonkorotkov @planv should there be a max chunk size limit?

Added new constant: WP_STATELESS_MEDIA_UPLOAD_CHUNK_SIZE

@alimuzzaman alimuzzaman assigned planv and unassigned alimuzzaman May 1, 2020
@antonkorotkov
Copy link
Contributor

should there be a max chunk size limit?

I think it should be up to the user as they decided to set this up.

@antonkorotkov
Copy link
Contributor

@antonkorotkov here is how I am calculating the chunk size now. Is it ok?
https://github.com/wpCloud/wp-stateless/blob/18dd668184dd48e09c371831a3fa99f698f3f293/lib/classes/class-gs-client.php#L267-L282

I don't know, needs to be tested in different conditions. But makes sense.

alimuzzaman pushed a commit that referenced this issue May 5, 2020
@planv
Copy link
Contributor

planv commented May 20, 2020

Checked, works fine

@planv planv closed this as completed May 20, 2020
@ewsopp ewsopp added this to the v3.0.0 milestone Sep 9, 2020
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

4 participants