PDA

View Full Version : [HELP] MySQL CPU Problem


GeorgeBrown
02/10/2012, 04:59 PM
Good evening.

I use mysql on my server and faced to cpu problem. when player connects to the server cpu increases rapidly. for example if there are 15 players on server cpu can reach 40 percents. I have ******d and found out that this problem may be caused by mysql.

what solution is best for this problem?

Vince
02/10/2012, 05:02 PM
You wouldn't need more than 2, maybe 3 queries to load all the data you need. I'm curious as to what you're actually trying to retrieve. For comparison: a simple page request on these very forums takes some 13 queries.

GeorgeBrown
02/10/2012, 05:04 PM
Player accounts are stored to mysql db, so every second data is updated in database.

Vince
02/10/2012, 05:13 PM
Useless. A player's data isn't updated that frequently. I'd update roughly every 15 - 30 minutes. Certainly not every second. If players lose their stats from the last 15 minutes in case of a server crash then so be it. It ain't the end of the world. Certain queries such as password or admin level changes can potentially get priority but that's about it.

GeorgeBrown
02/10/2012, 05:17 PM
Thank you for an advice, will try.