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

New server performance fixes #368

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

New server performance fixes #368

wants to merge 9 commits into from

Conversation

fstachura
Copy link
Collaborator

No description provided.

tleb added 8 commits December 24, 2024 16:05
Benchmarks tell us throughput increases linearly with processes count.

Signed-off-by: Théo Lebrun <[email protected]>
Before, we copied all source files at the start of the Dockerfile; that
meant we always rebuilt most steps. Only copy requirements.txt first,
then copy the rest after many steps.

Signed-off-by: Théo Lebrun <[email protected]>
This behavior isn't used at the moment, but is much more sensible that
the past that was to give None to whatever content-type lambda we had
(eg DefList that would call split on the None).

Signed-off-by: Théo Lebrun <[email protected]>
Lookup if a definition exists is taking too long to render source code.
Generate small databases that only tell us if a definition exists for a
given family. Because the database is much smaller, it is faster to
query.

Many URLs could only be queried at 12 req/s. With that patch, I can do
>80 req/s on the same URLs, with the same config.

We generate the caches from update.py. We also add an edge-case to
generate the files (if they don't exist) even if no new tag exists.

Signed-off-by: Théo Lebrun <[email protected]>
Apparently we might need this for some C code extensions:

> Forcing a WSGI application to run within the first interpreter can be
> necessary when a third party C extension module for Python has used
> the simplified threading API for manipulation of the Python GIL and
> thus will not run correctly within any additional sub interpreters
> created by Python.

https://www.modwsgi.org/en/latest/configuration-directives/WSGIApplicationGroup.html

Signed-off-by: Théo Lebrun <[email protected]>
docker/gitconfig Show resolved Hide resolved
docker/000-default.conf Show resolved Hide resolved
elixir/data.py Show resolved Hide resolved
@@ -189,6 +189,15 @@ def update_versions(self, tag):
db.vers.put(tag, obj, sync=True)


def generate_defs_caches():
for key in db.defs.get_keys():
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How long does this take for linux?

Copy link
Member

Choose a reason for hiding this comment

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

Pretty slow (on my workstation):

⟩ echo 3 | sudo tee /proc/sys/vm/drop_caches > /dev/null

⟩ command time python -c "
  import berkeleydb ;
  db = berkeleydb.db.DB() ;
  db.open('../elixir-data/linux/data/definitions.db', flags=berkeleydb.db.DB_RDONLY) ;
  db.keys()"
5.21user 8.20system 0:43.29elapsed 30%CPU (0avgtext+0avgdata 455720maxresident)k
8610048inputs+0outputs (40major+103071minor)pagefaults 0swaps

⟩ command time python -c "
  import berkeleydb ;
  db = berkeleydb.db.DB() ;
  db.open('../elixir-data/linux/data/definitions.db', flags=berkeleydb.db.DB_RDONLY) ;
  db.keys()"
1.29user 0.84system 0:02.15elapsed 99%CPU (0avgtext+0avgdata 457048maxresident)k
0inputs+0outputs (0major+103090minor)pagefaults 0swaps

update.py Show resolved Hide resolved
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