Sunday, December 17

Geek

All My Servers Are The Same Speed!

I was going to run some little benchmarks to compare the speed of my web servers (Akane, Nabiki and Ranma) and my development servers at home (Naga and Martina).

But the results weren't very interesting, because they're all the same.

Akane and Nabiki are Opteron 170s: dual-core 64-bit 2.0GHz.
Ranma is an Athlon XP 3000+: single-core 32-bit 2.16GHz.
Martina is an Athlon XP 2800+: single-core 32-bit 2.08GHz.
Naga is an Athlon 64 3200+: single-core 64-bit 2.0GHz.

Naga is the only one running a 64-bit kernel, and hence a 64-bit Python.

I also checked up on Namo, the little Celeron box I got to run The Jawa Report when we were getting DDoSed. Kei and Yuri seem to be down right now... Uh, which is bad. They should be alive until the end of the month.

After making my benchmark self-timing, so that I can run it on Windows, I can add:

Lina: Pentium 4 2.6GHz
Amelia: Core Duo 1.66GHz
Haruhi: Core 2 Duo 2.4GHz

I'm not going to bother running tests on Sylphiel and Kyon, my Linux virtual machines, because the times vary by +/- 20% due to the clock problems I mentioned earlier.

SystemCPUClockPythonLoopStringScanTotal
NagaAthlon 642.0GHz2.5/64-bit1.7372.0301.3375.103
AkaneOpteron2.0GHz2.51.8872.7330.8805.500
MartinaAthlon XP2.08GHz2.51.8172.7930.8675.447
RanmaAthlon XP2.16GHz2.51.7602.6970.8405.297
LinaPentium 42.6GHz2.5 (Win)2.0385.0580.8757.971
HaruhiCore 2 Duo2.4GHz2.5 (Win)0.6441.9330.4773.053
AmeliaCore Duo1.66GHz2.5 (Win)1.2433.1581.0335.434
NamoCeleron1.7GHz2.4.33.0474.8931.9609.900

You can see why all the servers for the New Site are going to be Core 2 Duos. I'll probably migrate mu.nu to Core 2 Duo servers some time in '07 as well - the monthly charge is the same. I just have to wait until SoftLayer are offering their double-memory deal again.

And here's the reason why I'm going to stick with the 32-bit kernel for the application servers:

SystemCPUClockPythonLoopStringScanTotal
HaruhiCore 2 Duo2.4GHz2.5 (Win)+Psyco0.0120.2730.5540.839

Psyco is a JIT compiler for Python. While it doesn't always improve performace, when it does, the advantage can be huge, and you can tell it to compile only specific functions if you need to.

Psyco produces 32-bit code. It doesn't work at all on 64-bit Python, and if you run a 32-bit Python on a 64-bit kernel, the overhead of the compatibility layer makes Psyco slower than the standard interpreter.

Code:

import time
 
def loop():
  d=0
  for i in xrange(10000000):
    d+=1
 
def str():
  for i in xrange(100):
    e=''
    for j in xrange(100000):
      e+='.'
      
def scan():
  d=0
  for i in xrange(10):
    e=''
    for j in xrange(10000):
      d+=1
      e+='.'
      f=e.find(',')
 
def run(p,label):
  n=3
  t0=time.clock()
  for i in xrange(n):
    p()
  t=(time.clock()-t0)/n
  pp(t,label)
  return t
 
def pp(t, label):
  print '%s: %3.3f' % (label, t)
 
t=0
t+=run(loop,'Loop')
t+=run(str,'String')
t+=run(scan,'Scan')
pp(t,'Total')

Posted by: Pixy Misa at 09:54 PM | No Comments | Add Comment | Trackbacks (Suck)
Post contains 438 words, total size 4 kb.

Comments are disabled. Post is locked.
47kb generated in CPU 0.0141, elapsed 0.5621 seconds.
54 queries taking 0.5539 seconds, 338 records returned.
Powered by Minx 1.1.6c-pink.