by AznHisoka · 13y ago · 0 comments
Also, consider creating a buffer in the application layer that buffers inserts/updates and executes them once as a single transaction, if they don't need to be executed immediately. It puts less stress on the database. Of course, this would require a lot of rewriting in your app, so not sure if you want to go through this route.
Indices are another area. I'm sure plenty of people have told you to optimize your indices, but also consider REMOVING unnecessary indices. Do you have an index on a text column, or multiple varchar columns? Those can be killer after awhile because inserts will slow down. Consider changing indices on varchar columns to indices on an int column by hashing those strings.
A quick suggestion: Install NewRelic (it's free for a certain period), and check out the database transactions that are taking up the most CPU load. Sometimes there's that 1 query you overlooked that is table scanning and could be the main culprit.
Also, are you using Rails by any chance? If so, there are other areas I can suggest.
And please post your server specs. Maybe your VPS just does suck (no offense), and the easiest route is just to upgrade your server.
MySQL performance tuning and table structure/query optimization-wise, we've left few stones unturned (but I'm sure there still is a scope for further improvement - isn't there always?).
Not using Rails.
Server specs: 4 cores, 3.2GB RAM
>and the easiest route is just to upgrade your server.
Please refer to the other thread for more on this.
Thanks again.
And how many reads are there usually a min? writes?
If you're doing something that makes any money you should get a real server before wasting days of effort or intentionally causing repeated outages.