August 18th, 2000, 02:15 AM
I have found a nice guestbook scripts and noticed that it reads the whole guestbook data file to a variable and then adds the new enty then appends the variable contents to the file so that new entries will be at the top.
I modified the script to use flock to avoid lossing and tried to change program to append only the new enty at the top using seek()
put the data goes at the end of the file. so i left the program as is but I don't know if reading a larg file to memory slows down the server.
August 18th, 2000, 03:46 AM
You'll almost certainly be getting a performance boost from flock()'ing and seek()'ing as it does take a little time to read a file into memory (and then obviously takes up a potentially large amount of space in memory). Realistically, though, unless you're getting a lot of requests and/or have a pretty sizable file (>10k) you probably won't notice much difference -- best way to tell is to run benchmarks on the code to see how it performs. The standard Benchmark.pm module suffices to do this -- check perldoc Benchmark for more information. There could also be issues with using flock() as it is not especially portable and can be slow on systems that use emulation rather than direct support of it. Your best bet really is to run the benchmarks and see what works best for you on your system.
August 20th, 2000, 06:11 PM
It's good for file writing/reading but it would take more RAM of the servers
Maybe the script needs a better initial design (more smaller files)
http://new.123finder.com/ - Helps you find cool domains for FREE & Registers it for only $14.95/yr
http://www.guideclick.com/ - Qualified webmaster resources (affiliate programs, web design, tips)