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

Limit number of objects in mdag batch to prevent too many fds issue #3756

Merged
merged 1 commit into from
Mar 7, 2017

Conversation

whyrusleeping
Copy link
Member

In certain situations the 8MB size limit here would result in a large number of objects in the batch, which combined with peer connections, can easily hit the file descriptor limit.

License: MIT
Signed-off-by: Jeromy [email protected]

@whyrusleeping whyrusleeping added the status/in-progress In progress label Mar 7, 2017
// By default, only batch up to 256 nodes at a time.
// The current implementation of flatfs opens this many file
// descriptors at the same time for the optimized batch write.
MaxBlocks: 256,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would reduce it even further. 256 blocks worst case scenario is 512 open fds (directory and file), and with almost 500 peers it is getting close to 1024 ulimit we set.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmm... fair enough. How about 200 even? I think we should rework how flatfs works/replace it soon.

@whyrusleeping whyrusleeping force-pushed the fix/limit-mdag-batch-objs branch from 0438646 to 31af335 Compare March 7, 2017 03:28
@whyrusleeping
Copy link
Member Author

should resolve #3752

@Kubuxu
Copy link
Member

Kubuxu commented Mar 7, 2017

It doesn't fix everything, I am still getting this failure:

expecting success: 
		ipfs add --raw-leaves -r -q somedir > /dev/null
	
22:51:36.165 ERROR commands/h: open /home/kubuxu/go/src/github.com/ipfs/go-ipfs/test/sharness/trash directory.t0270-filestore.sh/.ipfs/blocks/5H/put-659704546: too many open files client.go:247
Error: open /home/kubuxu/go/src/github.com/ipfs/go-ipfs/test/sharness/trash directory.t0270-filestore.sh/.ipfs/blocks/5H/put-659704546: too many open files
not ok 29 - normal add without fscache duplicates data
#	
#			ipfs add --raw-leaves -r -q somedir > /dev/null
#		

It is slightly modified test as previously the error was being hidden by var capture.

@Kubuxu
Copy link
Member

Kubuxu commented Mar 7, 2017

Ok, now it vanished.

@Kubuxu Kubuxu added this to the Ipfs 0.4.7 milestone Mar 7, 2017
@whyrusleeping whyrusleeping merged commit 88af4b7 into master Mar 7, 2017
@whyrusleeping whyrusleeping deleted the fix/limit-mdag-batch-objs branch March 7, 2017 23:39
@whyrusleeping whyrusleeping removed the status/in-progress In progress label Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants