let's say you have a game server that creates textbook files for gamers' actions, and from time to time you need to look for something in these log files (for example, fraud investigation or item loss). For example, you have 100 files, and each file has a size of 20 MB to 50 MB. How would you quickly look for them?
What I already tried to do is create several threads, and each invisible thread will display its own file in memory (let memory should not be a problem if it does not exceed 500 MB of RAM) does a search here, the result was something about 1 second for each file:
File: a26.log - in the program: 0.891, lines: 625282, matches: 78848
Is there a better way to do this? - because it seems to me slow. thank.
(java was used for this case)
source
share