Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
d018f2a0
Commit
d018f2a0
authored
6 years ago
by
roadscape
Browse files
Options
Downloads
Patches
Plain Diff
bump up LRU post map to 2M entries
parent
e1a504f3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
hive/indexer/posts.py
+2
-1
2 additions, 1 deletion
hive/indexer/posts.py
with
3 additions
and
2 deletions
README.md
+
1
−
1
View file @
d018f2a0
...
@@ -68,7 +68,7 @@ Precedence: CLI over ENV over hive.conf. Check `hive --help` for details.
...
@@ -68,7 +68,7 @@ Precedence: CLI over ENV over hive.conf. Check `hive --help` for details.
### Hardware
### Hardware
-
Focus on Postgres performance
-
Focus on Postgres performance
-
2GB of memory for hive
itself (TODO: verify/limit max usage during initial sync)
-
2
.5
GB of memory for
`
hive
sync`
process
-
200GB storage for database
-
200GB storage for database
...
...
This diff is collapsed.
Click to expand it.
hive/indexer/posts.py
+
2
−
1
View file @
d018f2a0
...
@@ -18,6 +18,7 @@ class Posts:
...
@@ -18,6 +18,7 @@ class Posts:
"""
Handles critical/core post ops and data.
"""
"""
Handles critical/core post ops and data.
"""
# LRU cache for (author-permlink -> id) lookup
# LRU cache for (author-permlink -> id) lookup
CACHE_SIZE
=
2000000
_ids
=
collections
.
OrderedDict
()
_ids
=
collections
.
OrderedDict
()
_hits
=
0
_hits
=
0
_miss
=
0
_miss
=
0
...
@@ -56,7 +57,7 @@ class Posts:
...
@@ -56,7 +57,7 @@ class Posts:
def
_set_id
(
cls
,
url
,
pid
):
def
_set_id
(
cls
,
url
,
pid
):
"""
Add an entry to the LRU, maintaining max size.
"""
"""
Add an entry to the LRU, maintaining max size.
"""
assert
pid
,
"
no pid provided for %s
"
%
url
assert
pid
,
"
no pid provided for %s
"
%
url
if
len
(
cls
.
_ids
)
>
1000000
:
if
len
(
cls
.
_ids
)
>
cls
.
CACHE_SIZE
:
cls
.
_ids
.
popitem
(
last
=
False
)
cls
.
_ids
.
popitem
(
last
=
False
)
cls
.
_ids
[
url
]
=
pid
cls
.
_ids
[
url
]
=
pid
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment