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

Reading or writing to a database not configured in WAL mode will perform excessive I/O and reduce the health of storage devices. This is known to cause excessive I/O for your users. #3890

Open
amruth-movano opened this issue Oct 1, 2024 · 8 comments
Labels
bug Something isn't working datastore Issues related to the DataStore category

Comments

@amruth-movano
Copy link

Describe the bug

We are getting high disk usage

Steps To Reproduce

Configure amplify
Launch app
Use app

Expected behavior

It should not give a warning for high disk usage.

Amplify Framework Version

2.39.0

Amplify Categories

DataStore

Dependency manager

Swift PM

Swift version

5.9.2

CLI version

12.11.1

Xcode version

15.2

Relevant log output

-

Is this a regression?

Yes

Regression additional context

Screenshot 2024-10-01 at 11 36 46 PM Screenshot 2024-10-01 at 11 37 02 PM

Platforms

iOS

OS Version

iOS 18.0

Device

iPhone 12

Specific to simulators

No response

Additional context

No response

@github-actions github-actions bot added pending-triage Issue is pending triage pending-maintainer-response Issue is pending response from an Amplify team member labels Oct 1, 2024
@5d
Copy link
Member

5d commented Oct 1, 2024

Hi @amruth-movano,

We use the SQLite.swift library to handle SQLite queries. From what I understand, WAL mode is not enabled by default in SQLite.swift. It uses a single connection to perform serialized database operations. The warning you're seeing usually arises when there are multiple connections accessing the same database.

Could you share more details on how to reproduce the issue? How are you testing the app? Did you restart the DataStore? Also, how many models are defined in your schema?

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Oct 1, 2024
@amruth-movano
Copy link
Author

amruth-movano commented Oct 1, 2024

@5d
We are using 14 models.
On launch, we do amplify.start synchronization and getting this error

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Oct 1, 2024
@5d
Copy link
Member

5d commented Oct 1, 2024

Hi @amruth-movano ,

Thanks for the quick response. Is this during the initial sync (e.g., when the app is opened for the first time) of the datastore? What is the estimated data volume?

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Oct 1, 2024
@amruth-movano
Copy link
Author

@5d yes its begin to happen on app launch and memory increasing in MBs. cpu usage also increasing to 100-200 %

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Oct 2, 2024
@mattcreaser mattcreaser added bug Something isn't working datastore Issues related to the DataStore category and removed pending-triage Issue is pending triage labels Oct 4, 2024
@amruth-movano
Copy link
Author

@5d is there any update on this?

@thisisabhash
Copy link
Member

Hello, Would you be able to post more context about the issue?

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Oct 9, 2024
@amruth-movano
Copy link
Author

@thisisabhash
We have 8 models to sync on Amplify.Datastore.start(), yes we are using selective sync.
We don't have steps to reproduce but it is coming again & again

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Oct 16, 2024
@vincetran
Copy link
Member

@amruth-movano Can you provide code snippets to how you're calling this so that we can try and reproduce the issue?

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working datastore Issues related to the DataStore category
Projects
None yet
Development

No branches or pull requests

5 participants