Raised This Month: $ Target: $400
 0% 

CPU Usage with AMX Mod X


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bender
Guest
Old 03-09-2004 , 03:56   CPU Usage with AMX Mod X
Reply With Quote #1

Hi guys,

Thought I should get in early and say something about CPU usage. When coding AMX X, please at all times think "Will this feature benefit the users or just waste CPU time?".

CPU usage is something that server admins hate to see lots of, running 9 CS servers myself, people ask us to run new mods such as WC3 FT and CSDM, however every single one we've tried is excessively demanding on CPU - I can sit and watch a stock standard CS server with 16 players using maybe 10-15% CPU on an AMD 2700, throw WC3FT or CSDM onto it and you can see it sky rocket up to 60-70%, which a largely non profit community such as us will just say no to because it's uneconomical to be spending thousands on machines but only get 16 players on because the mod it runs eats CPU alive.

If you can create AMX X in a way such that it is efficient on CPU, then you can almost guarantee that people will use it. The original WC3 which is now over at InsaneJustice has until now been excellent, we've found it very good on CPU however lately they've started doing things like using VexD - which is notoriously agressive on CPU.

Just my 2 cents, you don't have to take it on board but it would be great to be able to run a mod on our servers that isn't overly agressive.
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 03-09-2004 , 04:26  
Reply With Quote #2

You are right, of course, especially with this "non profit" community.
We should try to keep CPU usage as low as possible at all times.

Generally though using a native like Entvars_Set_Int doesn't really eat a lot of CPU, it's more how you use it. A bad script that makes a lot of stuff with set_task, looping stuff on players all the time etc could eat more CPU than amx mod/x/adminmod ever will.

With that said, we do have the new engine module that basically consists of just about everything in vexd (it does, there is a vexd include file that has stocks that reroutes calls to vexd's native to use those in engine for backward compatibility). And this module even contains more.
We do this because there are really lots of opportunities in the HL SDK that as of yet has not been made available to small scripters because no one really made any good natives/forwards/other interfaces for them.
Take for instance the new register_message Bailopan has implemented (maybe its not working as it should yet, but just wait and see), with it scripters will be able to register a message, so that when it is called it is redirected to specifed script function, where scripter can choose to just pass it through as normal, or modify its contents, or block it altogether.

This IS really great new tools for scripters, I dare promise, cause it's not been available before. The limits are all the more to the scripters, I wonder what plugins we will see in a few weeks when we get the stuff here together properly (got some nasty bugs right now to sort out). However with this performance discussion it is probably even more important than ever to have an understanding of how to write un-CPU-intensive code.
Johnny got his gun is offline
MagicShot
Senior Member
Join Date: Mar 2004
Location: MN
Old 03-09-2004 , 04:30   Yeah..
Reply With Quote #3

I think this will also help scripts learn how to run a much tighter and less sloppy witten code than ever b4 also...

Shall be intresting to see indeed...
__________________
|v|agic$hot
.
Without a Sound
MagicShot is offline
Send a message via MSN to MagicShot Send a message via Yahoo to MagicShot
Bender
Guest
Old 03-09-2004 , 05:38  
Reply With Quote #4

Perhaps someone who's quite good at coding plugins could write a tutorial?
SniperBeamer
AMX Mod X Founder
Join Date: Jun 2003
Location: Good Old Europe
Old 03-09-2004 , 08:30  
Reply With Quote #5

the best way of learning how to script is looking at the default plugins...
__________________
SniperBeamer is offline
ReddBuLL
Junior Member
Join Date: Mar 2004
Location: Norway
Old 03-09-2004 , 10:57  
Reply With Quote #6

The solution to the problem would be to just go and buy a new AND better CPU
ReddBuLL is offline
Send a message via MSN to ReddBuLL
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 03-09-2004 , 16:08  
Reply With Quote #7

register_message.. that sounds like it *may* have been in the NS2AMX module.. you should look there, register_impulse would be great too!

I think the biggest complaint I heard about amx was cpu usage.. I never had any problems on my server (mainly for testing)
Probably what happened is a few people ran a bunch of sloppily coded plugins, resulting in high CPU usage, then went around to tell everyone they knew about it.
Part of it was the lack of documentation about AMX, I know its pretty confusing to set up at times, compared to everything available for adminmod

AMX is a lot more friendly, scripting wise, which means you get some plugins that shouldnt be released in their current state, but are
devicenull is offline
CroniK
Member
Join Date: Mar 2004
Location: Toulouse, France
Old 03-09-2004 , 17:43  
Reply With Quote #8

For my part, I was very surprised by the laod of my cpu with amxX.

With amx0.9.8 and valve metamod I was between 50 and 90% of cpu with a 15/16 slots server.I got 50/70 fps
With amxX ans the recompiled metamod included, I got 20/50 cpu usage and 80/100 fps GREAT!!!
__________________
CroniK

[FR] CroniK CS1.6 Server: 217.167.120.122:27015

Hosted by myself
CroniK is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 03-09-2004 , 17:53  
Reply With Quote #9

Quote:
Originally Posted by devicenull
register_message.. that sounds like it *may* have been in the NS2AMX module.. you should look there, register_impulse would be great too!

I think the biggest complaint I heard about amx was cpu usage.. I never had any problems on my server (mainly for testing)
Probably what happened is a few people ran a bunch of sloppily coded plugins, resulting in high CPU usage, then went around to tell everyone they knew about it.
Part of it was the lack of documentation about AMX, I know its pretty confusing to set up at times, compared to everything available for adminmod

AMX is a lot more friendly, scripting wise, which means you get some plugins that shouldnt be released in their current state, but are
NS2AMX, don't ever think Ive seen that module. Maybe you could hook me up with its files/info?
Johnny got his gun is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 03-09-2004 , 17:58  
Reply With Quote #10

Yup, these are the register_ stuff it has:
Quote:
native register_impulse(impulse, svCommand[],extra=0);
native _register_touch(classname, svCommand[],extra);
native _register_think(classname, svCommand[],extra);
native _register_spawn(classname, svCommand[],extra);
native register_clientkill(svCommand[]);

native register_msgblock(msgid);
native register_msgedit(msgid, szCommand[],extra=0);
native register_chlvl(szCommand[])
native register_playback(eventindex,szCommand[])
http://www.modns.org/forums/index.php?showtopic=117
and theres the url
its pretty much designed to add stuff to amx for natural selection, but I would think some of the code would be the same
devicenull is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode