hi, this topic is not directly about rails but I wanna hear your opinions and experience in this matter. you know apache''s access.log .. I am using lighttpd accesslog which is same as apache for some of my analysis. I copy the log into my database during my analysis for soem advanced queroies and then delete it. It''s done once a day on a non-loaded hour (5 am) so it doesnt bring in a problem of load. one of my colleagues advised to turn off accesslog and log access directly to database, because it''ll be faster. can it be true? the accesslog just appends a line to end of file, but database creates indexes etc. and at the end database also writes to several files. Can this statement be true? thanks in advance. onur _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 25 Dec 2005, at 15:49, Onur Turgay wrote:> one of my colleagues advised to turn off accesslog and log access > directly to database, because it''ll be faster. can it be true? the > accesslog just appends a line to end of file, but database creates > indexes etc. and at the end database also writes to several files. > Can this statement be true?Did you just ask if databases are faster to write to than flat files? If so, the answer is, of course, "it depends." Generally the answer is yes. Most sane modern database backends will write to pages in memory and so can do batched writes rather than line-by-line writes as would be used in an accesslog, even if there are a few indexes. Hope that helped. Yours, Craig -- Craig Webster | t: +44 (0)131 516 8595 | e: craig-07VhxHapISisTnJN9+BGXg@public.gmane.org Xeriom.NET | f: +44 (0)709 287 1902 | w: http://xeriom.net
thanks craig. On 12/25/05, Craig Webster <craig-07VhxHapISisTnJN9+BGXg@public.gmane.org> wrote:> > On 25 Dec 2005, at 15:49, Onur Turgay wrote: > > one of my colleagues advised to turn off accesslog and log access > > directly to database, because it''ll be faster. can it be true? the > > accesslog just appends a line to end of file, but database creates > > indexes etc. and at the end database also writes to several files. > > Can this statement be true? > > Did you just ask if databases are faster to write to than flat files? > > If so, the answer is, of course, "it depends." Generally the answer > is yes. Most sane modern database backends will write to pages in > memory and so can do batched writes rather than line-by-line writes > as would be used in an accesslog, even if there are a few indexes. > > Hope that helped. > > Yours, > Craig > -- > Craig Webster | t: +44 (0)131 516 8595 | e: craig-07VhxHapISisTnJN9+BGXg@public.gmane.org > Xeriom.NET | f: +44 (0)709 287 1902 | w: http://xeriom.net > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails