Jump to content
  • 0
Sign in to follow this  
Almond Snicker

Questions about understanding Htop and CPU Usage

Question

Hi, 

I'm currently having issues on my cpu usage, it spikes up to 80% at some point and it causes lag to the server. 
Couple of questions to ask:
1.) Does an unstable client version affect the cpu usage of map?
2.) Having mysql Log-error on htop is normal?
3.) what are the possible reasons of the spiking of cpu usage?

Currently running game-64 of OVH hosted in SG. i7-7700 upto 4.5ghz and 64gb ram dedicated.

Here's what it look like:
image.thumb.png.0695365006acf128be1a84cae810b664.png

 

Share this post


Link to post
Share on other sites

15 answers to this question

Recommended Posts

  • 0
Just now, cjvirus09 said:

It might be related to your scripts having infinite loop or something else related to script.

do you mind sharing what script lines does these infinite loops? or what script lines should I avoid?

Share this post


Link to post
Share on other sites
  • 0
Just now, Almond Snicker said:

do you mind sharing what script lines does these infinite loops? or what script lines should I avoid?

Avoid using while() loop as much as possible. You may use freeloop(true) as recommend in doc. Also avoid using "OnPCLoadMapEvent:".

Share this post


Link to post
Share on other sites
  • 0
Just now, cjvirus09 said:

Avoid using while() loop as much as possible. You may use freeloop(true) as recommend in doc. Also avoid using "OnPCLoadMapEvent:".

noted, how about timers? or gettimeticks?

 

Share this post


Link to post
Share on other sites
  • 0
Just now, Almond Snicker said:

noted, how about timers? or gettimeticks?

 

I prefer using this.

 

*initnpctimer({"<NPC name>"{, <Attach Flag>}})
*initnpctimer({<Attach Flag>})
*stopnpctimer({"<NPC name>"{, <Detach Flag>}})
*stopnpctimer({<Detach Flag>}})
*startnpctimer({"<NPC name>"{, <Attach Flag>}})
*startnpctimer({<Attach Flag>})
*setnpctimer(<tick>{, "<NPC name>"})
*getnpctimer(<type of information>{, "<NPC name>"})
*attachnpctimer({"<character name>"})
*detachnpctimer({"<NPC name>"})
 

Disguise Event is a good reference for timer.

Share this post


Link to post
Share on other sites
  • 0
1 minute ago, Almond Snicker said:

Does scripts only does this issues? how about source files?

It depends. You should be able to guess it if you made those changes either in source files or the scripts. If it does not happen before, you should know what to do. 

Share this post


Link to post
Share on other sites
  • 0

actually it has been my problem for over a month now, I just upgraded the server host and it lessened this issue maybe because it can cover the issue more than before. but thinking of the server specs, I think it is already an overkill for a host of 300+ players connected. and it is not like this all the time, it only happens for a certain time.

Share this post


Link to post
Share on other sites
  • 0

never use command

freeloop

it allow infinite or very long loops and this can be slow

 

also if you using some plugins, code can be not optimal and slow.

 

Share this post


Link to post
Share on other sites
  • 0

yes source modifications can be bad too

if this is production server hard to say where is issue.

if this is testing server, you can try check same on clean hercules.

Share this post


Link to post
Share on other sites
  • 0

no load not depend on client version.

load depend on players. more players most time mean more load on server.

also on your screen 81% is high, but it's not 100%

 

Share this post


Link to post
Share on other sites
  • 0

Wondering @4144 maybe you have inputs on this

will autosave_time release more load from the map serve if you make it more that your avg players? autosave_time > avg players? with avg players of 300 will  600(auto save time) make it better?

Also for minsave_time by increasing it will slow down the saving time. will it be better? if you have 300 players avg?

		// Database autosave time
		// All characters are saved on this time in seconds (example:
		// autosave of 60 secs with 60 characters online -> one char is
		// saved every second)
		autosave_time: 300

		// Min database save intervals (in milliseconds)
		// Prevent saving characters faster than at this rate (prevents
		// char-server save-load getting too high as character-count
		// increases)
		minsave_time: 100

 

Share this post


Link to post
Share on other sites
  • 0

idk what is better. try default values or change them a bit

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.