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

Optimize nginx vhost generation #863

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

Conversation

vjrj
Copy link
Collaborator

@vjrj vjrj commented Dec 27, 2024

This pull request refactors the Ansible roles for Nginx virtual host configuration by removing redundant tasks and consolidating the configuration into templates. The key changes include the removal of individual fragment tasks, the creation of comprehensive Jinja2 templates, and the introduction of macros to streamline the configuration process.

Refactoring and Consolidation

Template Creation

Macro Introduction

Performance Impact

The refactored approach reduced the Nginx vhost generation time for biocache-service from 137.24 seconds (249 in a second run) to 27.41 seconds addressing the slowest tasks of ala-install (see #693).

Tested

This is tested with several roles with different subdomain-a.l-a.site, subdomain-b.l-a.site etc, using SSL and not using SSL. The nginx vhost generated (and the default host conf) are equals to the ones generated without this PR (with minimal indentation differences).

Not supported yet

Sites using a samedomain.l-a.site/app-1 and samedomain.l-a.site/app-2, etc. in the same server. I'm not sure if this is used by ALA. If we still need this, this PR needs more work to support it.

@vjrj vjrj marked this pull request as draft December 27, 2024 19:05
@vjrj vjrj marked this pull request as ready for review December 31, 2024 09:42
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.

1 participant