Author Topic: NWN server CPU monitor  (Read 1281 times)

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
NWN server CPU monitor
« on: February 23, 2011, 09:46:42 am »


               Hey, is there any utility that would allow me to monitor CPU load of NWN server?

I recently made a big cleanup and I would like to see exact results in long term run. Any tips?
               
               

               
            

Legacy_Calvinthesneak

  • Hero Member
  • *****
  • Posts: 1159
  • Karma: +0/-0
NWN server CPU monitor
« Reply #1 on: February 23, 2011, 10:19:52 am »


               Won't this do what is required?

http://nwn.virusman....plugins/system/


EDIT:  Bwhaha Baaelos and I had the same idea apparently.
               
               

               


                     Modifié par Calvinthesneak, 23 février 2011 - 10:26 .
                     
                  


            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
NWN server CPU monitor
« Reply #2 on: February 23, 2011, 10:20:42 am »


               I think there is a nwnx plugin called nwnx_system or something or other, that can measure cpu usage.



Alternatively, you can use windows, to set cpu monitor on your application etc.



thing to note though, is that CPU Monitors are not always accurate.

the way the CPU Monitor class from the System.Diagnostics framework/namespace of C# works, is that it measures a value for the cpu NOW, and then waits 1 second or so, and then measures it again, and its only when it measures the cpu usage over a duration, that it returns it.

Some irrelevent information, but anyhow...
               
               

               
            

Legacy_Calvinthesneak

  • Hero Member
  • *****
  • Posts: 1159
  • Karma: +0/-0
NWN server CPU monitor
« Reply #3 on: February 23, 2011, 10:36:51 am »


               FYI, Function Headers for System





/* Get a listing of the files in sDir, separated by "\\n". */

string DirList (string sDir);



/* Get the entire contents of the file sFile. */

string FileReadAll (string sFile);



/* Copy the file sFrom to sTo. Returns >0 on success. */

int FileCopy (string sFrom, string sTo);



/* Delete the file sFile. Returns >0 on success. */

int FileDelete (string sFile);



/* Link the file sFrom to sTo. Returns >0 on success. */

int FileLink (string sFrom, string sTo);



/* Rename the file sFrom to sTo. Returns >0 on success. */

int FileRename (string sFrom, string sTo);



/* Symlink the file sFrom to sTo. Returns >0 on success. */

int FileSymlink (string sFrom, string sTo);



/* Get the CPU usage values for the current process. */

struct CPUUsage GetProcessCPUUsage ();



/* Get an estimate of memory used by the current process in bytes. */

int GetProcessMemoryUsage ();



/* Get the current system time in seconds since the epoch. */

int GetSystemTime ();



/* Get the current process TMI limit. The nwserver default is 131071. */

int GetTMILimit ();



/* Set the current process TMI limit, with a minimum of 16k and a maximum of 8M. */

void SetTMILimit (int nLimit);



/* Shut down the current process. If nForce is specified, the process will be

* force-killed in that number of seconds, in case it hangs during shutdown. */

void ShutdownServer (int nForce=0);




               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
NWN server CPU monitor
« Reply #4 on: February 23, 2011, 10:47:26 am »


               

Baaleos wrote...

I think there is a nwnx plugin called nwnx_system or something or other, that can measure cpu usage.

Alternatively, you can use windows, to set cpu monitor on your application etc.

thing to note though, is that CPU Monitors are not always accurate

Im on windows. Well not accurate, but is there better way?
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
NWN server CPU monitor
« Reply #5 on: February 23, 2011, 01:02:11 pm »


               I would recommend the nwnx_system plugin, since it avoids the hassle of having to work on external applications and monitors.



But note - Monitoring cpu usage, consumes a little cpu usage.

Its like Running software through a debugger, watching the code, affects the code.