I have a MySql table which consists of:
The data itself consists of a text of ~100 chars + several fields with meta data about it. The indexes are the unique id, the writer name, and the writer id.
Till now, everything went smooth, but now the server is having a hard time handling the inserts of the new data (~10seconds for each insert which adds ~3k lines). I'm trying to find ways to overcome this issue. Things I consider:
Each option has its sub-options and dilemmas, but I think I should firstly focus on having a direction. Which route should I take and why? Is there a different road I should think of?
BTW - There is also an option to not keep all the data, and only the parts I really display, but that will make it impossible to do some functional changes in the process that data is going through before being displayed.
is the current engine optimal for the usage?
Have you concidered http://dev.mysql.com/doc/refman/5.1/en/partitioning-management.html
If you're adding 3,000,000 rows a day, and 3000 rows takes a 10 second transaction, you're talking about 1,000 transactions a day, which should take about 170 minutes a day. That's really not that much.
I think I'd first try
You might find that inserting more rows per transaction actually takes less overall time. And if not, it's easy to revert. If you stash the rows somewhere else first, you can run the INSERT transactions during times of low load.
Tuning the server is probably a good idea regardless. For reference, see the MySQL docs on Tuning Server Parameters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With