Archive

Archive for December, 2008

Perl vs PHP, speed.

December 27th, 2008

I’ve decided to start writing my own control panel in Perl. Why? Perl is faster than PHP.

gary@longhorn:~$ time perl -v
 
This is perl, v5.8.8 built for i386-freebsd-64int
(with 1 registered patch, see perl -V for more detail)
 
Copyright 1987-2006, Larry Wall
 
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
 
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
 
 
real    0m0.004s
user    0m0.000s
sys     0m0.004s

Think that is slow? .. Think again:

 
gary@longhorn:~$ time php -v 
PHP 4.4.8 (cgi) (built: Apr  2 2008 02:24:49)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
 
real    0m0.261s
user    0m0.033s
sys     0m0.024s

Perl wins. And if you ask, both of these were ran on an idle machine, so cached data in L1 really isn’t a factor..

Personally, thttpd + perl is the way to go. In order to have a lightweight control panel, you need a lightweight webserver. Apache 2.0 and upwards pretty much blow, and 1.3 isn’t really supported anymore. PHP has too much bloat to run on a production machine.

Code

The Best Linux Distro is….

December 20th, 2008

NONE OF THEM. They all use the same software, both kernel and userland. The difference is some may package with a newer kernel, and a more up-to-date gcc/glibc/binutils.

Precompiled binaries aren’t a bad thing, but Gentoo is probably the only distro I’d ever use.

Misc

The 12,000fps myth..

December 14th, 2008

Throwing more fps to the gameserver doesn’t fix the fact it sucks under load, due to the usage of horrible APIs.

They are more or less lying about the FPS by making nanosleep wake up early. I doubt they are running their clock interrupt at 12K.

let’s say the game requests a usleep(1000) and it won’t wake up for about 7-8ms due to scheduler latency. well, they basically made usleep(1000) return about 100 or so, which is lying to the engine.

A kernel running at 1000hz should give about 1000fps or so (erroring is about 5 to 10%), so how is it a gameserver can run higher than the HZ of the system? clock aliasing? … they are lying about when to wake up.

There are some patches out there to allow more than 1k for interrupts. This has a side effect of cache line ping pongs and other horrible behavior like clock skewing, and clock drifting..

Bottom line, you won’t notice a difference between 2000 and 12000. And, if you are able to run your clock interrupt higher (a couple of providers I know can do this) then it isn’t lying, it’s more or less correct; but you are talking about microsecond improvements in frame time.. a human can’t tell the difference between a microsecond and a nanosecond.. This is mostly bullshit marketing. I’ve had the engine cranked up so high that all excess CPU cycles were busy waking up *exactly* as requested, regardless of scheduler latency. This gave the best behavior, serverside, but the most cpu usage.

After about 3128fps on Source, the engine’s positives turn negative due to all the problems I mentioned previously.

Instead of doing all that horseshit, fix the APIs in the game.

Drama, Game Stuff

OMFG BAD REG

December 8th, 2008

Customer B complains that his teammates can’t kill anyone. Provider A checks on machine. Machine is green/green/green (load, network, etc)

Provider A goes into server. Provider A can kill someone with a weapon. Customer B tries to kill provider A. Provider A has 10 life left. Customer B says “THAT WAS A FUCKING HEADSHOT” . Customer B proceeds to say the server is junk. Provider A looks at the hlstatsX logs showing hit location etc. Provider A sees that he aimed at the chest.

End result? Either 1.) the user keeps fucking with interp settings making the game out of sync with other users or 2.) he aimed at the head and there was a prediction error.

:p

Game Stuff, Misc

Left 4 Dead; A small serverside tweak guide.

December 4th, 2008

Left 4 Dead only requires a 30hz system interrupt clock at the minimum to operate. High resolution timers for the game are useless and do nothing but fire off interrupts so often.

Just reduce HZ to 100 for the best possible CPU usage, and optimal performance.

Game Stuff

Why PB and VAC2 don’t do anything

December 3rd, 2008

Punkbuster is supposed to be the defacto cheat detection for games..

The biggest ‘flaw’ with PB is it’s banning. It bans cheaters.. while this may seem OK to some of you, public humiliation is not the answer. If I were to go get kicked/banned for cheating in a PB enabled game, I would be posted on one of the few anticheat sites with people slandering me etc.. Then I would go buy another key/game/whatever and continue to hack because I was publicly humiliated. Anticheat sites are full of paranoid people who look at everyone as a cheater.

Instead of wasting time banning cheaters, why don’t you stop cheats from working. I did it in OSP, and some games aren’t easily hackable. Banning cheaters is a waste of time, stopping cheats from working is more worthwhile than the former.

VAC2 has the right idea, sorta, with delayed banning. But it doesn’t solve the technical problem of flawed APIs that can be used to write whatever hacks.

The only way you are ever going to stop anyone from cheating is prevent them from reading and writing to memory.

-M

Game Stuff