-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
"OSError 24 Too many open files" when uploading many small files on S3 #1402
Comments
What's creating the The default settings for the connection pool will only open 10 connections, so it seems unlikely to be caused from socket creation. I would recommend using the transfer manager in boto3 (http://boto3.readthedocs.io/en/latest/guide/s3.html#uploads) or potentially using the low level Let me know if you have any more questions. |
Hey @jamesls, thanks for the response. The code is obviously more complicated than this iterator, was just trying to make a point. I'm actually iterating over Later today, I'll try to write a full proof of concept code that you can run to reproduce the error. |
Closing due to inactivity. |
I am experiencing a similar issue when uploading many files to S3. Here is my error trace:
I am using the transfer manager like this: def _upload_to_s3(self, file_path, key, conn):
self._bucket.upload_file(file_path, key)
conn.close() I am iterating over hundreds of file paths, yet I am not explicitely opening any of those files. I simply pass the path to the However I am using Python for file_path, key in self._files_keys.items():
parent_conn, child_conn = Pipe()
parent_connections.append(parent_conn)
process = Process(
target=self._upload_to_s3, args=(file_path, key, child_conn)
)
processes.append(process) Could multiprocessing be the reason I am getting this error? |
Did you manage to fix this issue? Could you share a workaround? |
I encountered similar error, any workaround? |
You can try raising the open file limit of your OS by using the command: Plus check out the following Stack Overflow solution: |
Hey all, I got stuck when trying to upload about 50 mln small files to s3.
This is a small code sample as to how I'm trying to approach the problem.
After around 1000 correctly uploaded files, I'm getting the following error:
I'm guessing boto3 under the hood uses some sort of connections pool, which is clearly used, but for some reason not working as expected. Is there a better way of doing this? Thanks in advance!
The text was updated successfully, but these errors were encountered: