Register for your free account! | Forgot your password?

You last visited: Today at 01:35

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



albetros use cpu 100%

Discussion on albetros use cpu 100% within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2011
Posts: 106
Received Thanks: 9
albetros use cpu 100%

when the player up 50 +........
when the server run three hours ... or a limit time ...
the cpu is use 100%,,,


player's ping is 100000+...

why did that
somecode is offline  
Old 03/05/2012, 11:54   #2
 
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 785
We can't tell it without any info. Did you add anything? If yes, what?
I don't have a username is offline  
Old 03/05/2012, 16:54   #3
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
The source is not intended to be used as-is. There's a bunch of things you should consider re-writing if you wish to use it for a public server (can be said about all public sources on epvp).

That being said I haven't experienced such high cpu usage before and we were leaving the source running generally 24 hours per restart.


Likely Causes

Check your main threads. See how long they are taking to execute (use a stopwatch class which displays the MS it takes for each loop. If something is bad in that thread it will show up.)

Re-write the delayed action system. It was only there as a concept for testing. It's NOT intended to be used in a full server as each action = a timer.

Double check any new systems you've coded.


Past that my only small concern is... what type of system are you hosting with? Are you using a very low end VPS? It shouldn't be an issue but all our tests and hosting were done with a.. rather powerful dedicated server.
pro4never is offline  
Old 03/05/2012, 18:19   #4
 
elite*gold: 0
Join Date: Apr 2011
Posts: 106
Received Thanks: 9
Microsoft Windows server 2003
Intel(R) Core(TM)2 Cpu 6420 @2.13GHz
3.24GB Memory

...
i add a new thread .. Should be no problem..

PHP Code:
public void Run2()
      {
          
DateTime nbc DateTime.Now;
          while (
true)
          {
              try
              {
                  if (
Kernel.Clients.Count 0)
                  {
                      foreach (
Player role in Kernel.Clients.Values)
                      {
                          
//if (role.NobilityRecord != null)
                          
role.Send(role.GetNobilityIconPacket());
                      }
                  }
              }

              catch { }
              
Thread.Sleep(1000);
          }
      } 
somecode is offline  
Old 03/05/2012, 20:51   #5
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
.... few issues there...

#1: Before doing anything, switch Kernel.Clients to a threadsafe collection. I thought I had but according to error someone else got, i didn't. Because of that you'll get lots of issues.

#2: Why are you re-sending nobility information to all users every 1 second? There's no need! It updates AS PEOPLE DONATE. If it doesn't then it might have never been fully finished but that doesn't mean you write a wasteful thread to run it constantly... you just fix the system as it should work (async vs sync really here... Only change when it needs to be rather then constantly checking if it does need to be updated... or worse, updating it regardless of changes)
pro4never is offline  
Old 03/06/2012, 09:30   #6
 
elite*gold: 0
Join Date: Apr 2011
Posts: 106
Received Thanks: 9
Quote:
Originally Posted by pro4never View Post
.... few issues there...

#1: Before doing anything, switch Kernel.Clients to a threadsafe collection. I thought I had but according to error someone else got, i didn't. Because of that you'll get lots of issues.

#2: Why are you re-sending nobility information to all users every 1 second? There's no need! It updates AS PEOPLE DONATE. If it doesn't then it might have never been fully finished but that doesn't mean you write a wasteful thread to run it constantly... you just fix the system as it should work (async vs sync really here... Only change when it needs to be rather then constantly checking if it does need to be updated... or worse, updating it regardless of changes)
no ...

because if a player's donate value= another player's value ... it may be error
somecode is offline  
Old 03/06/2012, 16:37   #7
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
So change the existing update code.

What do you mean 'error'? If they both have the same exact amount of silver donated then whoever had the amount first should be ranked higher then them iirc.
pro4never is offline  
Old 03/06/2012, 18:20   #8
 
elite*gold: 0
Join Date: Apr 2011
Posts: 106
Received Thanks: 9
Quote:
Originally Posted by pro4never View Post
So change the existing update code.

What do you mean 'error'? If they both have the same exact amount of silver donated then whoever had the amount first should be ranked higher then them iirc.
check out you source ...
and setup it ...
i detection a player donate 99999999silver
another player donate 99999999silver
the rank list is wrong like
1 aplayer's name 99999999
1 aplayer's name 99999999
2 aplayer's name 99999998
it take the same rank ....

and ...if i make a npc to donate ... it can't update the rank list
somecode is offline  
Old 03/06/2012, 22:39   #9
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
Why on EARTH would you make an npc to donate when there's a full system which handles it already?


That's a very minor issue really... Just change the sorting of ranks and you're good to go.
pro4never is offline  
Old 03/07/2012, 09:23   #10
 
elite*gold: 0
Join Date: Apr 2011
Posts: 106
Received Thanks: 9
Quote:
Originally Posted by pro4never View Post
Why on EARTH would you make an npc to donate when there's a full system which handles it already?


That's a very minor issue really... Just change the sorting of ranks and you're good to go.
Ok ...i was fixed the bug

it's my dummy_user thread bug

thx-_-!
somecode is offline  
Reply


Similar Threads Similar Threads
albetros Big BUG in EffectThread
03/04/2012 - CO2 Private Server - 5 Replies
while (true) { if (Kernel.Clients > 0) { foreach (Player role in Kernel.Clients.Values) { ..... } } }
[Question]5518 Albetros Source
03/03/2012 - CO2 Private Server - 3 Replies
Hi guys! As some of you guys know, I started on creating a Conquer P-server recently.. using Albetros Source (Thanks to Pro4never):handsdown: But still I got lots to learn about creating a p-server :o I got lots of Question and I hope lots of good guys help me out with it :) I somehow manage to make it inside the game, but I encountered lots of things that arent working.:( Question: *How do I add Tower and Fan on Albetros Source and In-game? *How do I remove the the Quest In-game?
Need albetros source help ... Pro4ever[pls come here,thx]
02/17/2012 - CO2 Private Server - 1 Replies
iwant make 100+ static AIPlayer in market map or another map from database characters table when the user no in the game... it mean the AIPlayer didn't do anything -_-~ how can i do ... i read your code ... like duelist .... can you teach me how to code -_-!
albetros source question!!!
01/30/2012 - CO2 Private Server - 3 Replies
ok ... i only have one question ... what is the IrcBot? how can i use it fully ??
Albetros v5518 questions.
12/16/2011 - CO2 Private Server - 3 Replies
Okay so I have been looking around for a few guides to update this server I would like to complete the Shopping Mall and add Dail PK and more I would also like to have working mounts and packs (Stone Pack, Item Pack) if you could point me in the right direction I am sure I can figure it out from there. Thanks.



All times are GMT +1. The time now is 01:35.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.