Closed Bug 1351695 Opened 4 years ago Closed 4 years ago

Allow apache to ignore .htaccess for increased performance

Categories

(bugzilla.mozilla.org :: General, enhancement)

Production
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dylan, Assigned: dylan)

References

()

Details

Attachments

(1 file, 2 obsolete files)

if you run strace on httpd during normal operation, you'll see we make thousands of stat() calls to .htaccess files.
One request for a file under /data/assets is three calls to stat(), and if NFS is involved those calls can take a decent amount of time.

We don't need to do this, we already send configuration directives to apache from mod_perl.

I intend to make mod_perl.pl read in the .htaccess file, and send the configuration to apache and also send AllowOverride None, which will prevent apache from looking for .htaccess files.
Attached patch 1351695_1.patch (obsolete) — Splinter Review
Attachment #8852524 - Flags: review?(glob)
Comment on attachment 8852524 [details] [diff] [review]
1351695_1.patch

Review of attachment 8852524 [details] [diff] [review]:
-----------------------------------------------------------------

as per irc, there's multiple .htaccess files to accommodate:
https://github.com/mozilla-bteam/bmo/blob/master/Bugzilla/Install/Filesystem.pm#L340
Attachment #8852524 - Flags: review?(glob) → review-
Attached patch 1351695_2.patch (obsolete) — Splinter Review
I moved this to its own file as it is easier to validate outside of apache:

perl -T -I. -MBugzilla::ModPerl -E 'say Bugzilla::ModPerl->apache_config(".")'

and it now looks for all .htaccess files.
Attachment #8852524 - Attachment is obsolete: true
Attachment #8852591 - Flags: review?(glob)
Attached patch 1351695_3.patchSplinter Review
sans Alive logging code.
Attachment #8852591 - Attachment is obsolete: true
Attachment #8852591 - Flags: review?(glob)
Attachment #8852593 - Flags: review?(glob)
Comment on attachment 8852593 [details] [diff] [review]
1351695_3.patch

Review of attachment 8852593 [details] [diff] [review]:
-----------------------------------------------------------------

r=glob

::: Bugzilla/ModPerl.pm
@@ +5,5 @@
> +#
> +# This Source Code Form is "Incompatible With Secondary Licenses", as
> +# defined by the Mozilla Public License, v. 2.0.
> +
> +package Bugzilla::ModPerl;

a package so good it was declared twice.

this may be better named Bugzilla::ModPerlConfig as that's all it does.

@@ +17,5 @@
> +
> +# We don't need (or want) to use Bugzilla's template subclass.
> +use Template ();
> +
> +sub apache_config {

a comment about why this is necessary would be helpful here.

@@ +28,5 @@
> +    my $wanted = sub {
> +        package File::Find;
> +        our ( $name, $dir );
> +
> +        if ( $name =~ /\.htaccess$/ ) {

$name =~ m#/\.htaccess$#
Attachment #8852593 - Flags: review?(glob) → review+
With corrections

To git@github.com:mozilla-bteam/bmo.git
   b2744a5..30c35b3  master -> master
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.