LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-11-2005, 08:43 PM   #1
gravesb
Member
 
Registered: May 2005
Distribution: Suse 9.3, Gentoo
Posts: 87

Rep: Reputation: 15
Apache binary .htaccess


I am slowly learning Apache, which is an incredible product. One of the things I was thinking of, which probably applies to most Linux software projects, is the ASCII based configuration files. Parsing text and converting it to machine instruction is obviously much slower than a binary config file. The config file is much easier for humans to read obviously, but it goes to the entire interpreting vs. compiling debate with programming languages. Their really isn't much impact with the .conf file, as all of the conversion is done up front, and once the server is running its all the same. Since .htaccess is read each time the directory is accessed, there is a large performance hit. I was wondering why no one had developed a process to convert the .htaccess to binary. I would think it would create a large performance improvement if .htaccess is the method you use to control different sets of permissions. I would work on implementing this myself if I had the programming expertise, but it is beyond me. Does anyone else have any thoughts on the subject, and would it be something worth doing as a community project?
 
Old 09-11-2005, 09:11 PM   #2
tomj88
Member
 
Registered: Apr 2005
Location: Wolverhampton, England
Distribution: Ubuntu
Posts: 334

Rep: Reputation: 30
I think it is a case that it would be a pain to convert the ascii text files to a binary file in the eyes of some people. But as you say there would be a significant performance increase. For example (I'm not sure whether this realy applies but here goes) in python, you can use a module called cPickle, which is compiled in c and is apparently up to 1000x faster than the pickle module, which is interpretted everytime it is used because it is wrote in python. Some may also argue over the use of .htaccess files, as it is far more efficient to have configuration in the apache config files (obviously, this is impossible if you don't have root on the system). I think that a binary version of .htaccess files would be more efficient, but whether people would bother using it is a different matter.
 
Old 09-11-2005, 09:20 PM   #3
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 125Reputation: 125
This might be interesting. What if apache could cache pre-parsed .htaccess files on a per-session basis? Each time you visit the directory, it will only stat() the .htaccess and check the mtime on it. If the mtime is unchanged, it can just use the cached version. The interesting question is where to store the cached data. Perhaps /tmp/htaccess-cache/<drivepartition>/<inodenumber>?
 
Old 09-11-2005, 09:28 PM   #4
tomj88
Member
 
Registered: Apr 2005
Location: Wolverhampton, England
Distribution: Ubuntu
Posts: 334

Rep: Reputation: 30
That would be very interesting! I think people would start using .htaccess files more often then if they were cached. Out of interest, are there any benchmark tests to show how much slower .htaccess files are?
 
Old 09-11-2005, 09:32 PM   #5
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 125Reputation: 125
Hrrm, that is a good question. I'm not sure even how to benchmark that kind of thing. Proper benchmarking, that is.
 
Old 09-11-2005, 09:35 PM   #6
tomj88
Member
 
Registered: Apr 2005
Location: Wolverhampton, England
Distribution: Ubuntu
Posts: 334

Rep: Reputation: 30
you could sit with a stop watch and try to time the loading times
 
Old 09-11-2005, 09:57 PM   #7
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 125Reputation: 125
Hrrm, yes. But then all I think we'd discover is that I have too much time on my hands.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache and .htaccess jamluv Linux - Security 9 06-03-2005 03:53 PM
apache .htaccess linuxanswer Linux - General 1 05-01-2004 05:20 PM
apache .htaccess emetib Linux - Software 4 09-22-2003 07:50 AM
is htaccess on apache 2.0 not the same as in 1.3 abd_bela Linux - General 3 07-23-2003 06:17 AM
.htaccess in apache 2 im1crazyassmofo Linux - Software 1 04-04-2003 02:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration