Raised This Month: $12 Target: $400
 3% 

CPU consuming methods [stress testing]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 04-12-2015 , 07:39   CPU consuming methods [stress testing]
Reply With Quote #1

I'm looking for some method of creating CPU usage on a hlds server, via amxx if possible.

I came up with a way to make a 99% load , and it wasn't hard at all (lol) but I would like to be able to set my own percentage, aka tweak the values used to achieve different cpu usages, not 3.0% or 99%.

Is dis possible?
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viña del Mar, Chile
Old 04-12-2015 , 14:33   Re: CPU consuming methods [stress testing]
Reply With Quote #2

Purpose?
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 04-12-2015 , 22:07   Re: CPU consuming methods [stress testing]
Reply With Quote #3

Quote:
Originally Posted by aron9forever View Post
I'm looking for some method of creating CPU usage on a hlds server, via amxx if possible.

I came up with a way to make a 99% load , and it wasn't hard at all (lol) but I would like to be able to set my own percentage, aka tweak the values used to achieve different cpu usages, not 3.0% or 99%.

Is dis possible?
No idea what you mean but you can try

PHP Code:
new bool:True true;

while (
True)
{


__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 04-13-2015 , 03:44   Re: CPU consuming methods [stress testing]
Reply With Quote #4

Quote:
Originally Posted by meTaLiCroSS View Post
Purpose?
what purpose do you suppose stress testing has?
testing the system to see if it can handle the pressure
testing how hlds works in an environment where it has limits on cpu usage
seeing how it reacts to being limited to less than it needs

@claudiuhks
a while loop like that would eat 99.9%
I needed a way to create controllable usage, have 30%, 60%, 90%, whatever I want

I found my solution in PODbot, by tweaking the danger factor / number of bots I can achieve any usage I want, but I was wondering if I could do it in amxx
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-13-2015 , 06:45   Re: CPU consuming methods [stress testing]
Reply With Quote #5

Hook a forward called very often, like AddToFullPack and do some retards things with entities ; and the more entities you create the more often the function will be called.

Use natives which deals a lot things with the game.
__________________
Arkshine is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 04-13-2015 , 08:29   Re: CPU consuming methods [stress testing]
Reply With Quote #6

Quote:
Originally Posted by aron9forever View Post
a while loop like that would eat 99.9%
Well on Intel Core i7, that while loop seems to eat 13%. But yeah, to get random CPU usage, call functions very often. You can call some

PHP Code:
#include <amxmodx>
#include <engine>

public server_frame() {
  for (new 
Float:= -999999.0999999.0+= 0.1) {
  }

__________________

Last edited by claudiuhks; 04-13-2015 at 08:30.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 04-13-2015 , 09:05   Re: CPU consuming methods [stress testing]
Reply With Quote #7

Quote:
Originally Posted by claudiuhks View Post
Well on Intel Core i7, that while loop seems to eat 13%. But yeah, to get random CPU usage, call functions very often. You can call some

PHP Code:
#include <amxmodx>
#include <engine>

public server_frame() {
  for (new 
Float:= -999999.0999999.0+= 0.1) {
  }

Do you want to burn the machine?
__________________
Jhob94 is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 04-16-2015 , 09:32   Re: CPU consuming methods [stress testing]
Reply With Quote #8

Quote:
Originally Posted by claudiuhks View Post
Well on Intel Core i7, that while loop seems to eat 13%. But yeah, to get random CPU usage, call functions very often. You can call some

PHP Code:
#include <amxmodx>
#include <engine>

public server_frame() {
  for (new 
Float:= -999999.0999999.0+= 0.1) {
  }

that's because HLDS is single threaded and your consumption on windows shows out of total clock time, not per core as it does on linux
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 04-17-2015 , 23:14   Re: CPU consuming methods [stress testing]
Reply With Quote #9

Quote:
Originally Posted by aron9forever View Post
that's because HLDS is single threaded and your consumption on windows shows out of total clock time, not per core as it does on linux
I don't know what to say, but the computer still works really OK when and after hlds.exe reaches the infinite loop.
__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
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 17:06.


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