-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
data: currencies, engine descriptions and osm_keys_tags: use SQLite instead of JSON #3458
Open
dalf
wants to merge
3
commits into
searxng:master
Choose a base branch
from
dalf:data_use_sqlite
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dalf
changed the title
data: engine descriptions: use SQLite instead of JSON
data: currencies and engine descriptions: use SQLite instead of JSON
May 4, 2024
dalf
force-pushed
the
data_use_sqlite
branch
2 times, most recently
from
May 4, 2024 11:08
8557d79
to
42e1d92
Compare
dalf
changed the title
data: currencies and engine descriptions: use SQLite instead of JSON
data: currencies, engine descriptions and osm_keys_tags: use SQLite instead of JSON
May 4, 2024
dalf
force-pushed
the
data_use_sqlite
branch
2 times, most recently
from
May 4, 2024 15:43
cab91d5
to
a1a9156
Compare
mrpaulblack
added a commit
to paulgoio/searxng
that referenced
this pull request
May 6, 2024
* integration testing of searxng/searxng#3458 -> this switch is only temporary
return42
approved these changes
May 9, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dalf can we merge this PR or are you waiting for more test results?
dalf
force-pushed
the
data_use_sqlite
branch
2 times, most recently
from
May 18, 2024 20:34
f5da9b4
to
bf959dd
Compare
To reduce memory usage, use a SQLite database to store the engine descriptions. A dump of the database is stored in Git to facilitate maintenance, especially the pull requests made automatically every month. Related to * searxng#2633 * searxng#3443
After some test on Paul's instance, the memory increases to nearly its original value after few days. I have updated the code:
@mrpaulblack can you try the last update? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
To reduce memory usage, use a SQLite database to store the engine descriptions, currencies and OSM keys/tags.
Dump of the databases are stored in Git to facilitate maintenance, especially the pull requests made automatically every month.
With this PR
searx.data
provides some functions to access the data:The function names starts with
fetch
instead ofget
to emphasis the fact the data are fetch from the databases.With these functions are part of the code or engines can access the data without weird import like in the apple map engine:
searxng/searx/engines/apple_maps.py
Line 9 in dbed8da
Why is this change important?
It spares about 20MB per worker similar to #3443, but the memory remains low even after some queries using OSM (for example).
SQLite is going to cache some pages, but as far I understand this is kernel cache:
About load time: it takes 10ms to load
useragents.json
,external_urls.json
,wikidata_units.json
,external_bangs.json
,engine_traits.json
andlocales.json
on my AMD 5750GE. Even ten time slower is still reasonable IMO: the HTTP requests during the initialization are way slower than that.How to test this PR locally?
Author's checklist
Related issues
Related to