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

[LibOS] experimental flock significantly increases file size #1811

Open
fnerdman opened this issue Mar 14, 2024 · 4 comments
Open

[LibOS] experimental flock significantly increases file size #1811

fnerdman opened this issue Mar 14, 2024 · 4 comments

Comments

@fnerdman
Copy link
Contributor

Description of the problem

Running go-ethereum in Gramine with experimental flock support we experience an increase of file size (300-1000%) compared to not setting the flock for the database folders.

Steps to reproduce

No response

Expected results

No response

Actual results

No response

Gramine commit hash

v1.6

@dimakuv
Copy link
Contributor

dimakuv commented Mar 15, 2024

Looking at the PR that introduced flock() support, I don't see anything that could lead to increasing the file size: #1416

Can you debug a bit more:

  1. What are the additional contents in this file? Is it just holes filled with all-zeros?
  2. The increase in size is in comparison to no-locks-at-all situation?
  3. Did you add flocks yourself, or are you using an app that can enable/disable this (otherwise how would it work before)?

@fnerdman
Copy link
Contributor Author

After doing some more digging, this seems to be related to a regression in gramine's tmpfs implementation rather than flock. The increased file size is not observable when running gramine 1.5, whereas gramine +1.6 uses up significiant more space compared to the folder on disk. Copying a folder containing a huge amount of files <=2MB which amounts to ~280GB of size into tmpfs, even with enclave_size=1024GB results in OOM. See attachment chaindata.txt for folder structure.

@mkow
Copy link
Member

mkow commented Mar 22, 2024

The only commit I can see since 1.5 which I think could influence this could be 1ea3e60, assuming it introduces some memory leak. I didn't see anything other related to tmpfs, but maybe I just missed something... Could you check if this is the commit causing the regression?
If not, could you do git bisect to find the culprit? (assuming one run doesn't take too much time)

@dimakuv
Copy link
Contributor

dimakuv commented Apr 2, 2024

@lead4good Any progress on debugging this? I don't see anything special in the 1ea3e60 commit.

I also don't understand how tmpfs (which uses buffers in enclave memory) relates to the file sizes in database folders. Or do I misunderstand your application and which files exactly are increased in size?

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

No branches or pull requests

3 participants