473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Reading large log files

Hi guys.

Im creating a log-reader online for my game server admins, so that I won't have to give FTP access etc.

The files are from 30-60M MB max in size and I have a working reader atm, but it's not perfect and it slows down fast.

In the middle of the file reading, Im working with lines to replace or add HTML (and some kind of filter for different in-game chat types (a lot of IF and StriStr operations etc)), so I'm wondering what's the best way to do this?

I have a mysql database available if that could be useful, storing each line in there maybe?

IDK, but I hope some of you do :)
Jul 31 '11 #1
2 1940
PHPstarter,

This really depends on what you're doing with your logfiles.

There's no point just dumping them into a database as you'll just end up reading them from the database sequentially instead of from the disk.

To go the database route, you need to determine which pieces of information are relevant from the lines in the log file, the split them up and store them in various fields. Doing this allows you to create the appropriate indexes, which will speed up your searching.

Determine what you want to do first though. It may be quicker to split the files up into smaller text files and strip out all irrelevant info for the working files.

Once you're determined what you want to do, specifically, then decide on the appropriate mechanism.
Aug 1 '11 #2
Rabbit
12,516 Expert Mod 8TB
If what you're doing is dumping out the entire log file, you could page it. Like they do with search results. Output a megabyte at a time with links to the other pages.
Aug 1 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

19
by: Brad Tilley | last post by:
I have some large files (between 2 & 4 GB) that I want to do a few things with. Here's how I've been using the md5 module in Python: original = file(path + f, 'rb') data = original.read(4096)...
5
by: Paul | last post by:
I'm using Microsoft's ASPFileUpload routines and all works fine as long as my files are smaller than about 200K. For anything larger than about 210K, I get the following error: Error Type:...
3
by: Steven Burn | last post by:
The application; Service on my webserver that allows a user to upload their HOSTS file for functions to verify the contents are still valid. Uses; 1. XMLHTTP (MSXML2) 2. FileSystemObject...
3
by: Michael | last post by:
X-Replace-Address Hello, I am trying to write a program at work for reading/writing files larger than 4 GB. I know that Windows supports files that big but I have not been able to get my...
2
by: JS | last post by:
Hello all! I have come on to a problem for which I am not able to find a solution searching the web. What I am trying to do is reading a log-file with a size of 1.3 GB. When reading it using...
3
by: Paul Spielvogel | last post by:
I need to compute the MD5 hash on VERY large files 500mb to 4gb+ I have found two ways but neither one of them does what i need. Private Function ComputeDataMD5(ByVal path As String) As String...
3
by: Eric Twietmeyer | last post by:
Hello, I have code written using the basic fstream object on a Win32 system. This is of course simply a typedef for basic_fstream<char, char_traits<char. This object can not be used to write...
1
by: akalmand | last post by:
Hi there, I am writing a code to read some data from the text files. The number of text files is not fixed and could be more that 15. the length of each file is large... close to 100,000 on an...
2
by: Kevin Ar18 | last post by:
I posted this on the forum, but nobody seems to know the solution: http://python-forum.org/py/viewtopic.php?t=5230 I have a zip file that is several GB in size, and one of the files inside of it...
17
by: byte8bits | last post by:
How does C++ safely open and read very large files? For example, say I have 1GB of physical memory and I open a 4GB file and attempt to read it like so: #include <iostream> #include <fstream>...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.