473,761 Members | 6,563 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MySQL or flat file for user logs

43 New Member
I'm already using MySQL for most of my site but I just need a simple, non-dynamic log of every user's page visits while logged in to my site. My main concerns are disk space, the potential impact on server speed and the speed of other MySQL requests and the increased load on the processor.

I haven't tried to do this either way but read a pretty comprehensive tutorial on a flat file log system. These logs could just be downloaded on to my hard drive every 3-4 days and stored as reference in case something goes on later on, so disk space is probably of secondary concern. Again, potential impacts on disk speed are important. Any suggestions?
Aug 23 '07 #1
6 1391
Atli
5,058 Recognized Expert Expert
I would think that using MySQL would be easier on the system. Especially if you already have a connection open. It is designed for optimal performance.
Just remember to use MyISAM tables for your logs, as they are considerably faster that InnoDB tables.

Note, that I may be horribly wrong here, I have never tested this. This is just my best guess.
Aug 24 '07 #2
akapsycho
43 New Member
Do you know what phpmyadmin sets up by default? I would have thought that having the increased load of queries would slow down the database and possibly affect the other queries that need to be run.
Aug 24 '07 #3
Atli
5,058 Recognized Expert Expert
Do you know what phpmyadmin sets up by default? I would have thought that having the increased load of queries would slow down the database and possibly affect the other queries that need to be run.
I don't know about phpMyAdmin, I've never really used it.
This will of course slow down the database as the log queries will eat up resources that would otherwise be used for the other queries.
But so will writing them to the file system. My guess is that messing will the file system will eat up more resources, because, as I say, MySQL is designed for optimal performance.
Aug 24 '07 #4
akapsycho
43 New Member
Alright, MySQL it is then. Thanks. If anyone else has any input, I'd be more than happy to hear it!
Aug 24 '07 #5
mwasif
802 Recognized Expert Contributor
I am logging users' hits in MySQL. The average hits are 50K/hr. I am using InnoDB to logging so that I can easily query the table as well.

What you are going to save?
Aug 24 '07 #6
docdiesel
297 Recognized Expert Contributor
Hi,

if you're logging into a SQL database, just keep the log data away from other tables. As long as there's no action over tables of your portal that's affecting your log table(s) by sql join etc., the performance should be fine.

Furthermore, you could use different tables, a new one per day, rotate them, make an off-load of yestardays data over night, purge old data/tables when unneeded.

Don't know if there's such in MySQL, but DB2 has a parameter "APPEND" to tell a table always to write to its end and not to look for free space in between old rows. This speeds up also.

Regards,

Bernd
Aug 24 '07 #7

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

Similar topics

1
2630
by: The Voivod | last post by:
I have the requirements of getting a simple form to output to a db file. Currently I am using a form called ennyform and it outputs to a flat file. The person who want this wants it to be searchable and we expect to get anywhere from 50 - 300 forms submitted per day. I was reading that using php to MySQL was the correct way to get output into a MySQL database. I know this is not the only way but I am on a Linux platform and it is free. Is...
1
2389
by: Maxim. V. | last post by:
Hello to everone, As mentioned in this *guide(1), i've compiled mysql on my fedora Core 2 system, with the following spec's : *(1) http://hulan.info/blog/index.php?itemid=576 --------------- bash START -------------- $ uname -a Linux localhost.localdomain 2.6.8-1.521 #1 Mon Aug 16 09:01:18 EDT
17
2904
by: chicha | last post by:
Hey people, I have to convert MS Access 2000 database into mysql database, the whole thing being part of this project I'm doing for one of my faculty classes. My professor somehow presumed I knew db's and gave me long list of things to do with that particular database, first thing being that particular conversion. Truth is that I don't know a first thing about db's, let alone using mysql... I downloaded mysql form www.mysql.com and...
1
2829
by: Good Man | last post by:
Hi there I've noticed some very weird things happening with my current MySQL setup on my XP Laptop, a development machine. For a while, I have been trying to get the MySQL cache to work. Despite entering the required lines to "my.ini" (the new my.cnf) through notepad AND MySQL Administrator, the cache does not work. So, today I took a peek at the 'Health' tab in MySQL Administrator.
1
5285
by: PowerLifter1450 | last post by:
I've been having a very rough time installinig mySQL on Linux. I have been following the instructions form here: http://www.hostlibrary.com/installing_apache_mysql_php_on_linux Everytime I get to #./configure it goes through all of the preparing tables and starting mysqlServer and daemon, but than immediaetly says "mysql ended" -- I try to do #make right after anyway, but I get the error "No targets specified and no makefile found" -- Any...
110
10621
by: alf | last post by:
Hi, is it possible that due to OS crash or mysql itself crash or some e.g. SCSI failure to lose all the data stored in the table (let's say million of 1KB rows). In other words what is the worst case scenario for MyISAM backend? Also is it possible to not to lose data but get them corrupted?
0
6690
by: Chrom_ | last post by:
Mysql is filling my /var partition because the log limit doesn't seem to be respected. I've tried many different settings in /etc/mysql/my.cnf but nothing works. Logrotate is not enabled/configured. I just want mysql to use a maximum of, let's say, 1GB of my /var partition The log is /var/log/mysql/
5
9138
by: lisles | last post by:
i have a page funtion.php which hs the function to connect to the db /* Mysql Connection */ function connect(){ global $db_server,$db_user,$db_pass,$db;//Global Values from the config.php $conn = @mysql_connect($db_server,$db_user,$db_pass) or die("Connection to Database Server Failed"); @mysql_select_db($db) or die("Database Selection Failed"); return $conn; }
0
9336
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9948
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9902
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8770
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7327
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6603
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3866
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.