SA-MP Forums Archive
CPU Usage problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: CPU Usage problem (/showthread.php?tid=408865)



CPU Usage problem - CONTROLA - 19.01.2013

Hey guys, I've got a problem on my server: after being online for some hours, the CPU Usage gets VERY high (after ~24 hours, the CPU Usage goes up to 100%). That's not the real problem... but sometimes mysql begins to use CPU even more than the samp server itself when I save a data for all the players online, and the queries are executed extremely slow. So I've got the question: is it a MySQL problem, or a script problem?

Here's a screen: http://i.imgur.com/GqoYwhk.png

Please help me. Thanks!


Re: CPU Usage problem - Patrick - 19.01.2013

try to show us your OnPlayerUpdate or some of your script that you think make your server lags


Re: CPU Usage problem - CONTROLA - 19.01.2013

I'm not using OnPlayerUpdate nor many timers.


AW: CPU Usage problem - Blackazur - 19.01.2013

Try to reduce the Timers, or use an Streamer or try to script conserve resources.


Re: CPU Usage problem - CONTROLA - 19.01.2013

But can this be caused by the mysql plugin? I'm using MySQL R7 for saving data.


Re: CPU Usage problem - InfiniTy. - 19.01.2013

Quote:
Originally Posted by CONTROLA
Посмотреть сообщение
But can this be caused by the mysql plugin? I'm using MySQL R7 for saving data.
I'm st....


Re: CPU Usage problem - Vince - 19.01.2013

This is about CPU, not memory.

How many cores does your server have? I'm thinking at least a dual core, but I can't be sure. The three values after 'Load average' should give you an idea of how your server is performing. They show the server load in the last minute, the last 5 minutes and the last 15 minutes respectively. If the server has 2 cores then the maximum value for either of these is 2.00, if there are 4 cores then the maximum value is 4.00, and so on. So if the value is 0.60 on a dualcore then that means your server is at 30% (0.60/2.00) load.


Re: CPU Usage problem - CONTROLA - 19.01.2013

It has 2 cores.


Re: CPU Usage problem - CodyCummings - 19.01.2013

It's quite obvious that the mysql server (mysqld) is the problem, you need to check all of your MySQL in your script as there's quite obviously a problem. I can't do much without code but I understand if you don't want to post it .

Off-topic: I suggest htop to you, it's much more prettier than top.


Re: CPU Usage problem - Scenario - 19.01.2013

I'm assuming, since you're using MySQL R7, you're threading those MySQL queries, right?