MySQL Forums
Forum List  »  Newbie

Need to insert 10k records into table per second
Posted by: Cecil none
Date: February 03, 2014 04:18PM

tldr; trying to use ramdrive to get lots of data into a table and then dump table to regular hard disk.

So I'm playing around with a syslog system that handles network logs for a small ISP. The system generates around 5-15k lines of log data per second :(

I can easily dump these into txt files and a new file is created every few thousand lines but I'm trying to get this data directly into a MySQL database (or rather several tables of a 100k lines each) but obviously I'm running into some issues with this volume of data.

My plan was to create a 4Gb ramdrive or something to that extent and then get the data into tables until the table gets to a certain size. Create a new table and dump the previous one to a regular drive or SSD if needed.

I'm stuck at step one, I created a ramdrive and used this:
create table actions2 (MAC varchar(20), action varchar(40), date datetime, protocol int, dstIP varchar(16), port int) data directory = 'J:\mysql';
to create a test table. (J: is a small 200Mb ramdrive)

I start the program to read a test logfile (also stored on the ramdrive to avoid disk bottlenecks) and write it into the "actions2" table. It does this but it take about 15 seconds to do just over 20k lines and my computers disk usage is through the roof. Only when the whole process is complete does the actual table show up in the ramdrive.

My tmp_table_size is 101M (default) and the end result table is 10.2Mb. Why is it still using my regular hard drive?

I'm still pretty new to MySQL and things and I know I'll be crucified for even mentioning that I'm using VB.net and Windows and so on for this project but I am also trying to prove a point by doing all that.

Options: ReplyQuote


Subject
Written By
Posted
Need to insert 10k records into table per second
February 03, 2014 04:18PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.