Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

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,732 jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 3 Days 14 h 52 m 36 sec
Reputation Power: 977
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 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)  Folding Points: 4925 Folding Title: Novice Folder
Time spent in forums: 3 Months 3 Weeks 5 h 56 m 41 sec
Reputation Power: 1345
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,732 jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 3 Days 14 h 52 m 36 sec
Reputation Power: 977
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 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)  Folding Points: 4925 Folding Title: Novice Folder
Time spent in forums: 3 Months 3 Weeks 5 h 56 m 41 sec
Reputation Power: 1345
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,732 jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level)jharnois User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 3 Days 14 h 52 m 36 sec
Reputation Power: 977
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 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 5th Grade (Above 100000 Reputation Level)  Folding Points: 4925 Folding Title: Novice Folder
Time spent in forums: 3 Months 3 Weeks 5 h 56 m 41 sec
Reputation Power: 1345
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



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT