Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.

ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!
Download and Activate to enter!

Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.

Learn More!


Download to Enter
| Contest Rules

Tutorials | Forums

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 23rd, 2006, 08:28 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,802 jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 4 h 32 m 44 sec
Reputation Power: 1059
Is the .htaccess performance loss acceptable when it eases maintenance?

The documentation on .htaccess says in summary that one should not use .htaccess files when one has access to httpd.conf because of the performance implications (and security, but that's not a factor in this situation).

However, what about ease of maintenance and logical site assembly?

Isn't .htaccess easier to maintain on a server with hundreds of folders and subfolders? It seems logical to keep your Apache directives that are related to the content in that folder with the folder itself, just like you'd keep the images, config files, data files (no database), stylesheets, etc for that content in that folder.

Isn't this the same situation as using a server-side scripting language to include the same content on multiple pages? This "templating" reduces the server's performance but eases site maintenance, so it's widely accepted practice.

Couldn't it be said that using .htaccess has the same benefits as templating?

This situation relates to a large site (currently several hundred directories and 20,000+ files) on a dedicated server.
__________________
# Jeremy

Explain your problem instead of asking how to do what you decided was the solution.

Reply With Quote
  #2  
Old August 24th, 2006, 05:24 PM
SimonGreenhill's Avatar
SimonGreenhill SimonGreenhill is offline
(retired)
Dev Shed God 11th Plane (10000 - 10499 posts)
 
Join Date: Dec 2003
Location: The Laboratory
Posts: 10,101 SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 4925 Folding Title: Novice Folder
Time spent in forums: 3 Months 3 Weeks 6 h 8 m 34 sec
Reputation Power: 0
Facebook
Hi Jeremy,

I do think per-directory config files are easier to manage.

However, I'm not sure how much slower we're talking - I've *never* seen a benchmark of this (but every tuning discussion I've seen mentions this), and a quick google didn't turn anything up. I'm guessing it depends on the level of nesting ( i.e. you have one filesystem seek'n'read for each htaccess file for each dir of the path ).

If I get some time this weekend I might have a go at benchmarking it (although this might be quite hard ).

Hmm... what about keeping .htaccess files in the dirs, turning off Override, and writing a perl/python script to find all .htaccess'es and merge them into the httpd.conf file?

--Simon

Reply With Quote
  #3  
Old August 25th, 2006, 04:04 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,802 jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 4 h 32 m 44 sec
Reputation Power: 1059
It would be interesting to see some benchmark results. If you don't get to them this weekend, I may end up doing them down the road before I make this decision.

I'm in the preliminary stages of redesigning a very large website that will only get larger. I'll need to be able to make adjustments and changes to various existing directories and possibly immediately as I make new directories. Throwing open an .htaccess file, making the modification, and being done sounds much, much easier than having to go through the steps of making the change on the server by wading through one very large config file or many smaller ones and having to restart the server to have it take effect.

I would think the efficiency loss would be almost equivalent to that of using an include in terms of disk I/O, so if it eases maintenance in the same way as an include does, it only seems logical to use .htaccess.

Reply With Quote
  #4  
Old August 27th, 2006, 03:53 AM
SimonGreenhill's Avatar
SimonGreenhill SimonGreenhill is offline
(retired)
Dev Shed God 11th Plane (10000 - 10499 posts)
 
Join Date: Dec 2003
Location: The Laboratory
Posts: 10,101 SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 4925 Folding Title: Novice Folder
Time spent in forums: 3 Months 3 Weeks 6 h 8 m 34 sec
Reputation Power: 0
Facebook
Ok, so I've had a go at benchmarking, and the httpd.conf can handle ~3 requests/second more. I'll do a few more tests and see if this averages out and then write up a full post of what I've done.

Edit: right, 2.4% difference in number of requests served / second when htaccess is turned off, but this is with a heavily nested dir. structure (10 subdirs ). Full details are here.

--Simon
Comments on this post
jharnois agrees: Thanks a lot!

Last edited by SimonGreenhill : August 27th, 2006 at 06:43 AM.

Reply With Quote
  #5  
Old August 27th, 2006, 09:39 AM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,802 jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level)jharnois User rank is General 1st Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 4 h 32 m 44 sec
Reputation Power: 1059
That doesn't seem like a significant difference to me, especially if you offset the loss elsewhere: faster disks, a raid array (although, this could reduce efficiency, too), some kind of caching like mod_mem_cache, reducing the directory depth, using static HTML files, etc.

Reply With Quote
  #6  
Old August 27th, 2006, 03:34 PM
SimonGreenhill's Avatar
SimonGreenhill SimonGreenhill is offline
(retired)
Dev Shed God 11th Plane (10000 - 10499 posts)
 
Join Date: Dec 2003
Location: The Laboratory
Posts: 10,101 SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 4925 Folding Title: Novice Folder
Time spent in forums: 3 Months 3 Weeks 6 h 8 m 34 sec
Reputation Power: 0
Facebook
yeah - it's definitely on the trivial side of things ( & in this case Apache is checking 10 dirs, this is probably a worst case scenario ).

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Is the .htaccess performance loss acceptable when it eases maintenance?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap