Cpu Usage Problem

04/28/2013 14:42 magnon#1
I have Problem My Cpu Usage take alot i have 6 Cpu and take 91%
[Only registered and activated users can see links. Click Here To Register...]
Mysqld it's only take all usage
[Only registered and activated users can see links. Click Here To Register...]
04/28/2013 14:43 Korvacs#2
I take it this is while your running a server?
04/28/2013 15:13 magnon#3
Yea when i close Server Cpu back to 0 usage it's big Vps 16 gigaRam and 6 Cpu
04/28/2013 15:59 Korvacs#4
Yeah, the problem is that your server is written badly, no real surprise there.
04/28/2013 18:59 magnon#5
Quote:
Originally Posted by Korvacs View Post
Yeah, the problem is that your server is written badly, no real surprise there.
So....

32 Viewer and no Resolved
04/28/2013 22:31 Korvacs#6
Quote:
Originally Posted by magnon View Post
So....

32 Viewer and no Resolved
Nope, the only way to resolve this is to rewrite your server, and since you have copy pasted most of your server from other servers its no wonder its broken to shit. lol
04/28/2013 22:36 Super Aids#7
Do you run any infinite loops that doesn't sleep for at least 1 miillisecond?
04/28/2013 23:39 magnon#8
I Resolved it it's was from programe.cs have alot of Save i just Delete it
04/28/2013 23:50 Korvacs#9
Quote:
Originally Posted by magnon View Post
I Resolved it it's was from programe.cs have alot of Save i just Delete it
Unbelievable :rolleyes:
04/29/2013 00:15 _Emme_#10
Good job! I usually do like that too, delete the saving parts. Mehh, who cares what they do - just select it all and delete! As long as it works, right?

Do you do consultant job?
04/29/2013 00:38 go for it#11
well i really would want to be sarcastic but i suck at it anyway
why would you save everything with loop from "programe.cs" instead of saving them from the event itself ?
what i mean is
lets assume that you are smart and only saving for online players
and lets assume that you give a good sleep for your saving maybe 5 ms or something
that will end you up saving maybe 200 variable for 50 players which is an avg of updating the database with 10,000 variable each 5 ms which is 120k variable per min
instead of saving variables at there own events
ex.
when someone jump you save check for the coords to be valid or not then save them as current , save the old as previous , calculate whatever you want for eliminating speedhacks (what's what i was personally doin in nextco if i recall correctly)
04/29/2013 02:01 marcbacor6666#12
how about memoryusage high , any tip where would i look
04/29/2013 03:41 U2_Caparzo#13
Quote:
Originally Posted by marcbacor6666 View Post
how about memoryusage high , any tip where would i look
Maps? :| That is the reason that servers will have a high memory usage, what u have to worry is how scalable is what u are coding, not the "base memory usage"
04/29/2013 05:34 LordGragen.#14
if you ask me the only good way to save is,

when the player logoff and when the server shutdown. thats all.
04/29/2013 05:51 go for it#15
Quote:
Originally Posted by LordGragen. View Post
if you ask me the only good way to save is,

when the player logoff and when the server shutdown. thats all.
so when player buy something you don't update his cps/gold until he relogin ?
when player trade/sellthrowbooth you don't remove the items from his inventory or update cps until he relogin ?
and count on that so many stuff :\

i still insist that the best way for updating the db is on the event itself , not with a timer and not on player logging off or even server shutting down
maybe you do not suffer from that at trinity as it's all well coded on changing cps it update the clients but if it wasn't done you was to understand why it should be there