• Print

Author Topic: ULX Log efficiency  (Read 25 times)

0 Members and 1 Guest are viewing this topic.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
ULX Log efficiency
« on: May 30, 2011, 08:10:58 pm »
Ok, Pantho has some potential truths behind his 'complaint' at the facepunch ULX 3.51 release thread.
He states (for those who don't want to look at the several posts of page 1 and 2) that at the end of the day on busy servers with log files that have grown large...some lag occurs when the logging is occurring. Noticeably so than at the beginning of the day.
Which to me makes perfect sense, we use a file.write ( file.read .. <new content> ) for every logged action.
Larger files would make that time increase. Thrash the drive for multiple spawns and what not, the larger the file is.

So, whats this? http://wiki.garrysmod.com/?title=Filex.Append
It says 'extended' file library. Is it something Garry has in Gmod, or is it another library like ULib, that someone just threw into the Gmod wiki?
And, if in Gmod, is it quicker than our current method?
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2727
  • Karma: 430
    • |G4P| Gman4President
Re: ULX Log efficiency
« Reply #1 on: May 30, 2011, 09:33:51 pm »
Assuming it is built into gmod it would be quicker I would assume.

Rather than loading the entire file into memory and writing the data to be logged to the end of that and then rewritten in whole to the text file, append simply adds new data to the end of the existing file.


At least that is how I understand the function of file.append.



EDIT: Just realized that it's filex.Append. This leads me to believe that it may in fact be an extended library that someone wrote and added to the wiki. I certainly hope not.. however if it weren't, why wouldn't Garry have just named it file.Append ??
« Last Edit: May 30, 2011, 09:37:23 pm by MrPresident »

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: ULX Log efficiency
« Reply #2 on: May 30, 2011, 09:40:27 pm »
Sorry to disappoint, did you really think garry that intelligent?

I've been talking this over with Stickly Man though. In ULX 3.50 we started logging everything to the main server log (server.log) anyways, so the logs under data are just a "cleaner" view now. Because of this, I was thinking about implementing a buffer system. For example, only write out the logs when there's something to write out every second or so. The downside is that you don't have as much information in the event of a crash, but that information would still be in the main log (server.log) anyways since there's no reason for us to buffer that (since it was programmed by someone who isn't garry :P).
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX Log efficiency
« Reply #3 on: May 31, 2011, 03:41:49 pm »
Ugh. As I expected, it's just another lua way of doing what we already do.

Oh, and, Megiddo, aren't you supposed to still be across the ocean somewhere.
I mean, I'm glad if you're back and all, but...did the time you were away REALLY fly by that fast, even for me, who wasn't there with you, having fun, except for in spirit?
Geez. it flew for me if you are back. I can't imagine how horribly fast it flew by for you since you were the one enjoying it.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: ULX Log efficiency
« Reply #4 on: May 31, 2011, 03:54:03 pm »
Ugh. As I expected, it's just another lua way of doing what we already do.

Oh, and, Megiddo, aren't you supposed to still be across the ocean somewhere.
I mean, I'm glad if you're back and all, but...did the time you were away REALLY fly by that fast, even for me, who wasn't there with you, having fun, except for in spirit?
Geez. it flew for me if you are back. I can't imagine how horribly fast it flew by for you since you were the one enjoying it.

Yep, I'm back! It was over two weeks... did it really pass that fast for you? Time flew by for me, but that's understandable. Though near the end I was ready for a vacation from the vacation. You can only see so many wonderful things before your head explodes after all (it's true, I read a study on it somewhere!! :P).

Went and saw eight different countries: England, France, Belgium, Holland, Germany, Austria, Italy, Switzerland (my favorite!), then France again. The swiss are awesome, they're like a cleaner and more organized America, except that they charge you outrageous prices for everything. :P

In Italy I learned not to trust the elevators. Seriously, never use an Italian elevator. *cringe*
Experiencing God's grace one day at a time.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: ULX Log efficiency
« Reply #5 on: June 27, 2011, 06:27:57 pm »
ULX rev 182 now takes advantage of file.Append. In other news, I'm super happy with they way the logging system was written. One line of code changed ftw! But, I can't take the credit... if memory serves, spbogie wrote the original logging module.
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX Log efficiency
« Reply #6 on: June 27, 2011, 07:41:48 pm »
Yay spbogie. Our silent partner.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

  • Print