1. Takayuki KONDO
  2. linux-scalability-benchmarks

Commits

Wang Yuanxuan  committed 494533e

Lighttpd benchmark, unfinished scripts

  • Participants
  • Parent commits 1a52e63
  • Branches default

Comments (0)

Files changed (5)

File httpdbench/Makefile

View file
+default: config
+
+config:
+	./conf.py
+
+test:
+	./run-test.py
+
+clean:
+	rm -rf node*.conf

File httpdbench/conf.py

View file
+#!/usr/bin/python
+
+conf = r'''
+server.document-root = "%(webdir)s" 
+
+server.port = %(port)s
+server.bind = "%(ip)s"
+
+mimetype.assign = (
+  ".html" => "text/html", 
+  ".txt" => "text/plain",
+  ".jpg" => "image/jpeg",
+  ".png" => "image/png" 
+)
+
+index-file.names = ("index.html")
+'''
+
+iplist = ['10.131.1.133']
+port = 8111
+
+if __name__ == '__main__':
+	for i, ip in enumerate(iplist):
+		cfile = open('node%d.conf' % i, 'w')
+		cfile.write(conf % locals())
+	

File httpdbench/index.html

View file
+<html>
+    <head>
+        <title>Test Page</title>
+    </head>
+    <body>
+        <h1>Hello, World</h1>
+    </body>
+</html>
+

File httpdbench/node0.conf

View file
+
+server.document-root = "./" 
+
+server.port = 8111
+server.bind = "10.131.1.133"
+
+mimetype.assign = (
+  ".html" => "text/html", 
+  ".txt" => "text/plain",
+  ".jpg" => "image/jpeg",
+  ".png" => "image/png" 
+)
+
+index-file.names = ("index.html")

File httpdbench/run-test.py

View file
+#!/usr/bin/python
+
+from conf import *
+from subprocess import *
+
+startcmd = 'lighttpd -f node%(id)s.conf -D &'
+
+servers = []
+def start():
+	for id, ip in enumerate(iplist):
+		print startcmd % locals()
+		p = Popen(startcmd % locals(), shell=True)
+		servers.append(p)
+
+def test():
+	pass
+	
+start()